From dff334b25640a06fa9037882c2714ea1f8925608 Mon Sep 17 00:00:00 2001 From: Mwangilwa Zimba Date: Wed, 21 Aug 2024 12:48:07 +0200 Subject: [PATCH 01/47] IME-2 [PM4ML-FXP] Update UI - Transfer Details --- .env | 2 +- .../components/TransferDetails/index.tsx | 111 ++++++++++++------ 2 files changed, 76 insertions(+), 37 deletions(-) diff --git a/.env b/.env index 39faa7c..1a06ece 100644 --- a/.env +++ b/.env @@ -2,4 +2,4 @@ SKIP_PREFLIGHT_CHECK=true PROXY_TARGET=http://senderfsp-pm4ml.qa.prod-dev.mbox-dev.io:20000 PROXY_PORT=10000 PROXY_API_PATH=/experience-api -PORT=8081 +PORT=3000 diff --git a/src/App/Transfers/components/TransferDetails/index.tsx b/src/App/Transfers/components/TransferDetails/index.tsx index da21a39..02d71f9 100644 --- a/src/App/Transfers/components/TransferDetails/index.tsx +++ b/src/App/Transfers/components/TransferDetails/index.tsx @@ -175,16 +175,26 @@ const TransferDetailsView: FC = ({ model }) => {
- Basic Information + Transfer Details Technical Details -
- +
+
-
+
= ({ model }) => { value={model.technicalDetails.transferState} />
+
+ +
+
+ +
+ -
- +
+
-
+
+ +
+
= ({ model }) => { value={model.initiatedTimestamp} />
- - -
- -
-
- -
-
- -
+
-
+ + +
+ +
+
+ +
+
+ +
+
-
+
-
+
= ({ model }) => { value={`${model.technicalDetails.payeeParty.idType} ${model.technicalDetails.payeeParty.idValue}`} />
- - -
+
+ +
+
-
+ + +
+ +
+
+
+ +
From 5fc9ba53396fd4d648b58b9ee3b26e98226102bf Mon Sep 17 00:00:00 2001 From: Mwangilwa Zimba Date: Fri, 30 Aug 2024 09:11:01 +0200 Subject: [PATCH 02/47] IME-2 Transfer Details conversion fields --- .../components/TransferDetails/index.tsx | 46 +++++++++++++++---- src/App/Transfers/types.ts | 35 +++++++++++++- 2 files changed, 72 insertions(+), 9 deletions(-) diff --git a/src/App/Transfers/components/TransferDetails/index.tsx b/src/App/Transfers/components/TransferDetails/index.tsx index 02d71f9..0911f27 100644 --- a/src/App/Transfers/components/TransferDetails/index.tsx +++ b/src/App/Transfers/components/TransferDetails/index.tsx @@ -212,7 +212,12 @@ const TransferDetailsView: FC = ({ model }) => { />
- +
@@ -247,13 +252,28 @@ const TransferDetailsView: FC = ({ model }) => {
- +
- +
- +
= ({ model }) => { />
- +
@@ -303,11 +328,16 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Conversion Institution" type="text" - value={model.institution} + value={model.technicalDetails.fxProviders} />
- +
diff --git a/src/App/Transfers/types.ts b/src/App/Transfers/types.ts index ffe1c46..419fe18 100644 --- a/src/App/Transfers/types.ts +++ b/src/App/Transfers/types.ts @@ -108,6 +108,7 @@ export interface TransferParty { dateOfBirth?: string; merchantClassificationCode?: string; fspId: string; + supportedCurrencies: string[]; extensionList?: ExtensionListItem[]; } @@ -128,7 +129,31 @@ export interface TransferDetailsError { export interface TransferTechnicalDetailsApiMessage { headers?: object; - body?: object; + body?: { + payeeReceiveAmount?: { + currency: string; + amount: string; + }; + transactionType?: { + scenario: string; + }; + completedTimestamp: string; + transferState: string; + }; +} + +export interface FXResponses { + body: { + conversionTerms: { + conversionId: string; + expiration: string; + }; + }; +} + +export interface FxTransferResponses { + conversionState: string; + completedTimestamp: string; } export interface TransferTechnicalDetails { @@ -143,11 +168,16 @@ export interface TransferTechnicalDetails { getPartiesResponse?: TransferTechnicalDetailsApiMessage; quoteRequest?: TransferTechnicalDetailsApiMessage; quoteResponse?: TransferTechnicalDetailsApiMessage; + fxQuotesResponse?: FXResponses; + fxQuotesResponseSource?: FXResponses; transferPrepare?: TransferTechnicalDetailsApiMessage; transferFulfilment?: TransferTechnicalDetailsApiMessage; lastError?: TransferDetailsError; + fxProviders: string[]; + fxTransferResponse?: FxTransferResponses; } +// Includes the type property to the TransferDetails Interface. export interface TransferDetails { id: string; confirmationNumber: number; @@ -161,6 +191,9 @@ export interface TransferDetails { status: string; initiatedTimestamp: string; technicalDetails: TransferTechnicalDetails; + transactionType: string; + currentState: string; + type: string; } export enum DateRange { From c3ffaa12e7ba94e92d13e3c91b69b76d4b85116d Mon Sep 17 00:00:00 2001 From: Mwangilwa Zimba Date: Wed, 4 Sep 2024 09:18:40 +0200 Subject: [PATCH 03/47] IME-2 Updated transfer overview, transfer details, transfer terms, transfer parties user interfaces --- .env | 2 +- data.json | 212 ++++++++ .../components/TransferDetails/index.tsx | 441 ++++++++++++++- .../TransfersErrors/TransfersErrorsModal.tsx | 17 +- .../components/TransfersErrors/index.tsx | 18 +- src/App/Transfers/types.ts | 133 +++-- src/utils/apis.ts | 8 +- .../src/page-objects/components/Transfers.js | 502 +++++++++--------- .../pages/TransferDashboardPage.ts | 472 ++++++++-------- 9 files changed, 1282 insertions(+), 523 deletions(-) create mode 100644 data.json diff --git a/.env b/.env index 1a06ece..1ee81ea 100644 --- a/.env +++ b/.env @@ -2,4 +2,4 @@ SKIP_PREFLIGHT_CHECK=true PROXY_TARGET=http://senderfsp-pm4ml.qa.prod-dev.mbox-dev.io:20000 PROXY_PORT=10000 PROXY_API_PATH=/experience-api -PORT=3000 +PORT=5500 diff --git a/data.json b/data.json new file mode 100644 index 0000000..fd30d99 --- /dev/null +++ b/data.json @@ -0,0 +1,212 @@ +{ + "transferId": "string", + "transferState": "succeeded", + "direction": "INBOUND", + "transactionType": "TRANSFER", + "confirmationNumber": 0, + "sendAmount": "string", + "sendCurrency": "AED", + "dateSubmitted": "2024-08-28T09:43:39.199Z", + "receiveAmount": "7.99", + "receiveCurrency": "AED", + "conversionSubmitted": "2023-12-25T14:17:09.663+01:00", + "senderDetails": { + "idType": "MSISDN", + "idValue": "string" + }, + "recipientDetails": { + "idType": "MSISDN", + "idValue": "string" + }, + "recipientCurrencies": "AED", + "recipientInstitution": "dfsp2", + "conversionInstitution": "Global-FXP", + "conversionState": "succeeded", + "initiatedTimestamp": "2024-08-28T09:43:39.199Z", + "transferTerms": { + "transferId": "string", + "quoteAmount": { + "amount": "string", + "currency": "AED" + }, + "quoteAmountType": "SEND", + "transferAmount": { + "amount": "string", + "currency": "AED" + }, + "payeeReceiveAmount": { + "amount": "string", + "currency": "AED" + }, + "payeeDfspFee": { + "amount": "string", + "currency": "AED" + }, + "payeeDfspCommision": { + "amount": "string", + "currency": "AED" + }, + "expiryDate": "2024-08-28T09:43:39.199Z", + "conversionTerms": { + "transferAmount": { + "amount": "string", + "currency": "AED" + }, + "charges": [ + {} + ], + "exchangeRate": "string", + "expiryDate": "2024-08-28T09:43:39.199Z" + } + }, + "transferParties": { + "transferId": "string", + "transferState": "ERROR_OCCURRED", + "transferType": "Payment", + "payerParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "string", + "idSubValue": "string", + "displayName": "string", + "firstName": "string", + "middleName": "string", + "lastName": "string", + "dateOfBirth": "string", + "merchantClassificationCode": "string", + "fspId": "string", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + }, + "payeeParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "string", + "idSubValue": "string", + "displayName": "string", + "firstName": "string", + "middleName": "string", + "lastName": "string", + "dateOfBirth": "string", + "merchantClassificationCode": "string", + "fspId": "string", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "technicalDetails": { + "schemeTransferId": "string", + "transactionId": "string", + "quoteId": "string", + "homeTransferId": "string", + "payerParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "string", + "idSubValue": "string", + "displayName": "string", + "firstName": "string", + "middleName": "string", + "lastName": "string", + "dateOfBirth": "string", + "merchantClassificationCode": "string", + "fspId": "string", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + }, + "payeeParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "string", + "idSubValue": "string", + "displayName": "string", + "firstName": "string", + "middleName": "string", + "lastName": "string", + "dateOfBirth": "string", + "merchantClassificationCode": "string", + "fspId": "string", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + }, + "transferState": "ERROR_OCCURRED", + "getPartiesRequest": { + "headers": {}, + "body": {} + }, + "getPartiesResponse": { + "headers": {}, + "body": {} + }, + "quoteRequest": { + "headers": {}, + "body": {} + }, + "quoteResponse": { + "headers": {}, + "body": {} + }, + "fxQuoteRequest": { + "headers": {}, + "body": {} + }, + "fxQuoteResponse": { + "conversionId": "string", + "conversionQuoteId": "string", + "initiatingFsp": "PayerFSP", + "counterPartyFsp": "testfxp1", + "amountType": "SEND", + "sourceAmount": {}, + "targetAmount": {}, + "conversionSubmitted": "2023-12-25T14:17:09.663+01:00", + "conversionState": "ERROR_OCCURRED", + "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "expiration": "2023-12-25T14:17:09.663+01:00", + "charges": [ + {} + ] + }, + "fxTransferPrepare": { + "headers": {}, + "body": {} + }, + "fxTransferFulfilment": { + "transferState": "COMMITTED", + "fulfilment": "kDOgQH81DGGZ7nZaExSCAB9Y2e74Po564CStclCoukI", + "completedTimestamp": "2024-08-27T06:44:46.180Z" + }, + "lastError": { + "httpStatusCode": 0, + "mojaloopError": { + "errorInformation": { + "errorCode": "string", + "errorDescription": "string", + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/App/Transfers/components/TransferDetails/index.tsx b/src/App/Transfers/components/TransferDetails/index.tsx index 0911f27..23adf31 100644 --- a/src/App/Transfers/components/TransferDetails/index.tsx +++ b/src/App/Transfers/components/TransferDetails/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable jsx-a11y/label-has-associated-control */ import React, { FC, useState } from 'react'; import { connect } from 'react-redux'; import { State, Dispatch } from 'store/types'; @@ -176,6 +177,8 @@ const TransferDetailsView: FC = ({ model }) => { Transfer Details + Transfer Terms + Transfer Parties Technical Details @@ -186,7 +189,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Transfer ID" type="text" - value={model.id} + value={model.transferId} style={{ whiteSpace: 'nowrap', overflow: 'hidden', @@ -199,7 +202,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Transfer State" type="text" - value={model.technicalDetails.transferState} + value={model.transferState} />
@@ -216,21 +219,26 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Transaction Type" type="text" - value={model.type} + value={model.transactionType} />
- +
@@ -238,7 +246,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Date Submitted" type="text" - value={model.initiatedTimestamp} + value={model.dateSubmitted} />
@@ -256,7 +264,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Receive Amount" type="text" - value={model.technicalDetails.quoteResponse?.body?.payeeReceiveAmount?.amount} + value={model.receiveAmount} />
@@ -264,7 +272,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Receive Currency" type="text" - value={model.technicalDetails.quoteResponse?.body?.payeeReceiveAmount?.currency} + value={model.receiveCurrency} />
@@ -272,7 +280,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Conversion Submitted" type="text" - value={model.technicalDetails.fxQuotesResponse?.body.conversionTerms.expiration} + value={model.conversionSubmitted} />
@@ -290,7 +298,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Sender Details" type="text" - value={`${model.technicalDetails.payerParty.idType} ${model.technicalDetails.payerParty.idValue}`} + value={`${model.senderDetails.idType} ${model.senderDetails.idValue}`} />
@@ -299,7 +307,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Recipient Details" type="text" - value={`${model.technicalDetails.payeeParty.idType} ${model.technicalDetails.payeeParty.idValue}`} + value={`${model.recipientDetails.idType} ${model.recipientDetails.idValue}`} />
@@ -307,7 +315,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Recipient Currencies" type="text" - value={model.technicalDetails.quoteResponse?.body?.payeeReceiveAmount?.currency} + value={model.recipientCurrencies} />
@@ -315,20 +323,25 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Recipient Institution" type="text" - value={model.technicalDetails.payeeParty.fspId} + value={model.recipientInstitution} />
- +
@@ -336,9 +349,405 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Conversion State" type="text" - value={model.technicalDetails.fxTransferResponse?.conversionState} + value={model.conversionState} + /> +
+
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + + + + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + + + + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+
+
+
+ + +
+ +
+
+
+
+ +
+
+ +
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+
+
+ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+
diff --git a/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx b/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx index bd8793e..60bc8b4 100644 --- a/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx +++ b/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx @@ -34,7 +34,22 @@ const transfersErrorsColumns = [ { label: 'Direction', key: 'direction', func: helpers.toSpacedPascalCase }, { label: 'Type', key: 'type', className: 'col-100' }, { - label: 'Value', + label: 'Send Value', + key: 'amount', + func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, + }, + { + label: 'Send Currency', + key: 'amount', + func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, + }, + { + label: 'Receive Value', + key: 'amount', + func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, + }, + { + label: 'Receive Currency', key: 'amount', func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, }, diff --git a/src/App/Transfers/components/TransfersErrors/index.tsx b/src/App/Transfers/components/TransfersErrors/index.tsx index d1830c3..ab11a08 100644 --- a/src/App/Transfers/components/TransfersErrors/index.tsx +++ b/src/App/Transfers/components/TransfersErrors/index.tsx @@ -20,7 +20,23 @@ const transfersErrorsColumns = [ { label: 'Direction', key: 'direction', func: helpers.toSpacedPascalCase }, { label: 'Type', key: 'type' }, { - label: 'Value', + label: 'Send Value', + key: 'amount', + func: (sendAmount: string, item: TransferError) => `${sendAmount}`, + }, + { + label: 'Send Currency', + key: 'amount', + func: (sendAmount: string, item: TransferError) => + `${getCurrencySymbol(item.currency)} ${sendAmount}`, + }, + { + label: 'Receive Value', + key: 'amount', + func: (amount: string, item: TransferError) => `${getCurrencySymbol(item.currency)} ${amount}`, + }, + { + label: 'Receive Currency', key: 'amount', func: (amount: string, item: TransferError) => `${getCurrencySymbol(item.currency)} ${amount}`, }, diff --git a/src/App/Transfers/types.ts b/src/App/Transfers/types.ts index 419fe18..791a83c 100644 --- a/src/App/Transfers/types.ts +++ b/src/App/Transfers/types.ts @@ -129,31 +129,62 @@ export interface TransferDetailsError { export interface TransferTechnicalDetailsApiMessage { headers?: object; - body?: { - payeeReceiveAmount?: { - currency: string; - amount: string; - }; - transactionType?: { - scenario: string; - }; - completedTimestamp: string; - transferState: string; - }; + body?: object; } -export interface FXResponses { - body: { - conversionTerms: { - conversionId: string; - expiration: string; - }; - }; +export interface SenderDetails { + idType: string; + idValue: string; } -export interface FxTransferResponses { - conversionState: string; - completedTimestamp: string; +export interface RecipientDetails { + idType: string; + idValue: string; +} + +export interface QuoteAmount { + amount: string; + currency: string; +} + +export interface TransferAmount { + amount: string; + currency: string; +} + +export interface PayeeReceiveAmount { + amount: string; + currency: string; +} + +export interface PayeeDfspFee { + amount: string; + currency: string; +} + +export interface PayeeDfspCommision { + amount: string; + currency: string; +} + +export interface ConversionTerms { + transferAmount: { + amount: string; + currency: string; + }; + charges?: { + chargeType: string; + sourceAmount?: { + amount: string; + currency: string; + }; + targetAmount?: { + amount: string; + currency: string; + }; + }; + exchangeRate: string; + expiryDate: string; } export interface TransferTechnicalDetails { @@ -168,32 +199,64 @@ export interface TransferTechnicalDetails { getPartiesResponse?: TransferTechnicalDetailsApiMessage; quoteRequest?: TransferTechnicalDetailsApiMessage; quoteResponse?: TransferTechnicalDetailsApiMessage; - fxQuotesResponse?: FXResponses; - fxQuotesResponseSource?: FXResponses; transferPrepare?: TransferTechnicalDetailsApiMessage; transferFulfilment?: TransferTechnicalDetailsApiMessage; lastError?: TransferDetailsError; fxProviders: string[]; - fxTransferResponse?: FxTransferResponses; } +export interface TransferTerms { + transferId: string; + homeTransferId: string; + quoteAmount: QuoteAmount; + quoteAmountType: string; + transferAmount: TransferAmount; + payeeReceiveAmount: PayeeReceiveAmount; + payeeDfspFee: PayeeDfspFee; + payeeDfspCommision: PayeeDfspCommision; + expiryDate: string; + conversionTerms: ConversionTerms; +} + +export interface TransferParties { + transferId: string; + transferState: string; + transferType: string; + payerParty: TransferParty; + payeeParty: TransferParty; + quoteId: string; + getPartiesRequest?: TransferTechnicalDetailsApiMessage; + getPartiesResponse?: TransferTechnicalDetailsApiMessage; + quoteRequest?: TransferTechnicalDetailsApiMessage; + quoteResponse?: TransferTechnicalDetailsApiMessage; + transferPrepare?: TransferTechnicalDetailsApiMessage; + transferFulfilment?: TransferTechnicalDetailsApiMessage; + lastError?: TransferDetailsError; + fxProviders: string[]; +} // Includes the type property to the TransferDetails Interface. export interface TransferDetails { - id: string; + transferId: string; + transferState: string; confirmationNumber: number; - amount: string; - currency: string; - institution: string; + transactionType: string; + sendAmount: string; + sendCurrency: string; + conversionSubmitted: string; + conversionInstitution: string; + conversionState: string; direction: string; - sender: string; - recipient: string; - details: string; - status: string; + receiveAmount: string; + receiveCurrency: string; + recipientCurrencies: string; + senderDetails: SenderDetails; + recipientDetails: RecipientDetails; + recipientInstitution: string; initiatedTimestamp: string; + dateSubmitted: string; technicalDetails: TransferTechnicalDetails; - transactionType: string; - currentState: string; - type: string; + transferParties: TransferParties; + transferTerms: TransferTerms; } export enum DateRange { diff --git a/src/utils/apis.ts b/src/utils/apis.ts index f6b5ec7..0491f98 100644 --- a/src/utils/apis.ts +++ b/src/utils/apis.ts @@ -8,6 +8,11 @@ const services = { }, }; +const mockServices = { + localNode: { + baseUrl: 'http://localhost:4040/exp', + }, +}; interface Todo { title: string; } @@ -43,7 +48,7 @@ const batchTransfers: Config = { }; const transferDetails: Config = { - service: services.localNode, + service: mockServices.localNode, url: (_: State, { transferId }: { transferId: string }) => `/transfers/${transferId}/details`, }; @@ -197,6 +202,7 @@ const metric: Config = { const endpoints = { dfsps, + mockServices, environmentStatus, monetaryZones, batches, diff --git a/ui-tests/tests/src/page-objects/components/Transfers.js b/ui-tests/tests/src/page-objects/components/Transfers.js index 689e883..f0187cc 100644 --- a/ui-tests/tests/src/page-objects/components/Transfers.js +++ b/ui-tests/tests/src/page-objects/components/Transfers.js @@ -1,248 +1,262 @@ -import { Selector } from "testcafe"; +import { Selector } from 'testcafe'; class Transfers { - constructor () { - this.transfersOverview = Selector('div.el').nth(0).child - this.findaTransferButton = Selector('span.input-button__label') - - //Login Objects - this.usernNameTextBox = Selector('#username') - this.passWordTextBox = Selector('#password') - this.submitButton = Selector('#kc-login') - - //Find a Transfer Popup window Page Objects - this.ftTitle = Selector('div.el-modal__header-title') - this.ftClosesmall = Selector('#close-small') - this.ftPopupCloseButton = Selector('span.input-button__label').nth(3) - - //Basic filter - this.basicfindaTransferTab = Selector('div.el-tabs__tab-items').child(0) - this.transferIDTextBox = Selector('div.input-textfield__value__tokens').child(0) - this.basicTransferTitle = Selector('span.data-label--large').nth(1) - - //Advanced Filter Page Objects - this.advanceFilteringTab = Selector('div.el-tabs__tab-items').child(1) - this.filterTransferLabel = Selector('span').withText('Filter transfers:') - this.approximateTxfrLabel = Selector('span').withText('Approximate time of transfer') - this.institutionLabel = Selector('div').withText('Contains Institution') - this.institutionTextbox = Selector('div.input-textfield__value__tokens').child(0) - this.transferStatusListLabel = Selector('div').withText('Transfer Status') - // this.dateObject = Selector('div.el-tabs__tab__content') - this.dateDropdownMenu = Selector('div.mb-input__content').nth(0).child(0) - this.fromCalenderMenu = Selector('div.mb-input__content').nth(1).child(0) - this.toCalenderMenu = Selector('div.mb-input__content').nth(2).child(0) - this.fromCalenderValue = Selector('input.input-datepicker__value').nth(0) - this.toCalenderValue = Selector('input.input-datepicker__value').nth(1) - // this.customDropdownMenu = this.dateObject.find('div.mb-input__input input-select__value ') - // this.customDropdownMenu = Selector('div').withText('Today').nth(0) - // this.customDropdownMenu = Selector('div.input-select__component mb-input mb-input__borders mb-input__background mb-input__shadow mb-input--large').nth(0) - this.customSelectLabel = Selector('div').withAttribute('label','Custom') - this.todaySelectLabel = Selector('div').withAttribute('label','today') - this.fourtyEightSelectLabel = Selector('div').withAttribute('label','Past 48 Hours') - this.weekSelectLabel = Selector('div').withAttribute('label','1 week') - this.monthSelectLabel = Selector('div').withAttribute('label','1 Month') - // this.transferStatusMenu = Selector('div.mb-input__content').nth(4).child(1) - this.transferStatusMenu = Selector('div.mb-input__inner-icon').nth(3) - this.successSelectLabel = Selector('div').withAttribute('label','Success') - this.pendingSelectLabel = Selector('div').withAttribute('label','Pending') - this.errorSelectLabel = Selector('div').withAttribute('label','Error') - - - - //Find a Transfer results Page objects - this.noresults = Selector('span').withText('No items') - this.closefindTransferPage = Selector('svg.el-icon control-icon__icon').nth(6) - this.ftPopupSubmitButton = Selector('span.input-button__label').withText('Find Transfers') - this.backtoFilteringSubmitButton = Selector('span.input-button__label').withText('Back to filtering') - this.transferIdList = Selector('span.el-datalist__link__content') - - //Find a transfer batch results page objects - this.transferResults = Selector('.el-modal__body .el-scrollbox__content .el-datalist__rows .el-datalist__row') - - //Individual Transfer Details Page objects - this.transferDetailTitle = Selector('div.el-modal__header-title').withText('Transfer Details') - this.basicInfomationTab = Selector('div.el-tabs__tab-items').child(0) - this.technicalDetailsTab = Selector('div.el-tabs__tab-items').child(1) - - //Basic Information Page Objects - Labels - this.transferIDLabel = Selector('div').withText('Transfer ID') - this.transferStateLabel = Selector('div').withText('Transfer State') - this.transferAmountLabel = Selector('div').withText('Amount') - this.transferDateLabel = Selector('div').withText('Date Submitted') - this.transferBatchLabel = Selector('div').withText('Batch') - this.transferCurrencyLabel = Selector('div').withText('Currency') - this.transferSenderLabel = Selector('div').withText('Sender') - this.transferSenderDetailsLabel = Selector('div').withText('Sender Details') - this.transferRecipientLabel = Selector('div').withText('Recipient') - this.transferRecipientDetailsLabel = Selector('div').withText('Recipient Details') - this.transferInstitutionLabel = Selector('div').withText('Institution') - this.transferDirectionLabel = Selector('div').withText('Direction') - - //Basic Information Page Objects - TextBoxes - this.transferID = Selector('div.input-textfield__value__tokens').nth(0).child(0) - this.transferState = Selector('div.input-textfield__value__tokens').nth(1).child(0) - this.transferBatch = Selector('div.input-textfield__value__tokens').nth(2).child(0) - this.transferDateSubmitted = Selector('div.input-textfield__value__tokens').nth(3).child(0) - this.transferAmount = Selector('div.input-textfield__value__tokens').nth(4).child(0) - this.transferCurrency = Selector('div.input-textfield__value__tokens').nth(5).child(0) - this.transferSender = Selector('div.input-textfield__value__tokens').nth(6).child(0) - this.transferSenderDetails = Selector('div.input-textfield__value__tokens').nth(7).child(0) - this.transferRecipient = Selector('div.input-textfield__value__tokens').nth(8).child(0) - this.transferRecipientDetails = Selector('div.input-textfield__value__tokens').nth(9).child(0) - this.transferInstitution = Selector('div.input-textfield__value__tokens').nth(10).child(0) - this.transferDirection = Selector('div.input-textfield__value__tokens').nth(11).child(0) - - this.closeTransferDetailsButton = Selector('span.input-button__label').nth(4) - - //Technical Details Page Objects - Labels - this.techSchemeTransferIDLabel = Selector('div').withText('Scheme Transfer ID') - this.techTransactionIDLabel = Selector('div').withText('Transaction ID') - this.techQuoteID = Selector('div').withText('Scheme Transfer ID') - this.techHomeTransferIDLabel = Selector('div').withText('Home Transfer ID') - this.techtransferStateLabel = Selector('div').withText('Transfer State') - this.techViewMessageDetailsLabel = Selector('div').withText('View Message Details') - this.techPartyInformationLabel = Selector('div').withText('Party Information') - - //Technical Details Textbox Values - this.techSchemeTransferID = Selector('div.input-textfield__value__tokens').nth(0).child(0) - this.techTransactionID = Selector('div.input-textfield__value__tokens').nth(1).child(0) - this.techQuoteID = Selector('div.input-textfield__value__tokens').nth(2).child(0) - this.techHomeTransferID = Selector('div.input-textfield__value__tokens').nth(3).child(0) - this.techTransferState = Selector('div.input-textfield__value__tokens').nth(4).child(0) - - //Technical Details Page Objects - Buttons - this.payerInfoButton = Selector('span.input-button__label').withText('Payer Information') - this.payeeInfoButton = Selector('span.input-button__label').withText('Payee Information') - this.partyLookupResponseButton = Selector('span.input-button__label').withText('Party Lookup Response') - this.quoteRequestButton = Selector('span.input-button__label').withText('Quote Request') - this.quoteResponseButton = Selector('span.input-button__label').withText('Quote Response') - this.transferPrepareButton = Selector('span.input-button__label').withText('Transfer Prepare') - this.transferFulfilButton = Selector('span.input-button__label').withText('Transfer Fulfil') - this.transferviewErrorButton = Selector('span.input-button__label').nth(4) - this.closeViewErrorPopupButton = Selector('span.input-button__label').nth(13) - this.closeErroredTechnicalDetailsButton = Selector('span.input-button__label').nth(12) - - //This page object closes the Transfer Details when technical details is open - this.closeTechnicalDetailsButton = Selector('span.input-button__label').nth(11) - this.closeTechDetailsButtonPopupButton = Selector('span.input-button__label').nth(12) - - //Extension List Objects - this.closePartyExtensionPopupButton = Selector('span.input-button__label').nth(14) - this.partyExtLstTitle = Selector('div.el-modal__header-title').withText('Party Extension List') - this.keyLabelInExtLst = Selector('.el-datalist__header-cell__label').withText('Key') - this.valueLabelInExtLst = Selector('.el-datalist__header-cell__label').withText('Value') - this.keyTextInExtLst = Selector('div.el-datalist__item-cell').nth(-2).child(0) - this.valueTextInExtLst = Selector('div.el-datalist__item-cell').nth(-1).child(0) - - - //This Page object can be used for any Close Button which pops from Party Information or View Message Details - this.closePartyWithExtensionList = Selector('span.input-button__label').nth(13) - - - //Party objects - the Labels are common between Payee and Payer information - this.partyIDTypeLabel = Selector('div').withText('Id Type') - this.partyValueLabel = Selector('div').withText('Id Value') - this.partyDisplayNameLabel = Selector('div').withText('Display Name') - this.partyFirstNameLabel = Selector('div').withText('First Name') - this.partyMiddleNameLabel = Selector('div').withText('Middle Name') - this.partyLastNameLabel = Selector('div').withText('Last Name') - this.partyDOBLabel = Selector('div').withText('Date Of Birth') - this.partyMerchantCodeLabel = Selector('div').withText('Merchant Classification Code') - this.partyFSPIdLabel = Selector('div').withText('FSP Id') - - - //Party Objects Text boxes - use this for both Payye and and Payer information - this.partyIdType = Selector('div.input-textfield__value__tokens').nth(5).child(0) - this.partyIdValue = Selector('div.input-textfield__value__tokens').nth(6).child(0) - this.partyDisplayName = Selector('div.input-textfield__value__tokens').nth(7).child(0) - this.partyFirstName = Selector('div.input-textfield__value__tokens').nth(8).child(0) - this.partyMiddleName = Selector('div.input-textfield__value__tokens').nth(9).child(0) - this.partyLastName = Selector('div.input-textfield__value__tokens').nth(10).child(0) - this.partyDOB = Selector('div.input-textfield__value__tokens').nth(11).child(0) - this.partyMerchantCode = Selector('div.input-textfield__value__tokens').nth(12).child(0) - this.partyFSPId = Selector('div.input-textfield__value__tokens').nth(13).child(0) - this.partyExtensionListButton = Selector('span.input-button__label').withText('View Extension List') - this.partyDisabledExtensionListButton = Selector('button').withAttribute('disabled label','View Extension List') - - //Transfer Prepare Objects - this.tpilpPacket = Selector('span').withText('"ilpPacket"') - this.tpilpPacketValue = Selector('span').withText('"ilpPacket"').nextSibling(0) - this.tpcondition = Selector('span').withText('"condition"') - this.tpconditionValue = Selector('span').withText('"condition"').nextSibling(0) - this.tpexpiration = Selector('span').withText('"expiration"') - this.tpexpirationValue = Selector('span').withText('"expiration"').nextSibling(0) - - //Transfer Fulfil Objects - this.tfcompletedTimestamp = Selector('span').withText('"completedTimestamp"') - this.tftimeStampValue = Selector('span').withText('"completedTimestamp"').nextSibling(0) - this.tftransferState = Selector('span').withText('"transferState"') - this.tftransferStateValue = Selector('span').withText('"transferState"').nextSibling(0) - this.tffulfilment = Selector('span').withText('"fulfilment"') - this.tffulfilmentValue = Selector('span').withText('"fulfilment"').nextSibling(0) - - //Quote Request Objects - this.qrquoteId = Selector('span').withText('"quoteId"') - this.qrquoteIdValue = Selector('span').withText('"quoteId"').nextSibling(0) - this.qrpayerpartyIdType = Selector('span').withText('"partyIdType"') - this.qrpayerpartyIdTypeValue = Selector('span').withText('"partyIdType"').nextSibling(0) - this.qrpayerpartyIdentifier = Selector('span').withText('"partyIdentifier"') - this.qrpayerpartyIdentifierValue = Selector('span').withText('"partyIdentifier"').nextSibling(0) - this.qramountTypeId = Selector('span').withText('"amountType"') - this.qramountTypeValue = Selector('span').withText('"amountType"').nextSibling(0) - this.qrcurrency = Selector('span').withText('"currency"') - this.qrcurrencyValue = Selector('span').withText('"currency"').nextSibling(0) - this.qramount = Selector('span').withText('"amount"').nth(1) - this.qramountValue = Selector('span').withText('"amount"').nth(1).nextSibling(0) - this.qrpayeepartyIdType = Selector('span').withText('"partyIdType"').nth(1) - this.qrpayeepartyIdTypeValue = Selector('span').withText('"partyIdType"').nth(1).nextSibling(0) - this.qrpayeepartyIdentifier = Selector('span').withText('"partyIdentifier"').nth(1) - this.qrpayeepartyIdentifierValue = Selector('span').withText('"partyIdentifier"').nth(1).nextSibling(0) - this.qrpayeefspId = Selector('span').withText('"fspId"').nth(1) - this.qrpayeefspIdValue = Selector('span').withText('"fspId"').nth(1).nextSibling(0) - - //Quote Response Objects - this.expiration = Selector('span').withText('"expiration"') - this.expirationValue = Selector('span').withText('"expiration"').nextSibling(0) - this.ilpPacket = Selector('span').withText('"ilpPacket"') - this.ilpPacketValue = Selector('span').withText('"ilpPacket"').nextSibling(0) - this.condition = Selector('span').withText('"condition"') - this.conditionValue = Selector('span').withText('"condition"').nextSibling(0) - - //Party Lookup Response Objects - this.plrpartyIdType = Selector('span').withText('"partyIdType"') - this.plrpartyIdTypeValue = Selector('span').withText('"partyIdType"').nextSibling(0) - this.plrpartyIdentifier = Selector('span').withText('"partyIdentifier"') - this.plrpartyIdentifierValue = Selector('span').withText('"partyIdentifier"').nextSibling(0) - this.plrfspId = Selector('span').withText('"fspId"') - this.plrfspIdValue = Selector('span').withText('"fspId"').nextSibling(0) - this.plrdateOfBirth = Selector('span').withText('"dateOfBirth"') - this.plrdateOfBirthValue = Selector('span').withText('"dateOfBirth"').nextSibling(0) - this.plrfirstName = Selector('span').withText('"firstName"') - this.plrfirstNameValue = Selector('span').withText('"firstName"').nextSibling(0) - this.plrlastName = Selector('span').withText('"lastName"') - this.plrlastNameValue = Selector('span').withText('"lastName"').nextSibling(0) - - //Transfer Status count - this.successfulCount = Selector('span.el-pill__label').nth(0) - this.pendingCount = Selector('span.el-pill__label').nth(1) - this.failedCount = Selector('span.el-pill__label').nth(2) - this.totalErrorsCount = Selector('span').withText('Total Errors').nextSibling(0) - this.totalTransferStatuses = Selector('span').withText('Total Transfer Statuses') - - //Transfers Overview - this.transfersOverview = Selector('span').withText('Successful Transfers') - this.successfulTransfers = Selector('span').withText('Successful Transfers') - this.averageTransferTime = Selector('span').withText('Average Transfer Time (E2E)') - this.successfulChart = Selector('#apexchartstransferxsuccessxpercxchart') - this.averageTransferTimeChart = Selector('#apexchartstransferxavgxtimexchart') - this.viewAllErrorsButton = Selector('span.input-button__label').withText('View All Errors') - this.idFilterLabel = Selector('div').withText('ID') - this.directionFilterLabel = Selector('div').withText('Direction') - this.typeFilterLabel = Selector('div').withText('Type') - this.valueFilterLabel = Selector('div').withText('Value') - this.errorTypeFilterLabel = Selector('div').withText('Error Type') - this.DateFilterLabel = Selector('div').withText('Date') - }; + constructor() { + this.transfersOverview = Selector('div.el').nth(0).child; + this.findaTransferButton = Selector('span.input-button__label'); + + //Login Objects + this.usernNameTextBox = Selector('#username'); + this.passWordTextBox = Selector('#password'); + this.submitButton = Selector('#kc-login'); + + //Find a Transfer Popup window Page Objects + this.ftTitle = Selector('div.el-modal__header-title'); + this.ftClosesmall = Selector('#close-small'); + this.ftPopupCloseButton = Selector('span.input-button__label').nth(3); + + //Basic filter + this.basicfindaTransferTab = Selector('div.el-tabs__tab-items').child(0); + this.transferIDTextBox = Selector('div.input-textfield__value__tokens').child(0); + this.basicTransferTitle = Selector('span.data-label--large').nth(1); + + //Advanced Filter Page Objects + this.advanceFilteringTab = Selector('div.el-tabs__tab-items').child(1); + this.filterTransferLabel = Selector('span').withText('Filter transfers:'); + this.approximateTxfrLabel = Selector('span').withText('Approximate time of transfer'); + this.institutionLabel = Selector('div').withText('Contains Institution'); + this.institutionTextbox = Selector('div.input-textfield__value__tokens').child(0); + this.transferStatusListLabel = Selector('div').withText('Transfer Status'); + // this.dateObject = Selector('div.el-tabs__tab__content') + this.dateDropdownMenu = Selector('div.mb-input__content').nth(0).child(0); + this.fromCalenderMenu = Selector('div.mb-input__content').nth(1).child(0); + this.toCalenderMenu = Selector('div.mb-input__content').nth(2).child(0); + this.fromCalenderValue = Selector('input.input-datepicker__value').nth(0); + this.toCalenderValue = Selector('input.input-datepicker__value').nth(1); + // this.customDropdownMenu = this.dateObject.find('div.mb-input__input input-select__value ') + // this.customDropdownMenu = Selector('div').withText('Today').nth(0) + // this.customDropdownMenu = Selector('div.input-select__component mb-input mb-input__borders mb-input__background mb-input__shadow mb-input--large').nth(0) + this.customSelectLabel = Selector('div').withAttribute('label', 'Custom'); + this.todaySelectLabel = Selector('div').withAttribute('label', 'today'); + this.fourtyEightSelectLabel = Selector('div').withAttribute('label', 'Past 48 Hours'); + this.weekSelectLabel = Selector('div').withAttribute('label', '1 week'); + this.monthSelectLabel = Selector('div').withAttribute('label', '1 Month'); + // this.transferStatusMenu = Selector('div.mb-input__content').nth(4).child(1) + this.transferStatusMenu = Selector('div.mb-input__inner-icon').nth(3); + this.successSelectLabel = Selector('div').withAttribute('label', 'Success'); + this.pendingSelectLabel = Selector('div').withAttribute('label', 'Pending'); + this.errorSelectLabel = Selector('div').withAttribute('label', 'Error'); + + //Find a Transfer results Page objects + this.noresults = Selector('span').withText('No items'); + this.closefindTransferPage = Selector('svg.el-icon control-icon__icon').nth(6); + this.ftPopupSubmitButton = Selector('span.input-button__label').withText('Find Transfers'); + this.backtoFilteringSubmitButton = Selector('span.input-button__label').withText( + 'Back to filtering' + ); + this.transferIdList = Selector('span.el-datalist__link__content'); + + //Find a transfer batch results page objects + this.transferResults = Selector( + '.el-modal__body .el-scrollbox__content .el-datalist__rows .el-datalist__row' + ); + + //Individual Transfer Details Page objects + this.transferDetailTitle = Selector('div.el-modal__header-title').withText('Transfer Details'); + this.basicInfomationTab = Selector('div.el-tabs__tab-items').child(0); + this.technicalDetailsTab = Selector('div.el-tabs__tab-items').child(1); + + //Basic Information Page Objects - Labels + this.transferIDLabel = Selector('div').withText('Transfer ID'); + this.transferStateLabel = Selector('div').withText('Transfer State'); + this.transferAmountLabel = Selector('div').withText('Amount'); + this.transferDateLabel = Selector('div').withText('Date Submitted'); + this.transferBatchLabel = Selector('div').withText('Batch'); + this.transferCurrencyLabel = Selector('div').withText('Currency'); + this.transferSenderLabel = Selector('div').withText('Sender'); + this.transferSenderDetailsLabel = Selector('div').withText('Sender Details'); + this.transferRecipientLabel = Selector('div').withText('Recipient'); + this.transferRecipientDetailsLabel = Selector('div').withText('Recipient Details'); + this.transferInstitutionLabel = Selector('div').withText('Institution'); + this.transferDirectionLabel = Selector('div').withText('Direction'); + + //Basic Information Page Objects - TextBoxes + this.transferID = Selector('div.input-textfield__value__tokens').nth(0).child(0); + this.transferState = Selector('div.input-textfield__value__tokens').nth(1).child(0); + this.transferBatch = Selector('div.input-textfield__value__tokens').nth(2).child(0); + this.transferDateSubmitted = Selector('div.input-textfield__value__tokens').nth(3).child(0); + this.transferAmount = Selector('div.input-textfield__value__tokens').nth(4).child(0); + this.transferCurrency = Selector('div.input-textfield__value__tokens').nth(5).child(0); + this.transferSender = Selector('div.input-textfield__value__tokens').nth(6).child(0); + this.transferSenderDetails = Selector('div.input-textfield__value__tokens').nth(7).child(0); + this.transferRecipient = Selector('div.input-textfield__value__tokens').nth(8).child(0); + this.transferRecipientDetails = Selector('div.input-textfield__value__tokens').nth(9).child(0); + this.transferInstitution = Selector('div.input-textfield__value__tokens').nth(10).child(0); + this.transferDirection = Selector('div.input-textfield__value__tokens').nth(11).child(0); + + this.closeTransferDetailsButton = Selector('span.input-button__label').nth(4); + + //Technical Details Page Objects - Labels + this.techSchemeTransferIDLabel = Selector('div').withText('Scheme Transfer ID'); + this.techTransactionIDLabel = Selector('div').withText('Transaction ID'); + this.techQuoteID = Selector('div').withText('Scheme Transfer ID'); + this.techHomeTransferIDLabel = Selector('div').withText('Home Transfer ID'); + this.techtransferStateLabel = Selector('div').withText('Transfer State'); + this.techViewMessageDetailsLabel = Selector('div').withText('View Message Details'); + this.techPartyInformationLabel = Selector('div').withText('Party Information'); + + //Technical Details Textbox Values + this.techSchemeTransferID = Selector('div.input-textfield__value__tokens').nth(0).child(0); + this.techTransactionID = Selector('div.input-textfield__value__tokens').nth(1).child(0); + this.techQuoteID = Selector('div.input-textfield__value__tokens').nth(2).child(0); + this.techHomeTransferID = Selector('div.input-textfield__value__tokens').nth(3).child(0); + this.techTransferState = Selector('div.input-textfield__value__tokens').nth(4).child(0); + + //Technical Details Page Objects - Buttons + this.payerInfoButton = Selector('span.input-button__label').withText('Payer Information'); + this.payeeInfoButton = Selector('span.input-button__label').withText('Payee Information'); + this.partyLookupResponseButton = Selector('span.input-button__label').withText( + 'Party Lookup Response' + ); + this.quoteRequestButton = Selector('span.input-button__label').withText('Quote Request'); + this.quoteResponseButton = Selector('span.input-button__label').withText('Quote Response'); + this.transferPrepareButton = Selector('span.input-button__label').withText('Transfer Prepare'); + this.transferFulfilButton = Selector('span.input-button__label').withText('Transfer Fulfil'); + this.transferviewErrorButton = Selector('span.input-button__label').nth(4); + this.closeViewErrorPopupButton = Selector('span.input-button__label').nth(13); + this.closeErroredTechnicalDetailsButton = Selector('span.input-button__label').nth(12); + + //This page object closes the Transfer Details when technical details is open + this.closeTechnicalDetailsButton = Selector('span.input-button__label').nth(11); + this.closeTechDetailsButtonPopupButton = Selector('span.input-button__label').nth(12); + + //Extension List Objects + this.closePartyExtensionPopupButton = Selector('span.input-button__label').nth(14); + this.partyExtLstTitle = Selector('div.el-modal__header-title').withText('Party Extension List'); + this.keyLabelInExtLst = Selector('.el-datalist__header-cell__label').withText('Key'); + this.valueLabelInExtLst = Selector('.el-datalist__header-cell__label').withText('Value'); + this.keyTextInExtLst = Selector('div.el-datalist__item-cell').nth(-2).child(0); + this.valueTextInExtLst = Selector('div.el-datalist__item-cell').nth(-1).child(0); + + //This Page object can be used for any Close Button which pops from Party Information or View Message Details + this.closePartyWithExtensionList = Selector('span.input-button__label').nth(13); + + //Party objects - the Labels are common between Payee and Payer information + this.partyIDTypeLabel = Selector('div').withText('Id Type'); + this.partyValueLabel = Selector('div').withText('Id Value'); + this.partyDisplayNameLabel = Selector('div').withText('Display Name'); + this.partyFirstNameLabel = Selector('div').withText('First Name'); + this.partyMiddleNameLabel = Selector('div').withText('Middle Name'); + this.partyLastNameLabel = Selector('div').withText('Last Name'); + this.partyDOBLabel = Selector('div').withText('Date Of Birth'); + this.partyMerchantCodeLabel = Selector('div').withText('Merchant Classification Code'); + this.partyFSPIdLabel = Selector('div').withText('FSP Id'); + + //Party Objects Text boxes - use this for both Payye and and Payer information + this.partyIdType = Selector('div.input-textfield__value__tokens').nth(5).child(0); + this.partyIdValue = Selector('div.input-textfield__value__tokens').nth(6).child(0); + this.partyDisplayName = Selector('div.input-textfield__value__tokens').nth(7).child(0); + this.partyFirstName = Selector('div.input-textfield__value__tokens').nth(8).child(0); + this.partyMiddleName = Selector('div.input-textfield__value__tokens').nth(9).child(0); + this.partyLastName = Selector('div.input-textfield__value__tokens').nth(10).child(0); + this.partyDOB = Selector('div.input-textfield__value__tokens').nth(11).child(0); + this.partyMerchantCode = Selector('div.input-textfield__value__tokens').nth(12).child(0); + this.partyFSPId = Selector('div.input-textfield__value__tokens').nth(13).child(0); + this.partyExtensionListButton = Selector('span.input-button__label').withText( + 'View Extension List' + ); + this.partyDisabledExtensionListButton = Selector('button').withAttribute( + 'disabled label', + 'View Extension List' + ); + + //Transfer Prepare Objects + this.tpilpPacket = Selector('span').withText('"ilpPacket"'); + this.tpilpPacketValue = Selector('span').withText('"ilpPacket"').nextSibling(0); + this.tpcondition = Selector('span').withText('"condition"'); + this.tpconditionValue = Selector('span').withText('"condition"').nextSibling(0); + this.tpexpiration = Selector('span').withText('"expiration"'); + this.tpexpirationValue = Selector('span').withText('"expiration"').nextSibling(0); + + //Transfer Fulfil Objects + this.tfcompletedTimestamp = Selector('span').withText('"completedTimestamp"'); + this.tftimeStampValue = Selector('span').withText('"completedTimestamp"').nextSibling(0); + this.tftransferState = Selector('span').withText('"transferState"'); + this.tftransferStateValue = Selector('span').withText('"transferState"').nextSibling(0); + this.tffulfilment = Selector('span').withText('"fulfilment"'); + this.tffulfilmentValue = Selector('span').withText('"fulfilment"').nextSibling(0); + + //Quote Request Objects + this.qrquoteId = Selector('span').withText('"quoteId"'); + this.qrquoteIdValue = Selector('span').withText('"quoteId"').nextSibling(0); + this.qrpayerpartyIdType = Selector('span').withText('"partyIdType"'); + this.qrpayerpartyIdTypeValue = Selector('span').withText('"partyIdType"').nextSibling(0); + this.qrpayerpartyIdentifier = Selector('span').withText('"partyIdentifier"'); + this.qrpayerpartyIdentifierValue = Selector('span') + .withText('"partyIdentifier"') + .nextSibling(0); + this.qramountTypeId = Selector('span').withText('"amountType"'); + this.qramountTypeValue = Selector('span').withText('"amountType"').nextSibling(0); + this.qrcurrency = Selector('span').withText('"currency"'); + this.qrcurrencyValue = Selector('span').withText('"currency"').nextSibling(0); + this.qramount = Selector('span').withText('"amount"').nth(1); + this.qramountValue = Selector('span').withText('"amount"').nth(1).nextSibling(0); + this.qrpayeepartyIdType = Selector('span').withText('"partyIdType"').nth(1); + this.qrpayeepartyIdTypeValue = Selector('span').withText('"partyIdType"').nth(1).nextSibling(0); + this.qrpayeepartyIdentifier = Selector('span').withText('"partyIdentifier"').nth(1); + this.qrpayeepartyIdentifierValue = Selector('span') + .withText('"partyIdentifier"') + .nth(1) + .nextSibling(0); + this.qrpayeefspId = Selector('span').withText('"fspId"').nth(1); + this.qrpayeefspIdValue = Selector('span').withText('"fspId"').nth(1).nextSibling(0); + + //Quote Response Objects + this.expiration = Selector('span').withText('"expiration"'); + this.expirationValue = Selector('span').withText('"expiration"').nextSibling(0); + this.ilpPacket = Selector('span').withText('"ilpPacket"'); + this.ilpPacketValue = Selector('span').withText('"ilpPacket"').nextSibling(0); + this.condition = Selector('span').withText('"condition"'); + this.conditionValue = Selector('span').withText('"condition"').nextSibling(0); + + //Party Lookup Response Objects + this.plrpartyIdType = Selector('span').withText('"partyIdType"'); + this.plrpartyIdTypeValue = Selector('span').withText('"partyIdType"').nextSibling(0); + this.plrpartyIdentifier = Selector('span').withText('"partyIdentifier"'); + this.plrpartyIdentifierValue = Selector('span').withText('"partyIdentifier"').nextSibling(0); + this.plrfspId = Selector('span').withText('"fspId"'); + this.plrfspIdValue = Selector('span').withText('"fspId"').nextSibling(0); + this.plrdateOfBirth = Selector('span').withText('"dateOfBirth"'); + this.plrdateOfBirthValue = Selector('span').withText('"dateOfBirth"').nextSibling(0); + this.plrfirstName = Selector('span').withText('"firstName"'); + this.plrfirstNameValue = Selector('span').withText('"firstName"').nextSibling(0); + this.plrlastName = Selector('span').withText('"lastName"'); + this.plrlastNameValue = Selector('span').withText('"lastName"').nextSibling(0); + + //Transfer Status count + this.successfulCount = Selector('span.el-pill__label').nth(0); + this.pendingCount = Selector('span.el-pill__label').nth(1); + this.failedCount = Selector('span.el-pill__label').nth(2); + this.totalErrorsCount = Selector('span').withText('Total Errors').nextSibling(0); + this.totalTransferStatuses = Selector('span').withText('Total Transfer Statuses'); + + //Transfers Overview + this.transfersOverview = Selector('span').withText('Successful Transfers'); + this.successfulTransfers = Selector('span').withText('Successful Transfers'); + this.averageTransferTime = Selector('span').withText('Average Transfer Time (E2E)'); + this.successfulChart = Selector('#apexchartstransferxsuccessxpercxchart'); + this.averageTransferTimeChart = Selector('#apexchartstransferxavgxtimexchart'); + this.viewAllErrorsButton = Selector('span.input-button__label').withText('View All Errors'); + this.idFilterLabel = Selector('div').withText('ID'); + this.directionFilterLabel = Selector('div').withText('Direction'); + this.typeFilterLabel = Selector('div').withText('Type'); + this.valueFilterLabel = Selector('div').withText('Send Value'); + this.currencyFilterLabel = Selector('div').withText('Send Currency'); + this.receiveValueFilterLabel = Selector('div').withText('Receive Value'); + this.receiveCurrencyFilterLabel = Selector('div').withText('Receive Currency'); + this.errorTypeFilterLabel = Selector('div').withText('Error Type'); + this.DateFilterLabel = Selector('div').withText('Date'); + } } -module.exports = Transfers; \ No newline at end of file +module.exports = Transfers; diff --git a/ui-tests/tests/src/page-objects/pages/TransferDashboardPage.ts b/ui-tests/tests/src/page-objects/pages/TransferDashboardPage.ts index 703fd48..a077f0c 100644 --- a/ui-tests/tests/src/page-objects/pages/TransferDashboardPage.ts +++ b/ui-tests/tests/src/page-objects/pages/TransferDashboardPage.ts @@ -1,55 +1,53 @@ -import { Selector } from "testcafe"; - +import { Selector } from 'testcafe'; export type Error = { - id: string, - direction: string, - type: string, - value: string, - errorType: string, - date: string, -} + id: string; + direction: string; + type: string; + value: string; + errorType: string; + date: string; +}; export type ErrorRow = { - transferId: Selector, - direction: Selector, - type: Selector, - value: Selector, - errorType: Selector, - date: Selector, -} + transferId: Selector; + direction: Selector; + type: Selector; + value: Selector; + errorType: Selector; + date: Selector; +}; export type Transfer = { - id: string, - amount: string, - direction: string, - status: string, - batchId: string, - institution: string, - date: string, - senderIdType: string, - senderIdSubValue: string, - senderIdValue: string, - recipientIdType: string, - recipientIdValue: string, - homeTransferId: string -} + id: string; + amount: string; + direction: string; + status: string; + batchId: string; + institution: string; + date: string; + senderIdType: string; + senderIdSubValue: string; + senderIdValue: string; + recipientIdType: string; + recipientIdValue: string; + homeTransferId: string; +}; export type TransferRow = { - transferId: Selector, - amount: Selector, - direction: Selector, - status: Selector, - batchId: Selector, - institution: Selector, - date: Selector, -} + transferId: Selector; + amount: Selector; + direction: Selector; + status: Selector; + batchId: Selector; + institution: Selector; + date: Selector; +}; export const TransferDashboardPage = { - //Transfers Overview transfersOverview: Selector('span').withText('Successful Transfers'), - successfulTransfers: Selector('span').withText('Successful Transfers'), + successfulTransfers: Selector('span').withText('Successful Transfers'), averageTransferTime: Selector('span').withText('Average Transfer Time (E2E)'), successfulChart: Selector('#apexchartstransferxsuccessxpercxchart'), averageTransferTimeChart: Selector('#apexchartstransferxavgxtimexchart'), @@ -57,12 +55,18 @@ export const TransferDashboardPage = { idFilterLabel: Selector('div').withText('ID'), directionFilterLabel: Selector('div').withText('Direction'), typeFilterLabel: Selector('div').withText('Type'), - valueFilterLabel: Selector('div').withText('Value'), + valueFilterLabel: Selector('div').withText('Send Value'), + currencyFilterLabel: Selector('div').withText('Send Currency'), + receiveValueFilterLabel: Selector('div').withText('Receive Value'), + receiveCurrencyFilterLabel: Selector('div').withText('Receive Currency'), errorTypeFilterLabel: Selector('div').withText('Error Type'), DateFilterLabel: Selector('div').withText('Date'), findATransferButton: Selector('.mb-input').withText('Find a Transfer'), - downloadErrorsButton: Selector('div.transfers__errors__section').nth(1).child('button').withAttribute('label','Download Errors'),// Selector('.transfers__errors__download__button'), + downloadErrorsButton: Selector('div.transfers__errors__section') + .nth(1) + .child('button') + .withAttribute('label', 'Download Errors'), // Selector('.transfers__errors__download__button'), // viewAllErrorsButton: Selector('.transfers__errors__button'), @@ -71,15 +75,21 @@ export const TransferDashboardPage = { ftClosesmall: Selector('#close-small'), transferIDTextBox: Selector('div.input-textfield__value__tokens').child(0), - findATransferModal: () => Selector('.el-modal__header-title') - .withText(`Find a Transfer`) - .parent().parent('.el-modal__container'), + findATransferModal: () => + Selector('.el-modal__header-title') + .withText(`Find a Transfer`) + .parent() + .parent('.el-modal__container'), - findATransferModalBasicFindTransferTab: Selector('.el-tabs__tab-items').child(0),//.withText('Basic Find a Transfer'),XPathSelector('//input[@type="checkbox"]').nth(1); - findATransferModalAdvancedFiltering: Selector('.el-tabs__tab-items').child('div').withText('Advanced Filtering'), + findATransferModalBasicFindTransferTab: Selector('.el-tabs__tab-items').child(0), //.withText('Basic Find a Transfer'),XPathSelector('//input[@type="checkbox"]').nth(1); + findATransferModalAdvancedFiltering: Selector('.el-tabs__tab-items') + .child('div') + .withText('Advanced Filtering'), backtoFilteringSubmitButton: Selector('span.input-button__label').withText('Back to filtering'), ftPopupCloseButton: Selector('span.input-button__label').nth(3), - findATransferModalTransferDownloadTransfersButton: Selector('.mb-input').withText('Download Transfers'), + findATransferModalTransferDownloadTransfersButton: Selector('.mb-input').withText( + 'Download Transfers' + ), findATransferModalTransferIdField: Selector('.find-transfer-modal__transfer-id input'), findATransferModalDateField: Selector('.find-transfer-modal__date input'), findATransferModalFromDateField: Selector('.find-transfer-modal__from-date input'), @@ -97,192 +107,210 @@ export const TransferDashboardPage = { //Find a Transfer results Page objects noresults: Selector('span').withText('No items'), - transferDetailsModalBasicInformationTab: Selector('.el-tabs__tab-item').withText('Basic Information'), - transferDetailsModalTechnicalDetailsTab: Selector('.el-tabs__tab-item').withText('Technical Details'), + transferDetailsModalBasicInformationTab: Selector('.el-tabs__tab-item').withText( + 'Basic Information' + ), + transferDetailsModalTechnicalDetailsTab: Selector('.el-tabs__tab-item').withText( + 'Technical Details' + ), homeTransferIdField: Selector('#transfer-details-modal__home-transfer-id'), recipientField: Selector('#transfer-details-basic-modal__recipient'), - transferIdList : Selector('span.el-datalist__link__content'), + transferIdList: Selector('span.el-datalist__link__content'), //Find a transfer batch results page objects - transferResults: Selector('.el-modal__body .el-scrollbox__content .el-datalist__rows .el-datalist__row'), + transferResults: Selector( + '.el-modal__body .el-scrollbox__content .el-datalist__rows .el-datalist__row' + ), //Individual Transfer Details Page objects - transferDetailTitle : Selector('div.el-modal__header-title').withText('Transfer Details'), - basicInfomationTab : Selector('div.el-tabs__tab-items').child(0), - + transferDetailTitle: Selector('div.el-modal__header-title').withText('Transfer Details'), + basicInfomationTab: Selector('div.el-tabs__tab-items').child(0), //Basic Information Page Objects - Labels - transferIDLabel : Selector('div').withText('Transfer ID'), - transferStateLabel : Selector('div').withText('Transfer State'), - transferAmountLabel : Selector('div').withText('Amount'), - transferDateLabel : Selector('div').withText('Date Submitted'), - transferBatchLabel : Selector('div').withText('Batch'), - transferCurrencyLabel : Selector('div').withText('Currency'), - transferSenderLabel : Selector('div').withText('Sender'), - transferSenderDetailsLabel : Selector('div').withText('Sender Details'), - transferRecipientLabel : Selector('div').withText('Recipient'), - transferRecipientDetailsLabel : Selector('div').withText('Recipient Details'), - transferInstitutionLabel : Selector('div').withText('Institution'), - transferDirectionLabel : Selector('div').withText('Direction'), + transferIDLabel: Selector('div').withText('Transfer ID'), + transferStateLabel: Selector('div').withText('Transfer State'), + transferAmountLabel: Selector('div').withText('Amount'), + transferDateLabel: Selector('div').withText('Date Submitted'), + transferBatchLabel: Selector('div').withText('Batch'), + transferCurrencyLabel: Selector('div').withText('Currency'), + transferSenderLabel: Selector('div').withText('Sender'), + transferSenderDetailsLabel: Selector('div').withText('Sender Details'), + transferRecipientLabel: Selector('div').withText('Recipient'), + transferRecipientDetailsLabel: Selector('div').withText('Recipient Details'), + transferInstitutionLabel: Selector('div').withText('Institution'), + transferDirectionLabel: Selector('div').withText('Direction'), //Basic Information Page Objects - TextBoxes - transferID : Selector('div.input-textfield__value__tokens').nth(0).child(0), - transferState : Selector('div.input-textfield__value__tokens').nth(1).child(0), - transferBatch : Selector('div.input-textfield__value__tokens').nth(2).child(0), - transferDateSubmitted : Selector('div.input-textfield__value__tokens').nth(3).child(0), - transferAmount : Selector('div.input-textfield__value__tokens').nth(4).child(0), - transferCurrency : Selector('div.input-textfield__value__tokens').nth(5).child(0), - transferSender : Selector('div.input-textfield__value__tokens').nth(6).child(0), - transferSenderDetails : Selector('div.input-textfield__value__tokens').nth(7).child(0), - transferRecipient : Selector('div.input-textfield__value__tokens').nth(8).child(0), - transferRecipientDetails : Selector('div.input-textfield__value__tokens').nth(9).child(0), - transferInstitution : Selector('div.input-textfield__value__tokens').nth(10).child(0), - transferDirection : Selector('div.input-textfield__value__tokens').nth(11).child(0), + transferID: Selector('div.input-textfield__value__tokens').nth(0).child(0), + transferState: Selector('div.input-textfield__value__tokens').nth(1).child(0), + transferBatch: Selector('div.input-textfield__value__tokens').nth(2).child(0), + transferDateSubmitted: Selector('div.input-textfield__value__tokens').nth(3).child(0), + transferAmount: Selector('div.input-textfield__value__tokens').nth(4).child(0), + transferCurrency: Selector('div.input-textfield__value__tokens').nth(5).child(0), + transferSender: Selector('div.input-textfield__value__tokens').nth(6).child(0), + transferSenderDetails: Selector('div.input-textfield__value__tokens').nth(7).child(0), + transferRecipient: Selector('div.input-textfield__value__tokens').nth(8).child(0), + transferRecipientDetails: Selector('div.input-textfield__value__tokens').nth(9).child(0), + transferInstitution: Selector('div.input-textfield__value__tokens').nth(10).child(0), + transferDirection: Selector('div.input-textfield__value__tokens').nth(11).child(0), // closeTransferDetailsButton : Selector('span.input-button__label').nth(4), - closeTransferDetailsButton : Selector('#transferDetails span.input-button__label').withText('Close'), + closeTransferDetailsButton: Selector('#transferDetails span.input-button__label').withText( + 'Close' + ), //Technical Details Page Objects - Labels - techSchemeTransferIDLabel : Selector('div').withText('Scheme Transfer ID'), - techTransactionIDLabel : Selector('div').withText('Transaction ID'), - techQuoteIDLabel : Selector('div').withText('Scheme Transfer ID'), - techHomeTransferIDLabel : Selector('div').withText('Home Transfer ID'), - techtransferStateLabel : Selector('div').withText('Transfer State'), - techViewMessageDetailsLabel : Selector('div').withText('View Message Details'), - techPartyInformationLabel : Selector('div').withText('Party Information'), + techSchemeTransferIDLabel: Selector('div').withText('Scheme Transfer ID'), + techTransactionIDLabel: Selector('div').withText('Transaction ID'), + techQuoteIDLabel: Selector('div').withText('Scheme Transfer ID'), + techHomeTransferIDLabel: Selector('div').withText('Home Transfer ID'), + techtransferStateLabel: Selector('div').withText('Transfer State'), + techViewMessageDetailsLabel: Selector('div').withText('View Message Details'), + techPartyInformationLabel: Selector('div').withText('Party Information'), //Technical Details Textbox Values - techSchemeTransferID : Selector('div.input-textfield__value__tokens').nth(0).child(0), - techTransactionID : Selector('div.input-textfield__value__tokens').nth(1).child(0), - techQuoteID : Selector('div.input-textfield__value__tokens').nth(2).child(0), - techHomeTransferID : Selector('div.input-textfield__value__tokens').nth(3).child(0), - techTransferState : Selector('div.input-textfield__value__tokens').nth(4).child(0), + techSchemeTransferID: Selector('div.input-textfield__value__tokens').nth(0).child(0), + techTransactionID: Selector('div.input-textfield__value__tokens').nth(1).child(0), + techQuoteID: Selector('div.input-textfield__value__tokens').nth(2).child(0), + techHomeTransferID: Selector('div.input-textfield__value__tokens').nth(3).child(0), + techTransferState: Selector('div.input-textfield__value__tokens').nth(4).child(0), //Technical Details Page Objects - Buttons - payerInfoButton : Selector('span.input-button__label').withText('Payer Information'), - payeeInfoButton : Selector('span.input-button__label').withText('Payee Information'), - partyLookupResponseButton : Selector('span.input-button__label').withText('Party Lookup Response'), - quoteRequestButton : Selector('span.input-button__label').withText('Quote Request'), - quoteResponseButton : Selector('span.input-button__label').withText('Quote Response'), - transferPrepareButton : Selector('span.input-button__label').withText('Transfer Prepare'), - transferFulfilButton : Selector('span.input-button__label').withText('Transfer Fulfil'), - transferviewErrorButton : Selector('span.input-button__label').nth(4), - closeViewErrorPopupButton : Selector('span.input-button__label').nth(13), - closeErroredTechnicalDetailsButton : Selector('span.input-button__label').nth(12), + payerInfoButton: Selector('span.input-button__label').withText('Payer Information'), + payeeInfoButton: Selector('span.input-button__label').withText('Payee Information'), + partyLookupResponseButton: Selector('span.input-button__label').withText('Party Lookup Response'), + quoteRequestButton: Selector('span.input-button__label').withText('Quote Request'), + quoteResponseButton: Selector('span.input-button__label').withText('Quote Response'), + transferPrepareButton: Selector('span.input-button__label').withText('Transfer Prepare'), + transferFulfilButton: Selector('span.input-button__label').withText('Transfer Fulfil'), + transferviewErrorButton: Selector('span.input-button__label').nth(4), + closeViewErrorPopupButton: Selector('span.input-button__label').nth(13), + closeErroredTechnicalDetailsButton: Selector('span.input-button__label').nth(12), //This page object closes the Transfer Details when technical details is open - closeTechnicalDetailsButton : Selector('span.input-button__label').nth(11), + closeTechnicalDetailsButton: Selector('span.input-button__label').nth(11), // closeTechDetailsButtonPopupButton : Selector('span.input-button__label').nth(12), - closeTechDetailsButtonPopupButton : Selector('#transferRequestDetailsModal span.input-button__label').withText('Close'), + closeTechDetailsButtonPopupButton: Selector( + '#transferRequestDetailsModal span.input-button__label' + ).withText('Close'), //Extension List Objects - partyExtensionListButton : Selector('span.input-button__label').withText('View Extension List'), - partyDisabledExtensionListButton : Selector('button').withAttribute('disabled label','View Extension List'), + partyExtensionListButton: Selector('span.input-button__label').withText('View Extension List'), + partyDisabledExtensionListButton: Selector('button').withAttribute( + 'disabled label', + 'View Extension List' + ), // closePartyExtensionPopupButton : Selector('span.input-button__label').nth(14), - closePartyExtensionPopupButton : Selector('span.input-button__label').withText('Close'), - partyExtLstTitle : Selector('div.el-modal__header-title').withText('Party Extension List'), - keyLabelInExtLst : Selector('.el-datalist__header-cell__label').withText('Key'), - valueLabelInExtLst : Selector('.el-datalist__header-cell__label').withText('Value'), - keyTextInExtLst : Selector('div.el-datalist__item-cell').nth(-2).child(0), - valueTextInExtLst : Selector('div.el-datalist__item-cell').nth(-1).child(0), - + closePartyExtensionPopupButton: Selector('span.input-button__label').withText('Close'), + partyExtLstTitle: Selector('div.el-modal__header-title').withText('Party Extension List'), + keyLabelInExtLst: Selector('.el-datalist__header-cell__label').withText('Key'), + valueLabelInExtLst: Selector('.el-datalist__header-cell__label').withText('Value'), + keyTextInExtLst: Selector('div.el-datalist__item-cell').nth(-2).child(0), + valueTextInExtLst: Selector('div.el-datalist__item-cell').nth(-1).child(0), //This Page object can be used for any Close Button which pops from Party Information or View Message Details // closePartyWithExtensionList : Selector('span.input-button__label').nth(13), - closePartyWithExtensionList : Selector('#partydetailsmodal span.input-button__label').withText('Close'), + closePartyWithExtensionList: Selector('#partydetailsmodal span.input-button__label').withText( + 'Close' + ), //Party objects - the Labels are common between Payee and Payer information - partyIDTypeLabel : Selector('div').withText('Id Type'), - partyValueLabel : Selector('div').withText('Id Value'), - partyDisplayNameLabel : Selector('div').withText('Display Name'), - partyFirstNameLabel : Selector('div').withText('First Name'), - partyMiddleNameLabel : Selector('div').withText('Middle Name'), - partyLastNameLabel : Selector('div').withText('Last Name'), - partyDOBLabel : Selector('div').withText('Date Of Birth'), - partyMerchantCodeLabel : Selector('div').withText('Merchant Classification Code'), - partyFSPIdLabel : Selector('div').withText('FSP Id'), - + partyIDTypeLabel: Selector('div').withText('Id Type'), + partyValueLabel: Selector('div').withText('Id Value'), + partyDisplayNameLabel: Selector('div').withText('Display Name'), + partyFirstNameLabel: Selector('div').withText('First Name'), + partyMiddleNameLabel: Selector('div').withText('Middle Name'), + partyLastNameLabel: Selector('div').withText('Last Name'), + partyDOBLabel: Selector('div').withText('Date Of Birth'), + partyMerchantCodeLabel: Selector('div').withText('Merchant Classification Code'), + partyFSPIdLabel: Selector('div').withText('FSP Id'), //Party Objects Text boxes - use this for both Payye and and Payer information - partyIdType : Selector('div.input-textfield__value__tokens').nth(5).child(0), - partyIdValue : Selector('div.input-textfield__value__tokens').nth(6).child(0), - partyDisplayName : Selector('div.input-textfield__value__tokens').nth(7).child(0), - partyFirstName : Selector('div.input-textfield__value__tokens').nth(8).child(0), - partyMiddleName : Selector('div.input-textfield__value__tokens').nth(9).child(0), - partyLastName : Selector('div.input-textfield__value__tokens').nth(10).child(0), - partyDOB : Selector('div.input-textfield__value__tokens').nth(11).child(0), - partyMerchantCode : Selector('div.input-textfield__value__tokens').nth(12).child(0), - partyFSPId : Selector('div.input-textfield__value__tokens').nth(13).child(0), + partyIdType: Selector('div.input-textfield__value__tokens').nth(5).child(0), + partyIdValue: Selector('div.input-textfield__value__tokens').nth(6).child(0), + partyDisplayName: Selector('div.input-textfield__value__tokens').nth(7).child(0), + partyFirstName: Selector('div.input-textfield__value__tokens').nth(8).child(0), + partyMiddleName: Selector('div.input-textfield__value__tokens').nth(9).child(0), + partyLastName: Selector('div.input-textfield__value__tokens').nth(10).child(0), + partyDOB: Selector('div.input-textfield__value__tokens').nth(11).child(0), + partyMerchantCode: Selector('div.input-textfield__value__tokens').nth(12).child(0), + partyFSPId: Selector('div.input-textfield__value__tokens').nth(13).child(0), //Transfer Prepare Objects - tpilpPacket : Selector('span').withText('"ilpPacket"'), - tpilpPacketValue : Selector('span').withText('"ilpPacket"').nextSibling(0), - tpcondition : Selector('span').withText('"condition"'), - tpconditionValue : Selector('span').withText('"condition"').nextSibling(0), - tpexpiration : Selector('span').withText('"expiration"'), - tpexpirationValue : Selector('span').withText('"expiration"').nextSibling(0), + tpilpPacket: Selector('span').withText('"ilpPacket"'), + tpilpPacketValue: Selector('span').withText('"ilpPacket"').nextSibling(0), + tpcondition: Selector('span').withText('"condition"'), + tpconditionValue: Selector('span').withText('"condition"').nextSibling(0), + tpexpiration: Selector('span').withText('"expiration"'), + tpexpirationValue: Selector('span').withText('"expiration"').nextSibling(0), //Transfer Fulfil Objects - tfcompletedTimestamp : Selector('span').withText('"completedTimestamp"'), - tftimeStampValue : Selector('span').withText('"completedTimestamp"').nextSibling(0), - tftransferState : Selector('span').withText('"transferState"'), - tftransferStateValue : Selector('span').withText('"transferState"').nextSibling(0), - tffulfilment : Selector('span').withText('"fulfilment"'), - tffulfilmentValue : Selector('span').withText('"fulfilment"').nextSibling(0), + tfcompletedTimestamp: Selector('span').withText('"completedTimestamp"'), + tftimeStampValue: Selector('span').withText('"completedTimestamp"').nextSibling(0), + tftransferState: Selector('span').withText('"transferState"'), + tftransferStateValue: Selector('span').withText('"transferState"').nextSibling(0), + tffulfilment: Selector('span').withText('"fulfilment"'), + tffulfilmentValue: Selector('span').withText('"fulfilment"').nextSibling(0), //Quote Request Objects - qrquoteId : Selector('#transferRequestDetailsModal span').withText('"quoteId"'), - qrquoteIdValue : Selector('span').withText('"quoteId"').nextSibling(0), - qrpayerpartyIdType : Selector('span').withText('"partyIdType"'), - qrpayerpartyIdTypeValue : Selector('span').withText('"partyIdType"').nextSibling(0), - qrpayerpartyIdentifier : Selector('span').withText('"partyIdentifier"'), - qrpayerpartyIdentifierValue : Selector('span').withText('"partyIdentifier"').nextSibling(0), - qramountTypeId : Selector('span').withText('"amountType"'), - qramountTypeValue : Selector('span').withText('"amountType"').nextSibling(0), - qrcurrency : Selector('span').withText('"currency"'), - qrcurrencyValue : Selector('span').withText('"currency"').nextSibling(0), - qramount : Selector('span').withText('"amount"').nth(1), - qramountValue : Selector('span').withText('"amount"').nth(1).nextSibling(0), - qrpayeepartyIdType : Selector('span').withText('"partyIdType"').nth(1), - qrpayeepartyIdTypeValue : Selector('span').withText('"partyIdType"').nth(1).nextSibling(0), - qrpayeepartyIdentifier : Selector('span').withText('"partyIdentifier"').nth(1), - qrpayeepartyIdentifierValue : Selector('span').withText('"partyIdentifier"').nth(1).nextSibling(0), - qrpayeefspId : Selector('span').withText('"fspId"').nth(1), - qrpayeefspIdValue : Selector('span').withText('"fspId"').nth(1).nextSibling(0), + qrquoteId: Selector('#transferRequestDetailsModal span').withText('"quoteId"'), + qrquoteIdValue: Selector('span').withText('"quoteId"').nextSibling(0), + qrpayerpartyIdType: Selector('span').withText('"partyIdType"'), + qrpayerpartyIdTypeValue: Selector('span').withText('"partyIdType"').nextSibling(0), + qrpayerpartyIdentifier: Selector('span').withText('"partyIdentifier"'), + qrpayerpartyIdentifierValue: Selector('span').withText('"partyIdentifier"').nextSibling(0), + qramountTypeId: Selector('span').withText('"amountType"'), + qramountTypeValue: Selector('span').withText('"amountType"').nextSibling(0), + qrcurrency: Selector('span').withText('"currency"'), + qrcurrencyValue: Selector('span').withText('"currency"').nextSibling(0), + qramount: Selector('span').withText('"amount"').nth(1), + qramountValue: Selector('span').withText('"amount"').nth(1).nextSibling(0), + qrpayeepartyIdType: Selector('span').withText('"partyIdType"').nth(1), + qrpayeepartyIdTypeValue: Selector('span').withText('"partyIdType"').nth(1).nextSibling(0), + qrpayeepartyIdentifier: Selector('span').withText('"partyIdentifier"').nth(1), + qrpayeepartyIdentifierValue: Selector('span').withText('"partyIdentifier"').nth(1).nextSibling(0), + qrpayeefspId: Selector('span').withText('"fspId"').nth(1), + qrpayeefspIdValue: Selector('span').withText('"fspId"').nth(1).nextSibling(0), //Quote Response Objects - expiration : Selector('span').withText('"expiration"'), - expirationValue : Selector('span').withText('"expiration"').nextSibling(0), - ilpPacket : Selector('span').withText('"ilpPacket"'), - ilpPacketValue : Selector('span').withText('"ilpPacket"').nextSibling(0), - condition : Selector('span').withText('"condition"'), - conditionValue : Selector('span').withText('"condition"').nextSibling(0), + expiration: Selector('span').withText('"expiration"'), + expirationValue: Selector('span').withText('"expiration"').nextSibling(0), + ilpPacket: Selector('span').withText('"ilpPacket"'), + ilpPacketValue: Selector('span').withText('"ilpPacket"').nextSibling(0), + condition: Selector('span').withText('"condition"'), + conditionValue: Selector('span').withText('"condition"').nextSibling(0), //Party Lookup Response Objects - plrpartyIdType : Selector('span').withText('"partyIdType"'), - plrpartyIdTypeValue : Selector('span').withText('"partyIdType"').nextSibling(0), - plrpartyIdentifier : Selector('span').withText('"partyIdentifier"'), - plrpartyIdentifierValue : Selector('span').withText('"partyIdentifier"').nextSibling(0), - plrfspId : Selector('span').withText('"fspId"'), - plrfspIdValue : Selector('span').withText('"fspId"').nextSibling(0), - plrdateOfBirth : Selector('span').withText('"dateOfBirth"'), - plrdateOfBirthValue : Selector('span').withText('"dateOfBirth"').nextSibling(0), - plrfirstName : Selector('span').withText('"firstName"'), - plrfirstNameValue : Selector('span').withText('"firstName"').nextSibling(0), - plrlastName : Selector('span').withText('"lastName"'), - plrlastNameValue : Selector('span').withText('"lastName"').nextSibling(0), + plrpartyIdType: Selector('span').withText('"partyIdType"'), + plrpartyIdTypeValue: Selector('span').withText('"partyIdType"').nextSibling(0), + plrpartyIdentifier: Selector('span').withText('"partyIdentifier"'), + plrpartyIdentifierValue: Selector('span').withText('"partyIdentifier"').nextSibling(0), + plrfspId: Selector('span').withText('"fspId"'), + plrfspIdValue: Selector('span').withText('"fspId"').nextSibling(0), + plrdateOfBirth: Selector('span').withText('"dateOfBirth"'), + plrdateOfBirthValue: Selector('span').withText('"dateOfBirth"').nextSibling(0), + plrfirstName: Selector('span').withText('"firstName"'), + plrfirstNameValue: Selector('span').withText('"firstName"').nextSibling(0), + plrlastName: Selector('span').withText('"lastName"'), + plrlastNameValue: Selector('span').withText('"lastName"').nextSibling(0), //Transfer Status count - successfulCount : Selector('span.el-pill__label').nth(0), - pendingCount : Selector('span.el-pill__label').nth(1), - failedCount : Selector('span.el-pill__label').nth(2), - totalErrorsCount : Selector('span').withText('Total Errors').nextSibling(0), - totalTransferStatuses : Selector('span').withText('Total Transfer Statuses'), - transferDetailsModalTechnicalDetailsRecipientDetailsField: Selector('#transfer-details-basic-modal__recipient-details'), - transferDetailsModalTechnicalDetailsDirection: Selector('#transfer-details-basic-modal__direction'), + successfulCount: Selector('span.el-pill__label').nth(0), + pendingCount: Selector('span.el-pill__label').nth(1), + failedCount: Selector('span.el-pill__label').nth(2), + totalErrorsCount: Selector('span').withText('Total Errors').nextSibling(0), + totalTransferStatuses: Selector('span').withText('Total Transfer Statuses'), + transferDetailsModalTechnicalDetailsRecipientDetailsField: Selector( + '#transfer-details-basic-modal__recipient-details' + ), + transferDetailsModalTechnicalDetailsDirection: Selector( + '#transfer-details-basic-modal__direction' + ), async getTransferRowById(innerText: string): Promise { - return Selector('.transfers__transfers__list .el-datalist__row').withText(innerText.substring(0, 22)); + return Selector('.transfers__transfers__list .el-datalist__row').withText( + innerText.substring(0, 22) + ); }, async getFirstTransferRow(): Promise { @@ -290,54 +318,50 @@ export const TransferDashboardPage = { }, async getTransferByAmount(innerText: string): Promise { - return Selector('.transfers__transfers__list .el-datalist__item-cell').child("div").withText(innerText); + return Selector('.transfers__transfers__list .el-datalist__item-cell') + .child('div') + .withText(innerText); }, async getFindATransferRows(): Promise { const rows = Selector('.transfers__transfers__list .el-datalist__row'); const length = await rows.count; - return Array - .from({ length }) - .map((_, i) => ({ - row: rows.nth(i), - transferId: rows.nth(i).find('.el-datalist__item-cell').nth(0), - amount: rows.nth(i).find('.el-datalist__item-cell').nth(1), - direction: rows.nth(i).find('.el-datalist__item-cell').nth(2), - status: rows.nth(i).find('.el-datalist__item-cell').nth(3), - batchId: rows.nth(i).find('.el-datalist__item-cell').nth(4), - institution: rows.nth(i).find('.el-datalist__item-cell').nth(5), - date: rows.nth(i).find('.el-datalist__item-cell').nth(6), - })); + return Array.from({ length }).map((_, i) => ({ + row: rows.nth(i), + transferId: rows.nth(i).find('.el-datalist__item-cell').nth(0), + amount: rows.nth(i).find('.el-datalist__item-cell').nth(1), + direction: rows.nth(i).find('.el-datalist__item-cell').nth(2), + status: rows.nth(i).find('.el-datalist__item-cell').nth(3), + batchId: rows.nth(i).find('.el-datalist__item-cell').nth(4), + institution: rows.nth(i).find('.el-datalist__item-cell').nth(5), + date: rows.nth(i).find('.el-datalist__item-cell').nth(6), + })); }, async getErrorRows(): Promise { const rows = Selector('.transfers__errors__list-container .el-datalist__row'); const length = await rows.count; - return Array - .from({ length }) - .map((_, i) => ({ - row: rows.nth(i), - transferId: rows.nth(i).find('.el-datalist__item-cell').nth(0), - direction: rows.nth(i).find('.el-datalist__item-cell').nth(1), - type: rows.nth(i).find('.el-datalist__item-cell').nth(2), - value: rows.nth(i).find('.el-datalist__item-cell').nth(3), - errorType: rows.nth(i).find('.el-datalist__item-cell').nth(4), - date: rows.nth(i).find('.el-datalist__item-cell').nth(5), - })); + return Array.from({ length }).map((_, i) => ({ + row: rows.nth(i), + transferId: rows.nth(i).find('.el-datalist__item-cell').nth(0), + direction: rows.nth(i).find('.el-datalist__item-cell').nth(1), + type: rows.nth(i).find('.el-datalist__item-cell').nth(2), + value: rows.nth(i).find('.el-datalist__item-cell').nth(3), + errorType: rows.nth(i).find('.el-datalist__item-cell').nth(4), + date: rows.nth(i).find('.el-datalist__item-cell').nth(5), + })); }, async getAllErrorModalRows(): Promise { const rows = Selector('.el-modal__body__content .el-datalist__row'); const length = await rows.count; - return Array - .from({ length }) - .map((_, i) => ({ - row: rows.nth(i), - transferId: rows.nth(i).find('.el-datalist__item-cell').nth(0), - direction: rows.nth(i).find('.el-datalist__item-cell').nth(1), - type: rows.nth(i).find('.el-datalist__item-cell').nth(2), - value: rows.nth(i).find('.el-datalist__item-cell').nth(3), - errorType: rows.nth(i).find('.el-datalist__item-cell').nth(4), - date: rows.nth(i).find('.el-datalist__item-cell').nth(5), - })); + return Array.from({ length }).map((_, i) => ({ + row: rows.nth(i), + transferId: rows.nth(i).find('.el-datalist__item-cell').nth(0), + direction: rows.nth(i).find('.el-datalist__item-cell').nth(1), + type: rows.nth(i).find('.el-datalist__item-cell').nth(2), + value: rows.nth(i).find('.el-datalist__item-cell').nth(3), + errorType: rows.nth(i).find('.el-datalist__item-cell').nth(4), + date: rows.nth(i).find('.el-datalist__item-cell').nth(5), + })); }, }; From 39679799c53d7a9bc4b12964e60dea0ffcfbe1b6 Mon Sep 17 00:00:00 2001 From: Mwangilwa Zimba Date: Wed, 4 Sep 2024 10:39:58 +0200 Subject: [PATCH 04/47] IME-2 Updated transfer overview, transfer details, transfer terms, transfer parties user interfaces --- data.json | 508 +++++++++++------- .../components/TransferDetails/index.tsx | 204 +++++++ src/App/Transfers/types.ts | 19 +- 3 files changed, 550 insertions(+), 181 deletions(-) diff --git a/data.json b/data.json index fd30d99..e2080af 100644 --- a/data.json +++ b/data.json @@ -1,22 +1,22 @@ { - "transferId": "string", + "transferId": "1234567890", "transferState": "succeeded", "direction": "INBOUND", "transactionType": "TRANSFER", "confirmationNumber": 0, - "sendAmount": "string", + "sendAmount": "8", "sendCurrency": "AED", "dateSubmitted": "2024-08-28T09:43:39.199Z", "receiveAmount": "7.99", "receiveCurrency": "AED", "conversionSubmitted": "2023-12-25T14:17:09.663+01:00", "senderDetails": { - "idType": "MSISDN", - "idValue": "string" + "idType": "MSISDN", + "idValue": "98765432" }, "recipientDetails": { - "idType": "MSISDN", - "idValue": "string" + "idType": "MSISDN", + "idValue": "12345678" }, "recipientCurrencies": "AED", "recipientInstitution": "dfsp2", @@ -24,189 +24,337 @@ "conversionState": "succeeded", "initiatedTimestamp": "2024-08-28T09:43:39.199Z", "transferTerms": { - "transferId": "string", - "quoteAmount": { - "amount": "string", - "currency": "AED" - }, - "quoteAmountType": "SEND", + "transferId": "1234567890", + "quoteAmount": { + "amount": "8", + "currency": "AED" + }, + "quoteAmountType": "SEND", + "transferAmount": { + "amount": "8", + "currency": "AED" + }, + "payeeReceiveAmount": { + "amount": "7.9", + "currency": "AED" + }, + "payeeDfspFee": { + "amount": "2.0", + "currency": "AED" + }, + "payeeDfspCommision": { + "amount": "0.2", + "currency": "AED" + }, + "expiryDate": "2024-08-28T09:43:39.199Z", + "conversionTerms": { "transferAmount": { - "amount": "string", - "currency": "AED" - }, - "payeeReceiveAmount": { - "amount": "string", - "currency": "AED" - }, - "payeeDfspFee": { - "amount": "string", - "currency": "AED" + "amount": "8", + "currency": "AED" }, - "payeeDfspCommision": { - "amount": "string", - "currency": "AED" - }, - "expiryDate": "2024-08-28T09:43:39.199Z", - "conversionTerms": { - "transferAmount": { - "amount": "string", - "currency": "AED" - }, - "charges": [ - {} - ], - "exchangeRate": "string", - "expiryDate": "2024-08-28T09:43:39.199Z" - } + "charges": [ + {} + ], + "exchangeRate": "1.2", + "expiryDate": "2024-08-28T09:43:39.199Z" + } }, "transferParties": { - "transferId": "string", - "transferState": "ERROR_OCCURRED", - "transferType": "Payment", - "payerParty": { - "type": "CONSUMER", - "idType": "MSISDN", - "idValue": "string", - "idSubValue": "string", - "displayName": "string", - "firstName": "string", - "middleName": "string", - "lastName": "string", - "dateOfBirth": "string", - "merchantClassificationCode": "string", - "fspId": "string", - "extensionList": [ - { - "key": "string", - "value": "string" - } - ] - }, - "payeeParty": { - "type": "CONSUMER", - "idType": "MSISDN", - "idValue": "string", - "idSubValue": "string", - "displayName": "string", - "firstName": "string", - "middleName": "string", - "lastName": "string", - "dateOfBirth": "string", - "merchantClassificationCode": "string", - "fspId": "string", - "extensionList": [ - { - "key": "string", - "value": "string" - } - ] - } + "transferId": "1234567890", + "transferState": "succeeded", + "transferType": "Payment", + "payerParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "98765432", + "idSubValue": "7654", + "displayName": "Naph", + "firstName": "Naphtali", + "middleName": "Kayoka", + "lastName": "Phiri", + "dateOfBirth": "23/02/1999", + "merchantClassificationCode": "01", + "fspId": "Airtel", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + }, + "payeeParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "123456789", + "idSubValue": "1234", + "displayName": "Madara", + "firstName": "Niza", + "middleName": "Madara", + "lastName": "Kayoka", + "dateOfBirth": "10/02/1888", + "merchantClassificationCode": "02", + "fspId": "MTN", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + } }, "technicalDetails": { - "schemeTransferId": "string", - "transactionId": "string", - "quoteId": "string", - "homeTransferId": "string", - "payerParty": { - "type": "CONSUMER", - "idType": "MSISDN", - "idValue": "string", - "idSubValue": "string", - "displayName": "string", - "firstName": "string", - "middleName": "string", - "lastName": "string", - "dateOfBirth": "string", - "merchantClassificationCode": "string", - "fspId": "string", - "extensionList": [ - { - "key": "string", - "value": "string" - } - ] - }, - "payeeParty": { - "type": "CONSUMER", - "idType": "MSISDN", - "idValue": "string", - "idSubValue": "string", - "displayName": "string", - "firstName": "string", - "middleName": "string", - "lastName": "string", - "dateOfBirth": "string", - "merchantClassificationCode": "string", - "fspId": "string", - "extensionList": [ - { - "key": "string", - "value": "string" - } - ] - }, - "transferState": "ERROR_OCCURRED", - "getPartiesRequest": { - "headers": {}, - "body": {} - }, - "getPartiesResponse": { - "headers": {}, - "body": {} - }, - "quoteRequest": { - "headers": {}, - "body": {} - }, - "quoteResponse": { - "headers": {}, - "body": {} - }, - "fxQuoteRequest": { - "headers": {}, - "body": {} - }, - "fxQuoteResponse": { - "conversionId": "string", - "conversionQuoteId": "string", - "initiatingFsp": "PayerFSP", - "counterPartyFsp": "testfxp1", - "amountType": "SEND", - "sourceAmount": {}, - "targetAmount": {}, - "conversionSubmitted": "2023-12-25T14:17:09.663+01:00", - "conversionState": "ERROR_OCCURRED", - "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", - "expiration": "2023-12-25T14:17:09.663+01:00", - "charges": [ - {} + "schemeTransferId": "1234567890", + "transactionId": "1234567890", + "quoteId": "123456", + "homeTransferId": "09876543", + "payerParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "98765432", + "idSubValue": "7654", + "displayName": "Naph", + "firstName": "Naphtali", + "middleName": "Kayoka", + "lastName": "Phiri", + "dateOfBirth": "23/02/1999", + "merchantClassificationCode": "01", + "fspId": "Airtel", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + }, + "payeeParty": { + "type": "CONSUMER", + "idType": "MSISDN", + "idValue": "123456789", + "idSubValue": "1234", + "displayName": "Madara", + "firstName": "Niza", + "middleName": "Madara", + "lastName": "Kayoka", + "dateOfBirth": "10/02/1888", + "merchantClassificationCode": "02", + "fspId": "MTN", + "extensionList": [ + { + "key": "string", + "value": "string" + } + ] + }, + "transferState": "succeeded", + "getPartiesRequest": { + "headers": {}, + "body": {} + }, + "getPartiesResponse": { + "body": { + "party": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": "16135551002", + "fspId": "testingtoolkitdfsp", + "extensionList": { + "extension": [ + { + "key": "ad dolore off", + "value": "nostrud deserunt laborum adipisicing pariatur" + }, + { + "key": "sit", + "value": "Duis" + } + ] + } + }, + "name": "k Clt-Pc_L in'rLMgMLrgPgJJdk}'MPo{{gp", + "merchantClassificationCode": "7", + "personalInfo": { + "complexName": { + "firstName": "Chris", + "lastName": "Lee", + "middleName": "P" + }, + "dateOfBirth": "1922-12-26" + }, + "supportedCurrencies": [ + "TZS" ] + } }, - "fxTransferPrepare": { - "headers": {}, - "body": {} + "headers": { + "content-type": "application/vnd.interoperability.parties+json;version=1.0", + "date": "Tue, 27 Aug 2024 06:44:42 GMT", + "x-forwarded-for": "ut est", + "fspiop-source": "testingtoolkitdfsp", + "fspiop-destination": "dfsp1", + "fspiop-encryption": "consectetur eiusmod proident", + "fspiop-signature": "id commodo adipisicing non aliqua", + "fspiop-uri": "nisi ea veniam in sit", + "fspiop-http-method": "adipisicing cillum Excepteur mollit", + "traceparent": "00-ccdd97ef44f66398e1fc146e438189-0123456789abcdef0-00", + "user-agent": "axios/0.27.2", + "content-length": 476, + "host": "sdk-scheme-adapter:4000", + "connection": "keep-alive" + } + }, + "quoteRequest": { + "headers": { + "content-type": "application/vnd.interoperability.quotes+json;version=1.0", + "date": "Mon, 26 Aug 2024 14:25:14 GMT", + "fspiop-source": "dfsp1", + "fspiop-destination": "testingtoolkitdfsp", + "accept": "application/vnd.interoperability.quotes+json;version=1", + "content-length": 968 }, - "fxTransferFulfilment": { - "transferState": "COMMITTED", - "fulfilment": "kDOgQH81DGGZ7nZaExSCAB9Y2e74Po564CStclCoukI", - "completedTimestamp": "2024-08-27T06:44:46.180Z" + "body": { + "quoteId": "959f979b-5732-4ebc-bdc2-0324e1eb0f3c", + "transactionId": "d9a3baf3-7270-4f11-b4a1-435866278ab9", + "amountType": "SEND", + "amount": { + "currency": "TZS", + "amount": "500" + }, + "expiration": "2024-08-26T14:26:14.797Z", + "payer": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": "16135551001", + "fspId": "dfsp1" + }, + "personalInfo": { + "complexName": { + "firstName": "Henrik", + "middleName": "Johannes", + "lastName": "Karlsson" + }, + "dateOfBirth": "1966-06-16" + }, + "name": "string" + }, + "payee": { + "partyIdInfo": { + "partyIdType": "MSISDN", + "partyIdentifier": "16135551002", + "fspId": "testingtoolkitdfsp", + "extensionList": { + "extension": [ + { + "key": "est sint", + "value": "eiusmod Ut dolore cillum ut" + }, + { + "key": "Lorem dolore", + "value": "ut deserunt enim" + } + ] + } + }, + "personalInfo": { + "complexName": { + "firstName": "Paul", + "middleName": "P", + "lastName": "Williams" + }, + "dateOfBirth": "1956-06-18" + }, + "merchantClassificationCode": "123" + }, + "transactionType": { + "scenario": "TRANSFER", + "initiator": "PAYER", + "initiatorType": "CONSUMER" + }, + "note": "Note sent to Payee." + } + }, + "quoteResponse": { + "headers": { + "content-type": "application/vnd.interoperability.quotes+json;version=1.1", + "date": "Mon, 26 Aug 2024 14:25:14 GMT", + "x-forwarded-for": "veniam voluptate", + "fspiop-source": "testingtoolkitdfsp", + "fspiop-destination": "dfsp1", + "fspiop-encryption": "mollit tempor", + "fspiop-signature": "id dolore", + "fspiop-uri": "dolore dolore consectetur cillum sunt", + "fspiop-http-method": "mollit", + "traceparent": "00-ccddb228d3c584eb0146cf3d3213bc-0123456789abcdef0-00", + "user-agent": "axios/0.27.2", + "content-length": 2014, + "host": "sdk-scheme-adapter:4000", + "connection": "keep-alive" }, - "lastError": { - "httpStatusCode": 0, - "mojaloopError": { - "errorInformation": { - "errorCode": "string", - "errorDescription": "string", - "extensionList": { - "extension": [ - { - "key": "string", - "value": "string" - } - ] - } - } - } + "body": { + "transferAmount": { + "currency": "TZS", + "amount": "500" + }, + "expiration": "2024-08-27T14:25:14.808Z", + "ilpPacket": "AYIEyAAAAAAAAMNQJ2cudGVzdGluZ3Rvb2xraXRkZnNwLm1zaXNkbi4xNjEzNTU1MTAwMoIElGV5SjBjbUZ1YzJGamRHbHZia2xrSWpvaVpEbGhNMkpoWmpNdE56STNNQzAwWmpFeExXSTBZVEV0TkRNMU9EWTJNamM0WVdJNUlpd2ljWFZ2ZEdWSlpDSTZJamsxT1dZNU56bGlMVFUzTXpJdE5HVmlZeTFpWkdNeUxUQXpNalJsTVdWaU1HWXpZeUlzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1UWXhNelUxTlRFd01ESWlMQ0ptYzNCSlpDSTZJblJsYzNScGJtZDBiMjlzYTJsMFpHWnpjQ0lzSW1WNGRHVnVjMmx2Ymt4cGMzUWlPbnNpWlhoMFpXNXphVzl1SWpwYmV5SnJaWGtpT2lKbGMzUWdjMmx1ZENJc0luWmhiSFZsSWpvaVpXbDFjMjF2WkNCVmRDQmtiMnh2Y21VZ1kybHNiSFZ0SUhWMEluMHNleUpyWlhraU9pSk1iM0psYlNCa2IyeHZjbVVpTENKMllXeDFaU0k2SW5WMElHUmxjMlZ5ZFc1MElHVnVhVzBpZlYxOWZTd2ljR1Z5YzI5dVlXeEpibVp2SWpwN0ltTnZiWEJzWlhoT1lXMWxJanA3SW1acGNuTjBUbUZ0WlNJNklsQmhkV3dpTENKdGFXUmtiR1ZPWVcxbElqb2lVQ0lzSW14aGMzUk9ZVzFsSWpvaVYybHNiR2xoYlhNaWZTd2laR0YwWlU5bVFtbHlkR2dpT2lJeE9UVTJMVEEyTFRFNEluMHNJbTFsY21Ob1lXNTBRMnhoYzNOcFptbGpZWFJwYjI1RGIyUmxJam9pTVRJekluMHNJbkJoZVdWeUlqcDdJbkJoY25SNVNXUkpibVp2SWpwN0luQmhjblI1U1dSVWVYQmxJam9pVFZOSlUwUk9JaXdpY0dGeWRIbEpaR1Z1ZEdsbWFXVnlJam9pTVRZeE16VTFOVEV3TURFaUxDSm1jM0JKWkNJNkltUm1jM0F4SW4wc0luQmxjbk52Ym1Gc1NXNW1ieUk2ZXlKamIyMXdiR1Y0VG1GdFpTSTZleUptYVhKemRFNWhiV1VpT2lKSVpXNXlhV3NpTENKdGFXUmtiR1ZPWVcxbElqb2lTbTlvWVc1dVpYTWlMQ0pzWVhOMFRtRnRaU0k2SWt0aGNteHpjMjl1SW4wc0ltUmhkR1ZQWmtKcGNuUm9Jam9pTVRrMk5pMHdOaTB4TmlKOUxDSnVZVzFsSWpvaWMzUnlhVzVuSW4wc0ltRnRiM1Z1ZENJNmV5SmpkWEp5Wlc1amVTSTZJbFJhVXlJc0ltRnRiM1Z1ZENJNklqVXdNQ0o5TENKMGNtRnVjMkZqZEdsdmJsUjVjR1VpT25zaWMyTmxibUZ5YVc4aU9pSlVVa0ZPVTBaRlVpSXNJbWx1YVhScFlYUnZjaUk2SWxCQldVVlNJaXdpYVc1cGRHbGhkRzl5Vkhsd1pTSTZJa05QVGxOVlRVVlNJbjE5AA", + "condition": "soUKcM_2mUybmHgLd8rLLcrfprX0Sf4xMgdZPrHulRk", + "payeeFspFee": { + "currency": "TZS", + "amount": "0.2" + }, + "geoCode": { + "latitude": "+68.1", + "longitude": "180.000" + }, + "payeeReceiveAmount": { + "currency": "TZS", + "amount": "500" + }, + "payeeFspCommission": { + "currency": "TZS", + "amount": "0.3" + } } + }, + "fxQuoteRequest": { + "method": "POST", + "host": "mojaloop-testing-toolkit", + "port": "4040", + "path": "/fxQuotes", + "headers": { + "content-type": "application/vnd.interoperability.fxQuotes+json;version=2.0", + "date": "Tue, 27 Aug 2024 06:44:43 GMT", + "fspiop-source": "dfsp1", + "fspiop-destination": "testfxp1", + "accept": "application/vnd.interoperability.fxQuotes+json;version=2", + "content-length": 331 + }, + "agent": "[REDACTED]", + "body": "{\"conversionRequestId\":\"c74bccab-29e7-471c-95f8-59591169f33f\",\"conversionTerms\":{\"conversionId\":\"08ae7b6d-e909-4957-a145-8d7233e3ba6a\",\"initiatingFsp\":\"dfsp1\",\"counterPartyFsp\":\"testfxp1\",\"amountType\":\"SEND\",\"sourceAmount\":{\"currency\":\"EUR\",\"amount\":\"10\"},\"targetAmount\":{\"currency\":\"TZS\"},\"expiration\":\"2024-08-27T06:45:43.923Z\"}}" + }, + "fxQuoteResponse": { + "conversionId": "1234fdgh67523", + "conversionQuoteId": "124gdhju7564tgdfb", + "initiatingFsp": "PayerFSP", + "counterPartyFsp": "testfxp1", + "amountType": "SEND", + "sourceAmount": {}, + "targetAmount": {}, + "conversionSubmitted": "2023-12-25T14:17:09.663+01:00", + "conversionState": "ERROR_OCCURRED", + "determiningTransferId": "b51ec534-ee48-4575-b6a9-ead2955b8069", + "expiration": "2023-12-25T14:17:09.663+01:00", + "charges": [ + {} + ] + }, + "fxTransferPrepare": { + "headers": {}, + "body": {} + }, + "fxTransferFulfilment": { + "transferState": "COMMITTED", + "fulfilment": "kDOgQH81DGGZ7nZaExSCAB9Y2e74Po564CStclCoukI", + "completedTimestamp": "2024-08-27T06:44:46.180Z" + } } -} \ No newline at end of file + } \ No newline at end of file diff --git a/src/App/Transfers/components/TransferDetails/index.tsx b/src/App/Transfers/components/TransferDetails/index.tsx index 23adf31..796e92f 100644 --- a/src/App/Transfers/components/TransferDetails/index.tsx +++ b/src/App/Transfers/components/TransferDetails/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-curly-newline */ /* eslint-disable jsx-a11y/label-has-associated-control */ import React, { FC, useState } from 'react'; import { connect } from 'react-redux'; @@ -145,6 +146,41 @@ const TransferDetailsView: FC = ({ model }) => { setIsRequestDetailsVisible(!isRequestDetailsVisible); }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxQuoteRequest = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Quote Request'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxQuoteResponse = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Quote Response'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxTransferPrepare = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Transfer Prepare'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxTransferFulfil = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Transfer Fulfil'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showConversionError = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Conversion Error'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + let transferStateInput = ( = ({ model }) => { ); } + let conversionStateInput = ( + + ); + + if (model.technicalDetails.lastError) { + conversionStateInput = ( +
+
+ + showConversionError(model.technicalDetails.lastError)} + buttonText="View Error" + buttonKind="secondary" + /> +
+
+ ); + } + return (
@@ -785,6 +847,28 @@ const TransferDetailsView: FC = ({ model }) => { {transferStateInput} + + + +
+ +
+ + {/* Conversion State */} + + {conversionStateInput} +
@@ -941,6 +1025,126 @@ const TransferDetailsView: FC = ({ model }) => { />
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
diff --git a/src/App/Transfers/types.ts b/src/App/Transfers/types.ts index 791a83c..bb21074 100644 --- a/src/App/Transfers/types.ts +++ b/src/App/Transfers/types.ts @@ -202,7 +202,24 @@ export interface TransferTechnicalDetails { transferPrepare?: TransferTechnicalDetailsApiMessage; transferFulfilment?: TransferTechnicalDetailsApiMessage; lastError?: TransferDetailsError; - fxProviders: string[]; + conversionId: FxQuoteResponse; + conversionState?: FxQuoteResponse; + conversionQuoteId: FxQuoteResponse; + fxQuoteRequest?: TransferTechnicalDetailsApiMessage; + fxQuoteResponse?: FxQuoteResponse; + fxTransferPrepare?: TransferTechnicalDetailsApiMessage; + fxTransferFulfilment?: FxTransferFulfilment; +} + +export interface FxQuoteResponse { + // body: {}; + conversionId: string; + conversionQuoteId: string; + conversionState: string; +} + +export interface FxTransferFulfilment { + body: {}; } export interface TransferTerms { From 2caefa6fa2aedffb7a09b4cdfe3130bf7b0e7023 Mon Sep 17 00:00:00 2001 From: Mwangilwa Zimba Date: Wed, 4 Sep 2024 17:14:44 +0200 Subject: [PATCH 05/47] IME-2 Updated transfer overview, transfer details, transfer terms, transfer parties user interfaces --- .../components/TransferDetails/index.tsx | 12 ++++++--- .../TransfersErrors/TransfersErrorsModal.tsx | 10 +++---- .../components/TransfersErrors/index.tsx | 11 +++----- src/App/Transfers/types.ts | 26 +++++++++++-------- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/App/Transfers/components/TransferDetails/index.tsx b/src/App/Transfers/components/TransferDetails/index.tsx index 796e92f..557cbf0 100644 --- a/src/App/Transfers/components/TransferDetails/index.tsx +++ b/src/App/Transfers/components/TransferDetails/index.tsx @@ -614,14 +614,16 @@ const TransferDetailsView: FC = ({ model }) => {
@@ -634,14 +636,16 @@ const TransferDetailsView: FC = ({ model }) => {
diff --git a/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx b/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx index 60bc8b4..c4a3797 100644 --- a/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx +++ b/src/App/Transfers/components/TransfersErrors/TransfersErrorsModal.tsx @@ -36,22 +36,18 @@ const transfersErrorsColumns = [ { label: 'Send Value', key: 'amount', - func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, }, { label: 'Send Currency', - key: 'amount', - func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, + key: 'currency', }, { label: 'Receive Value', - key: 'amount', - func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, + key: 'receiveAmount', }, { label: 'Receive Currency', - key: 'amount', - func: (amount: string, item: TransferError) => `${item.currency} ${amount}`, + key: 'receiveCurrency', }, { label: 'Error Type', key: 'errorType', func: helpers.toSpacedPascalCase }, { diff --git a/src/App/Transfers/components/TransfersErrors/index.tsx b/src/App/Transfers/components/TransfersErrors/index.tsx index ab11a08..e1c66aa 100644 --- a/src/App/Transfers/components/TransfersErrors/index.tsx +++ b/src/App/Transfers/components/TransfersErrors/index.tsx @@ -3,7 +3,7 @@ import { Button, DataList, ErrorBox, Spinner, Link } from 'components'; import { getCurrencySymbol } from 'utils/currencies'; import { ErrorMessage } from 'App/types'; import xlsx from 'xlsx'; -import { TransferError } from '../../types'; +import { TransferDetails, TransferError } from '../../types'; import * as helpers from '../../helpers'; import TransfersErrorsModal from './TransfersErrorsModal'; @@ -22,23 +22,18 @@ const transfersErrorsColumns = [ { label: 'Send Value', key: 'amount', - func: (sendAmount: string, item: TransferError) => `${sendAmount}`, }, { label: 'Send Currency', - key: 'amount', - func: (sendAmount: string, item: TransferError) => - `${getCurrencySymbol(item.currency)} ${sendAmount}`, + key: 'currency', }, { label: 'Receive Value', key: 'amount', - func: (amount: string, item: TransferError) => `${getCurrencySymbol(item.currency)} ${amount}`, }, { label: 'Receive Currency', - key: 'amount', - func: (amount: string, item: TransferError) => `${getCurrencySymbol(item.currency)} ${amount}`, + key: 'currency', }, { label: 'Error Type', key: 'errorType', func: helpers.toSpacedPascalCase }, { diff --git a/src/App/Transfers/types.ts b/src/App/Transfers/types.ts index bb21074..7c045b5 100644 --- a/src/App/Transfers/types.ts +++ b/src/App/Transfers/types.ts @@ -43,6 +43,8 @@ export interface TransferError { value: string; errorType: ErrorType; committedDate: string; + receiveAmount?: string; + receiveCurrency?: string; } export enum ErrorDirection { @@ -172,17 +174,19 @@ export interface ConversionTerms { amount: string; currency: string; }; - charges?: { - chargeType: string; - sourceAmount?: { - amount: string; - currency: string; - }; - targetAmount?: { - amount: string; - currency: string; - }; - }; + charges?: [ + { + chargeType: string; + sourceAmount?: { + amount: string; + currency: string; + }; + targetAmount?: { + amount: string; + currency: string; + }; + } + ]; exchangeRate: string; expiryDate: string; } From 7b06b67be9934f9eecfde78e71b5384245bfdae0 Mon Sep 17 00:00:00 2001 From: Bupe Date: Fri, 6 Sep 2024 12:56:47 +0200 Subject: [PATCH 06/47] Technial Details Tab Update --- on-premise-deploy/docker-compose/docker-compose.yaml | 2 +- .../Transfers/components/TransferDetails/index.tsx | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/on-premise-deploy/docker-compose/docker-compose.yaml b/on-premise-deploy/docker-compose/docker-compose.yaml index bfa99d6..4831aa3 100644 --- a/on-premise-deploy/docker-compose/docker-compose.yaml +++ b/on-premise-deploy/docker-compose/docker-compose.yaml @@ -15,7 +15,7 @@ services: frontend: build: ../../ environment: - - API_BASE_URL=http://localhost:4010 + - API_BASE_URL=http://localhost:4010/ ports: - "8081:8080" depends_on: diff --git a/src/App/Transfers/components/TransferDetails/index.tsx b/src/App/Transfers/components/TransferDetails/index.tsx index 557cbf0..9ab438c 100644 --- a/src/App/Transfers/components/TransferDetails/index.tsx +++ b/src/App/Transfers/components/TransferDetails/index.tsx @@ -1050,8 +1050,7 @@ const TransferDetailsView: FC = ({ model }) => { noFill={true} label={ - Fx - Quote Request + FX Quote Request } onClick={() => showFxQuoteRequest(model.technicalDetails.fxQuoteRequest)} @@ -1079,8 +1078,7 @@ const TransferDetailsView: FC = ({ model }) => { noFill={true} label={ - Fx - Quote Response + FX Quote Response } onClick={() => showFxQuoteResponse(model.technicalDetails.fxQuoteResponse)} @@ -1108,8 +1106,7 @@ const TransferDetailsView: FC = ({ model }) => { noFill={true} label={ - Fx - Transfer Prepare + FX Transfer Prepare } onClick={() => @@ -1139,8 +1136,7 @@ const TransferDetailsView: FC = ({ model }) => { noFill={true} label={ - Fx - Transfer Fulfil + FX Transfer Fulfil } onClick={() => From c1b4493a90e0bd49ebc2af7a31bcde79216017d9 Mon Sep 17 00:00:00 2001 From: Bupe Date: Mon, 9 Sep 2024 15:17:19 +0200 Subject: [PATCH 07/47] Conversion fields UI update --- .../Transfers/components/TransferDetails/index.tsx | 10 +++++----- src/App/Transfers/types.ts | 13 +++++-------- src/utils/apis.ts | 14 +++++++------- src/utils/config.ts | 2 +- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/App/Transfers/components/TransferDetails/index.tsx b/src/App/Transfers/components/TransferDetails/index.tsx index 9ab438c..66297d0 100644 --- a/src/App/Transfers/components/TransferDetails/index.tsx +++ b/src/App/Transfers/components/TransferDetails/index.tsx @@ -212,7 +212,7 @@ const TransferDetailsView: FC = ({ model }) => { ); @@ -224,7 +224,7 @@ const TransferDetailsView: FC = ({ model }) => { showConversionError(model.technicalDetails.lastError)} buttonText="View Error" buttonKind="secondary" @@ -411,7 +411,7 @@ const TransferDetailsView: FC = ({ model }) => { disabled={true} label="Conversion State" type="text" - value={model.conversionState} + value={model.technicalDetails.conversionState} />
@@ -856,7 +856,7 @@ const TransferDetailsView: FC = ({ model }) => { id="transfer-details-modal__conversion-id" disabled={true} label="Conversion ID" - value={model.technicalDetails.fxQuoteResponse?.conversionId} + value={model.technicalDetails.conversionId} />
@@ -864,7 +864,7 @@ const TransferDetailsView: FC = ({ model }) => { id="transfer-details-modal__home-transfer-id" disabled={true} label="Conversion Quote ID" - value={model.technicalDetails.fxQuoteResponse?.conversionQuoteId} + value={model.technicalDetails.conversionQuoteId} style={{ flex: 1 }} />
diff --git a/src/App/Transfers/types.ts b/src/App/Transfers/types.ts index 7c045b5..84311a4 100644 --- a/src/App/Transfers/types.ts +++ b/src/App/Transfers/types.ts @@ -206,9 +206,9 @@ export interface TransferTechnicalDetails { transferPrepare?: TransferTechnicalDetailsApiMessage; transferFulfilment?: TransferTechnicalDetailsApiMessage; lastError?: TransferDetailsError; - conversionId: FxQuoteResponse; - conversionState?: FxQuoteResponse; - conversionQuoteId: FxQuoteResponse; + conversionId: string; + conversionState?: string; + conversionQuoteId: string; fxQuoteRequest?: TransferTechnicalDetailsApiMessage; fxQuoteResponse?: FxQuoteResponse; fxTransferPrepare?: TransferTechnicalDetailsApiMessage; @@ -216,10 +216,8 @@ export interface TransferTechnicalDetails { } export interface FxQuoteResponse { - // body: {}; - conversionId: string; - conversionQuoteId: string; - conversionState: string; + condition: {}; + conversionTerms: {}; } export interface FxTransferFulfilment { @@ -265,7 +263,6 @@ export interface TransferDetails { sendCurrency: string; conversionSubmitted: string; conversionInstitution: string; - conversionState: string; direction: string; receiveAmount: string; receiveCurrency: string; diff --git a/src/utils/apis.ts b/src/utils/apis.ts index 0491f98..c457e4b 100644 --- a/src/utils/apis.ts +++ b/src/utils/apis.ts @@ -8,11 +8,11 @@ const services = { }, }; -const mockServices = { - localNode: { - baseUrl: 'http://localhost:4040/exp', - }, -}; +// const mockServices = { +// localNode: { +// baseUrl: 'http://localhost:4040/exp', +// }, +// }; interface Todo { title: string; } @@ -48,7 +48,7 @@ const batchTransfers: Config = { }; const transferDetails: Config = { - service: mockServices.localNode, + service: services.localNode, url: (_: State, { transferId }: { transferId: string }) => `/transfers/${transferId}/details`, }; @@ -202,7 +202,7 @@ const metric: Config = { const endpoints = { dfsps, - mockServices, + // mockServices, environmentStatus, monetaryZones, batches, diff --git a/src/utils/config.ts b/src/utils/config.ts index 2b516b9..5f385ec 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -3,7 +3,7 @@ import axios from 'axios'; const getConfig = async () => { const { protocol, host } = window.location; const configURL = `${protocol}//${host}/config`; - let apiBaseUrl = 'http://localhost:4010'; + let apiBaseUrl = 'http://localhost:3000'; let checkSession; let loginUrl; let loginProvider; From 29d0c1d7c47156f71651f213df2bb7ffe2159894 Mon Sep 17 00:00:00 2001 From: Bupe Date: Tue, 10 Sep 2024 15:26:06 +0200 Subject: [PATCH 08/47] UI update and FXP directory migrations --- src/App/App.tsx | 7 +- .../FxpTechnicalDashboard/FxpDashboard.css | 88 +++ .../FxpTechnicalDashboard/FxpDashboard.tsx | 281 +++++++ src/App/FxpTechnicalDashboard/actions.ts | 31 + src/App/FxpTechnicalDashboard/hocs.tsx | 33 + src/App/FxpTechnicalDashboard/index.ts | 10 + src/App/FxpTechnicalDashboard/reducers.ts | 188 +++++ src/App/FxpTechnicalDashboard/reducers.ts.new | 190 +++++ src/App/FxpTechnicalDashboard/sagas.ts | 33 + src/App/FxpTechnicalDashboard/selectors.ts | 48 ++ src/App/FxpTechnicalDashboard/types.ts | 35 + src/App/FxpTechnicalDashboard/types.ts.new | 35 + src/App/FxpTransfers/FxpTransfers.css | 94 +++ src/App/FxpTransfers/FxpTransfers.tsx | 123 +++ src/App/FxpTransfers/_mockData.js | 57 ++ src/App/FxpTransfers/actions.ts | 270 +++++++ .../TransferDetails/ExtensionListModal.tsx | 36 + .../TransferDetails/PartyDetailsModal.tsx | 118 +++ .../TransferDetails/RequestDetailModal.tsx | 29 + .../components/TransferDetails/index.tsx | 703 ++++++++++++++++++ .../components/TransferFinderModal/index.tsx | 387 ++++++++++ .../components/TransfersAvgTime/index.tsx | 82 ++ .../TransfersErrors/TransfersErrorsModal.tsx | 94 +++ .../components/TransfersErrors/index.tsx | 127 ++++ .../components/TransfersErrorsChart/index.tsx | 85 +++ .../components/TransfersStatuses/index.tsx | 70 ++ .../components/TransfersSuccessPerc/index.tsx | 82 ++ src/App/FxpTransfers/helpers.ts | 39 + src/App/FxpTransfers/hocs.tsx | 25 + src/App/FxpTransfers/index.ts | 10 + src/App/FxpTransfers/reducers.ts | 212 ++++++ src/App/FxpTransfers/sagas.ts | 199 +++++ src/App/FxpTransfers/selectors.ts | 127 ++++ src/App/FxpTransfers/types.ts | 466 ++++++++++++ src/App/Layout/SideMenu/SideMenu.css | 66 ++ src/App/Layout/SideMenu/index.tsx | 8 +- src/store/types.ts | 2 + 37 files changed, 4486 insertions(+), 4 deletions(-) create mode 100644 src/App/FxpTechnicalDashboard/FxpDashboard.css create mode 100644 src/App/FxpTechnicalDashboard/FxpDashboard.tsx create mode 100644 src/App/FxpTechnicalDashboard/actions.ts create mode 100644 src/App/FxpTechnicalDashboard/hocs.tsx create mode 100644 src/App/FxpTechnicalDashboard/index.ts create mode 100644 src/App/FxpTechnicalDashboard/reducers.ts create mode 100644 src/App/FxpTechnicalDashboard/reducers.ts.new create mode 100644 src/App/FxpTechnicalDashboard/sagas.ts create mode 100644 src/App/FxpTechnicalDashboard/selectors.ts create mode 100644 src/App/FxpTechnicalDashboard/types.ts create mode 100644 src/App/FxpTechnicalDashboard/types.ts.new create mode 100644 src/App/FxpTransfers/FxpTransfers.css create mode 100644 src/App/FxpTransfers/FxpTransfers.tsx create mode 100644 src/App/FxpTransfers/_mockData.js create mode 100644 src/App/FxpTransfers/actions.ts create mode 100644 src/App/FxpTransfers/components/TransferDetails/ExtensionListModal.tsx create mode 100644 src/App/FxpTransfers/components/TransferDetails/PartyDetailsModal.tsx create mode 100644 src/App/FxpTransfers/components/TransferDetails/RequestDetailModal.tsx create mode 100644 src/App/FxpTransfers/components/TransferDetails/index.tsx create mode 100644 src/App/FxpTransfers/components/TransferFinderModal/index.tsx create mode 100644 src/App/FxpTransfers/components/TransfersAvgTime/index.tsx create mode 100644 src/App/FxpTransfers/components/TransfersErrors/TransfersErrorsModal.tsx create mode 100644 src/App/FxpTransfers/components/TransfersErrors/index.tsx create mode 100644 src/App/FxpTransfers/components/TransfersErrorsChart/index.tsx create mode 100644 src/App/FxpTransfers/components/TransfersStatuses/index.tsx create mode 100644 src/App/FxpTransfers/components/TransfersSuccessPerc/index.tsx create mode 100644 src/App/FxpTransfers/helpers.ts create mode 100644 src/App/FxpTransfers/hocs.tsx create mode 100644 src/App/FxpTransfers/index.ts create mode 100644 src/App/FxpTransfers/reducers.ts create mode 100644 src/App/FxpTransfers/sagas.ts create mode 100644 src/App/FxpTransfers/selectors.ts create mode 100644 src/App/FxpTransfers/types.ts diff --git a/src/App/App.tsx b/src/App/App.tsx index 9d12df1..7d9c206 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -2,13 +2,14 @@ import { Switch, Route, Redirect } from 'react-router-dom'; import React, { FC } from 'react'; import './App.css'; import Layout from './Layout'; -// import Dashboard from './Dashboard'; import TechnicalDashboard from './TechnicalDashboard'; import Transfers from './Transfers'; import SuccessToast from './SuccessToast'; import ErrorModal from './ErrorModal'; import connectors from './connectors'; import { User } from './types'; +import FxpTechnicalDashboard from './FxpTechnicalDashboard'; +import FxpTransfers from './FxpTransfers'; interface AppProps { isSuccessToastVisible: boolean; @@ -47,7 +48,9 @@ const App: FC = ({ */} + + {/* process.env.NODE_ENV === 'development' && */} @@ -72,4 +75,4 @@ const App: FC = ({ ); }; -export default connectors(App); +export default connectors(App); \ No newline at end of file diff --git a/src/App/FxpTechnicalDashboard/FxpDashboard.css b/src/App/FxpTechnicalDashboard/FxpDashboard.css new file mode 100644 index 0000000..f284993 --- /dev/null +++ b/src/App/FxpTechnicalDashboard/FxpDashboard.css @@ -0,0 +1,88 @@ +.fxpdashboard { +} + +.dashboard__today__graph-loader, +.dashboard__flow__graph-loader { + height: 300px; + align-items: center; + justify-content: center; + display: flex; +} +.dashboard__today__graph-container, +.dashboard__flow__graph-container { + background: #fff; + height: 300px; + width: 100%; +} + +.dashboard__today__recap-container, +.dashboard__flow__recap-container { + border: 1px solid #39f; + min-height: 250px; + height: 100%; + min-width: 200px; + align-items: center; + justify-content: center; + display: flex; + flex-direction: column; +} + +.dashboard__flow__section, +.dashboard__today__section { + margin-bottom: 20px; +} + +.dashboard__overview__section { + margin-bottom: 20px; +} +.dashboard__overview__loader { + height: 100px; + width: 100%; + display: flex; + justify-content: center; + flex-direction: row; +} +.dashboard__overview__list { + margin: 10px; +} + +.dashboard__overview__list__status-indicator.el-datalist__header-cell, +.dashboard__overview__list__status-indicator.el-datalist__item-cell { + flex: 0 0 40px; + justify-content: center; +} + +.dashboard__overview-status { + color: #053035; + margin: 5px; +} +.dashboard__overview-status--open { + background: #4fc7e7; +} +.dashboard__overview-status--on-track { + background: #12d670; +} +.dashboard__overview-status--has-errors { + background: #e23a54; +} +.dashboard__overview-status--overdue { + background: #ff9016; +} + +.dashboard__overview-status__indicator { + height: 14px; + width: 14px; + border-radius: 50%; +} + +.dashboard__overview__window { +} +.dashboard__overview__window__batch-details-block { + margin-right: 20px; +} + +.dashboard__overview__window__batch-dates-block { + display: flex; + flex-direction: column; + margin-bottom: 10px; +} diff --git a/src/App/FxpTechnicalDashboard/FxpDashboard.tsx b/src/App/FxpTechnicalDashboard/FxpDashboard.tsx new file mode 100644 index 0000000..6b854ca --- /dev/null +++ b/src/App/FxpTechnicalDashboard/FxpDashboard.tsx @@ -0,0 +1,281 @@ +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { + Heading, + MetricsChart, + Row, + Column, + Select, + Tabs, + Tab, + TabList, + TabPanels, + TabPanel, +} from 'components'; +import { State, Dispatch } from 'store/types'; +import { MetricDataWrapper, XYCoordinate } from 'App/types'; +import { loadTechnicalDashboard } from './hocs'; +import * as selectors from './selectors'; +import * as actions from './actions'; +import { TechnicalDashboardFilters } from './types'; +import './FxpDashboard.css'; + +const stateProps = (state: State) => ({ + filters: selectors.getTechnicalDashboardFilters(state), + partyLookupRateData: selectors.getMetricData( + state, + 'mojaloop_connector_outbound_party_lookup_request_count' + ), + quoteRequestRateData: selectors.getMetricData( + state, + 'mojaloop_connector_outbound_quote_request_count' + ), + prepareRateData: selectors.getMetricData( + state, + 'mojaloop_connector_outbound_transfer_prepare_count' + ), + partyLookupLatencyData: selectors.getMetricData( + state, + 'mojaloop_connector_outbound_party_lookup_latency' + ), + quoteRequestLatencyData: selectors.getMetricData( + state, + 'mojaloop_connector_outbound_quote_request_latency' + ), + transferLatencyData: selectors.getMetricData( + state, + 'mojaloop_connector_outbound_transfer_latency' + ), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onFilterChange: ({ field, value }: { field: string; value: string | number }) => { + dispatch(actions.setTechnicalDashboardFilters({ field, value })); + }, +}); + +type FxpTechnicalDashboardProps = { + partyLookupRateData?: MetricDataWrapper; + quoteRequestRateData?: MetricDataWrapper; + prepareRateData?: MetricDataWrapper; + partyLookupLatencyData?: MetricDataWrapper; + quoteRequestLatencyData?: MetricDataWrapper; + transferLatencyData?: MetricDataWrapper; + filters: TechnicalDashboardFilters; + onFilterChange: ({ field, value }: { field: string; value: string | number }) => void; +}; + +const FxpTechnicalDashboard: FC = ({ + partyLookupRateData, + quoteRequestRateData, + prepareRateData, + partyLookupLatencyData, + quoteRequestLatencyData, + transferLatencyData, + filters, + onFilterChange, +}) => { + const partyLookupData = []; + if (partyLookupRateData) { + partyLookupData.push({ + chartType: 'line', + color: '#4fc7e7', + legendText: 'Requests/sec', + data: partyLookupRateData.data, + }); + } + if (partyLookupLatencyData) { + partyLookupData.push({ + chartType: 'line', + color: '#12d670', + legendText: 'Latency ms', + data: partyLookupLatencyData.data.map((d) => ({ x: d.x, y: d.y * 1000 })), + }); + } + + const quoteRequestData = []; + if (quoteRequestRateData) { + quoteRequestData.push({ + chartType: 'line', + color: '#4fc7e7', + legendText: 'Requests/sec', + data: quoteRequestRateData.data, + }); + } + if (quoteRequestLatencyData) { + quoteRequestData.push({ + chartType: 'line', + color: '#12d670', + legendText: 'Latency ms', + data: quoteRequestLatencyData.data.map((d) => ({ x: d.x, y: d.y * 1000 })), + }); + } + + const transferRequestData = []; + if (prepareRateData) { + transferRequestData.push({ + chartType: 'line', + color: '#4fc7e7', + legendText: 'Requests/sec', + data: prepareRateData.data, + }); + } + if (transferLatencyData) { + transferRequestData.push({ + chartType: 'line', + color: '#12d670', + legendText: 'Latency ms', + data: transferLatencyData.data.map((d) => ({ x: d.x, y: d.y * 1000 })), + }); + } + + return ( +
+ FXP Technical Dashboard + +
Connection Health
+
+ +
+
Connected
+ + +
Select Monitoring Time
+
+ + onFilterChange({ field: 'dates', value })} + /> + + + onFilterChange({ field: 'from', value })} + format="x" + /> + + + onFilterChange({ field: 'to', value })} + format="x" + /> + + + + + onFilterChange({ field: 'direction', value })} + /> + + +
+ + + onFilterChange({ field: 'aliasType', value })} + /> + + + { + onFilterChange({ field: 'payeeAlias', value }); + }} + /> + + + { + onFilterChange({ field: 'aliasSubValue', value }); + }} + /> + + +   + + + {/* + + onFilterChange({ field: 'aliasType', value })} + /> + + + onFilterChange({ field: 'payeeAlias', value })} + /> + + + onFilterChange({ field: 'aliasSubValue', value })} + /> + + */} +
+ onFilterChange({ field: 'institution', value })} + /> + onFilterChange({ field: 'status', value })} + /> + + + +); + +export default connect(stateProps, dispatchProps)(TransferFinderModal); diff --git a/src/App/FxpTransfers/components/TransfersAvgTime/index.tsx b/src/App/FxpTransfers/components/TransfersAvgTime/index.tsx new file mode 100644 index 0000000..3d71999 --- /dev/null +++ b/src/App/FxpTransfers/components/TransfersAvgTime/index.tsx @@ -0,0 +1,82 @@ +import React, { FC } from 'react'; +import { ChartLayout, ErrorBox, Spinner } from 'components'; +import { ErrorMessage, XYCoordinate } from 'App/types'; +import Chart from 'react-apexcharts'; + +interface TransfersChartsProps { + isPending: boolean | undefined; + data?: XYCoordinate[]; + error: ErrorMessage; +} + +const TransfersCharts: FC = ({ isPending, data, error }) => { + let content = null; + if (isPending || !data) { + content = ( +
+ +
+ ); + } else if (error) { + content = Transfers average time: Unable to load data; + } else { + content = ( + } + /> + ); + } + return
{content}
; +}; + +interface AverageTransferTimeGraphProps { + data: XYCoordinate[]; +} + +const AverageTransferTimeGraph: FC = ({ data }) => { + const series = { + name: 'Average Response Time', + data, + }; + + const opts = { + chart: { + id: 'transfer-avg-time-chart', + }, + xaxis: { + type: 'datetime', + }, + yaxis: { + labels: { + formatter: (val: string | number) => { + return `${Number(val).toFixed(0)}`; + }, + }, + }, + grid: { + xaxis: { lines: { show: false } }, + yaxis: { lines: { show: true } }, + strokeDashArray: 2, + strokeWidth: 2, + strokeLineCap: 'round', + }, + stroke: { + width: [2], + curve: 'smooth', + }, + colors: ['#4fc7e7'], + tooltip: { + x: { + formatter: (val: string | number) => { + return new Date(val).toISOString(); + }, + }, + }, + }; + + return ; +}; + +export default TransfersCharts; diff --git a/src/App/FxpTransfers/components/TransfersErrors/TransfersErrorsModal.tsx b/src/App/FxpTransfers/components/TransfersErrors/TransfersErrorsModal.tsx new file mode 100644 index 0000000..c4a3797 --- /dev/null +++ b/src/App/FxpTransfers/components/TransfersErrors/TransfersErrorsModal.tsx @@ -0,0 +1,94 @@ +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { DataList, Modal, Spinner, Link } from 'components'; +import * as actions from '../../actions'; +import * as selectors from '../../selectors'; +import { TransferError } from '../../types'; +import * as helpers from '../../helpers'; + +const stateProps = (state: State) => ({ + transfersErrors: selectors.getFilteredByStatusTransfersErrors(state), + transfersErrorsError: selectors.getTransfersErrorsError(state), + isTransfersErrorsViewAllActive: selectors.getIsTransfersErrorsViewAllActive(state), + isTransfersErrorsPending: selectors.getIsTransfersErrorsPending(state), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onModalCloseClick: () => dispatch(actions.toggleTransfersErrorsViewAll()), + onTransferRowClick: (transferError: TransferError) => { + dispatch(actions.requestTransferDetails({ transferId: transferError.id })); + }, +}); + +const transfersErrorsColumns = [ + { + label: 'Transfer ID', + key: 'id', + func: (value: string, item: TransferError) => ( + + {item.id} + + ), + }, + { label: 'Direction', key: 'direction', func: helpers.toSpacedPascalCase }, + { label: 'Type', key: 'type', className: 'col-100' }, + { + label: 'Send Value', + key: 'amount', + }, + { + label: 'Send Currency', + key: 'currency', + }, + { + label: 'Receive Value', + key: 'receiveAmount', + }, + { + label: 'Receive Currency', + key: 'receiveCurrency', + }, + { label: 'Error Type', key: 'errorType', func: helpers.toSpacedPascalCase }, + { + label: 'Date', + key: 'initiatedTimestamp', + func: helpers.toTransfersDate, + }, +]; + +interface TransfersErrorsModalProps { + transfersErrors: TransferError[]; + transfersErrorsError: string | null; + isTransfersErrorsViewAllActive: boolean; + isTransfersErrorsPending?: boolean; + onModalCloseClick: () => void; + onTransferRowClick: (transferError: TransferError) => void; +} + +const TransfersErrorsModal: FC = ({ + transfersErrors, + transfersErrorsError, + isTransfersErrorsViewAllActive, + isTransfersErrorsPending, + onModalCloseClick, + onTransferRowClick, +}) => ( + + {isTransfersErrorsPending ? ( +
+ +
+ ) : ( +
+ +
+ )} +
+); + +export default connect(stateProps, dispatchProps)(TransfersErrorsModal); diff --git a/src/App/FxpTransfers/components/TransfersErrors/index.tsx b/src/App/FxpTransfers/components/TransfersErrors/index.tsx new file mode 100644 index 0000000..e1c66aa --- /dev/null +++ b/src/App/FxpTransfers/components/TransfersErrors/index.tsx @@ -0,0 +1,127 @@ +import React, { FC } from 'react'; +import { Button, DataList, ErrorBox, Spinner, Link } from 'components'; +import { getCurrencySymbol } from 'utils/currencies'; +import { ErrorMessage } from 'App/types'; +import xlsx from 'xlsx'; +import { TransferDetails, TransferError } from '../../types'; +import * as helpers from '../../helpers'; +import TransfersErrorsModal from './TransfersErrorsModal'; + +const transfersErrorsColumns = [ + { + label: 'Transfer ID', + key: 'id', + func: (value: string, item: TransferError) => ( + + {item.id} + + ), + }, + { label: 'Direction', key: 'direction', func: helpers.toSpacedPascalCase }, + { label: 'Type', key: 'type' }, + { + label: 'Send Value', + key: 'amount', + }, + { + label: 'Send Currency', + key: 'currency', + }, + { + label: 'Receive Value', + key: 'amount', + }, + { + label: 'Receive Currency', + key: 'currency', + }, + { label: 'Error Type', key: 'errorType', func: helpers.toSpacedPascalCase }, + { + label: 'Date', + key: 'initiatedTimestamp', + func: helpers.toTransfersDate, + }, +]; + +interface TransfersErrorsProps { + isPending: boolean | undefined; + items: TransferError[]; + isViewAllActive: boolean; + error: ErrorMessage; + onViewAllClick: () => void; + onTransferRowClick: (transferError: TransferError) => void; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +async function downloadErrorsToExcel(errors: any): Promise { + const ws = xlsx.utils.json_to_sheet(errors); + const wscols = [{ wch: 20 }]; + ws['!cols'] = wscols; + const wb = xlsx.utils.book_new(); + xlsx.utils.book_append_sheet(wb, ws, 'Errors'); + const fileName: string = `Payment_Manager_Errors_${new Date().toDateString()}.xlsx`; + xlsx.writeFile(wb, fileName); +} + +const TransfersErrors: FC = ({ + isPending, + items, + error, + onViewAllClick, + isViewAllActive, + onTransferRowClick, +}) => { + let content = null; + if (isPending) { + content = ( +
+ +
+ ); + } else if (error) { + content = Transfers errors: Unable to load data; + } else { + content = ( + <> + + {items.length > 0 && ( +
@@ -471,16 +471,16 @@ const TransferDetailsView: FC = ({ model }) => {
From e30b4ae517b5128a7f3633dba936e27a7f6e5b52 Mon Sep 17 00:00:00 2001 From: Bupe Date: Thu, 12 Sep 2024 10:31:52 +0200 Subject: [PATCH 11/47] latest updates --- src/App/App.tsx | 2 +- .../FxpConversions.css} | 2 +- .../FxpConversions.tsx} | 18 +++++++++--------- .../_mockData.js | 0 .../actions.ts | 0 .../components/FxpConversionAvgTime}/index.tsx | 0 .../ExtensionListModal.tsx | 0 .../PartyDetailsModal.tsx | 0 .../RequestDetailModal.tsx | 0 .../components/FxpConversionDetails}/index.tsx | 0 .../TransfersErrorsModal.tsx | 0 .../components/FxpConversionErrors}/index.tsx | 0 .../FxpConversionErrorsChart}/index.tsx | 0 .../FxpConversionFinderModal}/index.tsx | 0 .../FxpConversionStatuses}/index.tsx | 0 .../FxpConversionSuccessPerc}/index.tsx | 0 .../helpers.ts | 0 .../{FxpTransfers => FxpConversions}/hocs.tsx | 0 .../{FxpTransfers => FxpConversions}/index.ts | 2 +- .../reducers.ts | 0 .../{FxpTransfers => FxpConversions}/sagas.ts | 0 .../selectors.ts | 0 .../{FxpTransfers => FxpConversions}/types.ts | 0 23 files changed, 12 insertions(+), 12 deletions(-) rename src/App/{FxpTransfers/FxpTransfers.css => FxpConversions/FxpConversions.css} (98%) rename src/App/{FxpTransfers/FxpTransfers.tsx => FxpConversions/FxpConversions.tsx} (88%) rename src/App/{FxpTransfers => FxpConversions}/_mockData.js (100%) rename src/App/{FxpTransfers => FxpConversions}/actions.ts (100%) rename src/App/{FxpTransfers/components/TransfersAvgTime => FxpConversions/components/FxpConversionAvgTime}/index.tsx (100%) rename src/App/{FxpTransfers/components/TransferDetails => FxpConversions/components/FxpConversionDetails}/ExtensionListModal.tsx (100%) rename src/App/{FxpTransfers/components/TransferDetails => FxpConversions/components/FxpConversionDetails}/PartyDetailsModal.tsx (100%) rename src/App/{FxpTransfers/components/TransferDetails => FxpConversions/components/FxpConversionDetails}/RequestDetailModal.tsx (100%) rename src/App/{FxpTransfers/components/TransferDetails => FxpConversions/components/FxpConversionDetails}/index.tsx (100%) rename src/App/{FxpTransfers/components/TransfersErrors => FxpConversions/components/FxpConversionErrors}/TransfersErrorsModal.tsx (100%) rename src/App/{FxpTransfers/components/TransfersErrors => FxpConversions/components/FxpConversionErrors}/index.tsx (100%) rename src/App/{FxpTransfers/components/TransfersErrorsChart => FxpConversions/components/FxpConversionErrorsChart}/index.tsx (100%) rename src/App/{FxpTransfers/components/TransferFinderModal => FxpConversions/components/FxpConversionFinderModal}/index.tsx (100%) rename src/App/{FxpTransfers/components/TransfersStatuses => FxpConversions/components/FxpConversionStatuses}/index.tsx (100%) rename src/App/{FxpTransfers/components/TransfersSuccessPerc => FxpConversions/components/FxpConversionSuccessPerc}/index.tsx (100%) rename src/App/{FxpTransfers => FxpConversions}/helpers.ts (100%) rename src/App/{FxpTransfers => FxpConversions}/hocs.tsx (100%) rename src/App/{FxpTransfers => FxpConversions}/index.ts (89%) rename src/App/{FxpTransfers => FxpConversions}/reducers.ts (100%) rename src/App/{FxpTransfers => FxpConversions}/sagas.ts (100%) rename src/App/{FxpTransfers => FxpConversions}/selectors.ts (100%) rename src/App/{FxpTransfers => FxpConversions}/types.ts (100%) diff --git a/src/App/App.tsx b/src/App/App.tsx index d879a16..03445f6 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -9,7 +9,7 @@ import ErrorModal from './ErrorModal'; import connectors from './connectors'; import { User } from './types'; import FxpTechnicalDashboard from './FxpTechnicalDashboard'; -import FxpTransfers from './FxpTransfers'; +import FxpTransfers from './FxpConversions'; interface AppProps { isSuccessToastVisible: boolean; diff --git a/src/App/FxpTransfers/FxpTransfers.css b/src/App/FxpConversions/FxpConversions.css similarity index 98% rename from src/App/FxpTransfers/FxpTransfers.css rename to src/App/FxpConversions/FxpConversions.css index 242a65f..595cee2 100644 --- a/src/App/FxpTransfers/FxpTransfers.css +++ b/src/App/FxpConversions/FxpConversions.css @@ -1,4 +1,4 @@ -.fxptransfers { +.fxpconversions { } .transfers__errors__loader, diff --git a/src/App/FxpTransfers/FxpTransfers.tsx b/src/App/FxpConversions/FxpConversions.tsx similarity index 88% rename from src/App/FxpTransfers/FxpTransfers.tsx rename to src/App/FxpConversions/FxpConversions.tsx index fe3c1b3..a20a06d 100644 --- a/src/App/FxpTransfers/FxpTransfers.tsx +++ b/src/App/FxpConversions/FxpConversions.tsx @@ -7,14 +7,14 @@ import * as selectors from './selectors'; import * as actions from './actions'; import { TransfersStatus, TransferError } from './types'; import { XYCoordinate } from '../types'; -import TransferFinderModal from './components/TransferFinderModal'; -import TransferDetailsModal from './components/TransferDetails'; -import TransfersErrors from './components/TransfersErrors'; -import TransfersErrorsChart from './components/TransfersErrorsChart'; -import TransfersSuccessPerc from './components/TransfersSuccessPerc'; -import TransfersAvgTime from './components/TransfersAvgTime'; -import TransfersStatuses from './components/TransfersStatuses'; -import './FxpTransfers.css'; +import TransferFinderModal from './components/FxpConversionFinderModal'; +import TransferDetailsModal from './components/FxpConversionDetails'; +import TransfersErrors from './components/FxpConversionErrors'; +import TransfersErrorsChart from './components/FxpConversionErrorsChart'; +import TransfersSuccessPerc from './components/FxpConversionSuccessPerc'; +import TransfersAvgTime from './components/FxpConversionAvgTime'; +import TransfersStatuses from './components/FxpConversionStatuses'; +import './FxpConversions.css'; const stateProps = (state: State) => ({ transfersErrors: selectors.getTransfersErrors(state), @@ -86,7 +86,7 @@ const FxpTransfers: FC = ({ }) => { return (
- FXP Transfers Overview + FXP Conversions Overview -
-
- - - -
- - - - -
- -
- -
-
- {{#each test_cases}} -
- - -
- {{#each requests}} -
-
-
-
- {{#if (ifSkippedRequest status)}} -
- {{else}} - {{#if (ifAllTestsPassedInRequest request)}} -
- {{else}} -
- {{/if}} - {{/if}} - -
-
-
-
-
-
-
-
-
Request Information
- {{#if (ifSkippedRequest status)}} -
-
-
SKIPPED
-
-
- {{/if}} - Request Method: {{request.method}}
- Request URL: {{request.path}}
-
-
-
-
-
Response Information
- Response Code: {{response.status}} - {{response.statusText}}
- Mean time per request: NA
- Mean size per request: NA
-
-
Test Pass Percentage
-
-
- {{#if (ifSkippedRequest status)}} -
- {{else}} - {{#if (ifAllTestsPassedInRequest request)}} -
- {{else}} -
- {{/if}} - {{/if}} -
{{testPassPercentage request.tests}} %
-
-
-
-
-
-
-
-
- {{#if request.headers}} -
-
-
-
-
-
Request Headers
-
- - - - {{#each request.headers}} - - - - - {{/each}} - -
Header NameHeader Value
{{@key}}{{this}}
-
-
-
-
-
-
- {{/if}} - {{#if request.body}} -
-
-
-
-
-
Request Body
-
-
{{jsonStringify request.body}}
-
- -
-
-
-
-
- {{/if}} - {{#if additionalInfo.curlRequest}} -
-
-
-
-
-
CURL command
-
-
{{additionalInfo.curlRequest}}
-
- -
-
-
-
-
- {{/if}} - {{#if response.headers}} -
-
-
-
-
-
Response Headers
-
-
{{jsonStringify response.headers}}
-
- -
-
-
-
-
- {{/if}} - {{#if response.body}} -
-
-
-
-
-
Response Body
-
-
{{jsonStringify response.body}}
-
- -
-
-
-
-
- {{/if}} - {{#if callback.headers}} -
-
-
-
-
-
Callback Headers
-
- - - - {{#each callback.headers}} - - - - - {{/each}} - -
Header NameHeader Value
{{@key}}{{this}}
-
-
-
-
-
-
- {{/if}} - {{#if callback.body}} -
-
-
-
-
-
Callback Body
-
-
{{jsonStringify callback.body}}
-
- -
-
-
-
-
- {{/if}} - -
-
-
-
Test Information
-
- - - - {{#each request.tests.assertions}} - - - {{#if (isAssertionSkipped resultStatus.status)}} - - {{else if (isAssertionPassed resultStatus.status)}} - - {{else}} - - - {{/if}} - - {{/each}} - - - - - - - -
NameResult
{{description}} - SKIPPED - - PASSED - - FAILED -
({{resultStatus.message}})
Total{{request.tests.passedAssertionsCount}} / {{request.tests.assertions.length}}
-
-
-
-
-
-
-
Test Failure
-
- - - - -
Test NameAssertion Error
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{/each}} -
- -
- {{/each}} -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/newman/pdf_template.html b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/newman/pdf_template.html index 4127799..ec740a4 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/newman/pdf_template.html +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/newman/pdf_template.html @@ -1,785 +1,785 @@ - - {{!-- {{#each items}} - - - {{name}} - - - $ {{price}} - - - {{/each}} - - - - Total: ${{total items}} - - --}} - - - - - - - - - Testing Toolkit Assertions Report - - - - - - - - -
-
-
- -
-
-
-
-


-

Testing Toolkit Report

-
{{runtimeInformation.completedTime}}
-


-
-
-
-
-
- -
-
Total Assertions
-

{{totalAssertions test_cases}}

-
-
-
-
-
-
-
- -
-
Total Passed Tests
-

{{totalPassedAssertions test_cases}}

-
-
-
-
-
-
-
- -
-
Total Failed Tests
-

{{totalFailedAssertions test_cases}}

-
-
-
-
-
-
-
-


-
-
-
-
-
Runtime Information
- Template Name: {{name}}
- {{#if runtimeInformation}} - Total run duration: {{runtimeInformation.runDurationMs}} ms
- Average response time: {{runtimeInformation.avgResponseTime}}
- {{/if}} -
-
-
-
-


-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Summary ItemTotalFailed
Test Cases{{totalTestCases test_cases}}{{failedTestCases test_cases}}
Requests{{totalRequests test_cases}}{{failedRequests test_cases}}
Assertions{{totalAssertions test_cases}}{{totalFailedAssertions test_cases}}
-
-
-
-
-
-
-
-
-
-

















-


-
- - -
- -
-
- {{#each test_cases}} -
- - -
- {{#each requests}} -
-
-
-
- {{#if (ifAllTestsPassedInRequest request)}} -
- {{else}} - -
-
-
-
-
-
-
-
Request Information
- Request Method: {{request.method}}
- Request URL: {{request.path}}
-
-
-
-
-
Response Information
- Response Code: {{response.status}} - {{response.statusText}}
- Mean time per request: NA
- Mean size per request: NA
-
-
Test Pass Percentage
-
-
- {{#if (ifAllTestsPassedInRequest request)}} -
- {{else}} -
- {{/if}} -
{{testPassPercentage request.tests}} %
-
-
-
-
-
-
-
-
- {{#if request.headers}} -
-
-
-
-
-
Request Headers
-
- - - - {{#each request.headers}} - - - - - {{/each}} - -
Header NameHeader Value
{{@key}}{{this}}
-
-
-
-
-
-
- {{/if}} - {{#if request.body}} -
-
-
-
-
-
Request Body
-
-
{{jsonStringify request.body}}
-
-
-
-
-
-
- {{/if}} - {{#if response.headers}} -
-
-
-
-
-
Response Headers
-
-
{{jsonStringify response.headers}}
-
-
-
-
-
-
- {{/if}} - {{#if response.body}} -
-
-
-
-
-
Response Body
-
-
{{jsonStringify response.body}}
-
-
-
-
-
-
- {{/if}} - {{#if callback.headers}} -
-
-
-
-
-
Callback Headers
-
- - - - {{#each callback.headers}} - - - - - {{/each}} - -
Header NameHeader Value
{{@key}}{{this}}
-
-
-
-
-
-
- {{/if}} - {{#if callback.body}} -
-
-
-
-
-
Callback Body
-
-
{{jsonStringify callback.body}}
-
-
-
-
-
-
- {{/if}} - -
-
-
-
Test Information
-
- - - - {{#each request.tests.assertions}} - - - {{#if (isAssertionSkipped resultStatus.status)}} - - {{else if (isAssertionPassed resultStatus.status)}} - - {{else}} - - - {{/if}} - - {{/each}} - - - - - - - -
NameResult
{{description}} - SKIPPED - - PASSED - - FAILED -
({{resultStatus.message}})
Total{{request.tests.passedAssertionsCount}} / {{request.tests.assertions.length}}
-
-
-
-
-
-
-
Test Failure
-
- - - - -
Test NameAssertion Error
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{/each}} -
- -
- {{/each}} -
-
-
-
-
- - - - - - - + + {{!-- {{#each items}} + + + {{name}} + + + $ {{price}} + + + {{/each}} + + + + Total: ${{total items}} + + --}} + + + + + + + + + Testing Toolkit Assertions Report + + + + + + + + +
+
+
+ +
+
+
+
+


+

Testing Toolkit Report

+
{{runtimeInformation.completedTime}}
+


+
+
+
+
+
+ +
+
Total Assertions
+

{{totalAssertions test_cases}}

+
+
+
+
+
+
+
+ +
+
Total Passed Tests
+

{{totalPassedAssertions test_cases}}

+
+
+
+
+
+
+
+ +
+
Total Failed Tests
+

{{totalFailedAssertions test_cases}}

+
+
+
+
+
+
+
+


+
+
+
+
+
Runtime Information
+ Template Name: {{name}}
+ {{#if runtimeInformation}} + Total run duration: {{runtimeInformation.runDurationMs}} ms
+ Average response time: {{runtimeInformation.avgResponseTime}}
+ {{/if}} +
+
+
+
+


+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Summary ItemTotalFailed
Test Cases{{totalTestCases test_cases}}{{failedTestCases test_cases}}
Requests{{totalRequests test_cases}}{{failedRequests test_cases}}
Assertions{{totalAssertions test_cases}}{{totalFailedAssertions test_cases}}
+
+
+
+
+
+
+
+
+
+

















+


+
+ + +
+ +
+
+ {{#each test_cases}} +
+ + +
+ {{#each requests}} +
+
+
+
+ {{#if (ifAllTestsPassedInRequest request)}} +
+ {{else}} + +
+
+
+
+
+
+
+
Request Information
+ Request Method: {{request.method}}
+ Request URL: {{request.path}}
+
+
+
+
+
Response Information
+ Response Code: {{response.status}} - {{response.statusText}}
+ Mean time per request: NA
+ Mean size per request: NA
+
+
Test Pass Percentage
+
+
+ {{#if (ifAllTestsPassedInRequest request)}} +
+ {{else}} +
+ {{/if}} +
{{testPassPercentage request.tests}} %
+
+
+
+
+
+
+
+
+ {{#if request.headers}} +
+
+
+
+
+
Request Headers
+
+ + + + {{#each request.headers}} + + + + + {{/each}} + +
Header NameHeader Value
{{@key}}{{this}}
+
+
+
+
+
+
+ {{/if}} + {{#if request.body}} +
+
+
+
+
+
Request Body
+
+
{{jsonStringify request.body}}
+
+
+
+
+
+
+ {{/if}} + {{#if response.headers}} +
+
+
+
+
+
Response Headers
+
+
{{jsonStringify response.headers}}
+
+
+
+
+
+
+ {{/if}} + {{#if response.body}} +
+
+
+
+
+
Response Body
+
+
{{jsonStringify response.body}}
+
+
+
+
+
+
+ {{/if}} + {{#if callback.headers}} +
+
+
+
+
+
Callback Headers
+
+ + + + {{#each callback.headers}} + + + + + {{/each}} + +
Header NameHeader Value
{{@key}}{{this}}
+
+
+
+
+
+
+ {{/if}} + {{#if callback.body}} +
+
+
+
+
+
Callback Body
+
+
{{jsonStringify callback.body}}
+
+
+
+
+
+
+ {{/if}} + +
+
+
+
Test Information
+
+ + + + {{#each request.tests.assertions}} + + + {{#if (isAssertionSkipped resultStatus.status)}} + + {{else if (isAssertionPassed resultStatus.status)}} + + {{else}} + + + {{/if}} + + {{/each}} + + + + + + + +
NameResult
{{description}} + SKIPPED + + PASSED + + FAILED +
({{resultStatus.message}})
Total{{request.tests.passedAssertionsCount}} / {{request.tests.assertions.length}}
+
+
+
+
+
+
+
Test Failure
+
+ + + + +
Test NameAssertion Error
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{/each}} +
+ +
+ {{/each}} +
+
+
+
+
+ + + + + + + diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/testcase_definition/table_view.html b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/testcase_definition/table_view.html index 27d2606..c644180 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/testcase_definition/table_view.html +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/reports/templates/testcase_definition/table_view.html @@ -1,81 +1,81 @@ - - - - - - - - - - - - - - - - - - {{#each test_cases}} - - - - {{#each requests}} - - - - - - - {{/each}} - {{/each}} - -
TestcaseRequest DescriptionTest ScenarioExpected Result
Folder Name > File Name
{{name}}
{{#if @first}}{{../meta.info}}{{/if}} {{meta.info}}{{description}}
({{method}} {{operationPath}})
- {{#if tests.assertions}} -
    - {{#each tests.assertions}} -
  • {{description}}
  • - {{/each}} -
- {{/if}} -
- - - + + + + + + + + + + + + + + + + + + {{#each test_cases}} + + + + {{#each requests}} + + + + + + + {{/each}} + {{/each}} + +
TestcaseRequest DescriptionTest ScenarioExpected Result
Folder Name > File Name
{{name}}
{{#if @first}}{{../meta.info}}{{/if}} {{meta.info}}{{description}}
({{method}} {{operationPath}})
+ {{#if tests.assertions}} +
    + {{#each tests.assertions}} +
  • {{description}}
  • + {{/each}} +
+ {{/if}} +
+ + + diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/config.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/config.json index 599ca8f..2d6fe49 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/config.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/config.json @@ -1,3 +1,3 @@ -{ - "activeRulesFile": "default.json" +{ + "activeRulesFile": "default.json" } \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/default.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/default.json index 15aa49f..ce5bd73 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/default.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/default.json @@ -1,769 +1,769 @@ -[ - { - "ruleId": 20, - "priority": 1, - "description": "get /parties/{Type}/{ID} for pinkbank", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "pinkbankfsp", - "path": "FSPIOP-Source" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/parties/{Type}/{ID}", - "params": { - "headers": { - "Content-Type": "application/vnd.interoperability.parties+json;version=1.0", - "FSPIOP-Source": "greenbankfsp" - }, - "body": { - "party": { - "partyIdInfo": { - "fspId": "greenbankfsp" - }, - "merchantClassificationCode": null, - "name": "Justin Pierre", - "personalInfo": { - "complexName": { - "firstName": "Justin", - "middleName": "Pierre", - "lastName": "Trudeau" - }, - "dateOfBirth": "1971-12-25" - } - } - }, - "scripts": { - "scriptingEngine": "postman" - } - }, - "type": "MOCK_CALLBACK" - }, - "type": "callback", - "version": 1 - }, - { - "ruleId": 1, - "priority": 1, - "description": "get /parties/{Type}/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/parties/{Type}/{ID}", - "params": { - "headers": { - "Content-Type": "application/vnd.interoperability.parties+json;version=1.0" - }, - "body": { - "party": { - "partyIdInfo": { - "partySubIdOrType": null - } - } - }, - "scripts": {} - }, - "type": "MOCK_CALLBACK" - }, - "type": "callback", - "version": 1 - }, - { - "type": "callback", - "version": 1, - "ruleId": 2, - "priority": 1, - "description": "post /quotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/quotes/{ID}", - "params": { - "body": { - "transferAmount": { - "currency": "{$request.body.amount.currency}", - "amount": "{$environment.quoteTransferAmount}" - }, - "payeeReceiveAmount": { - "currency": "{$request.body.amount.currency}", - "amount": "{$environment.quotePayeeReceiveAmount}" - }, - "payeeFspFee": { - "currency": "{$request.body.amount.currency}", - "amount": "{$environment.quotePayeeFspFee}" - }, - "payeeFspCommission": { - "currency": "{$request.body.amount.currency}", - "amount": "{$environment.quotePayeeFspCommission}" - }, - "expiration": "{$environment.quoteExpiration}" - }, - "scripts": { - "exec": [ - "const quoteBody = JSON.parse(request.body)", - "environment.quoteTransferAmount = quoteBody.amount.amount", - "environment.quotePayeeFspFee = 0.2", - "environment.quotePayeeFspCommission = 0.3", - "environment.quotePayeeReceiveAmount = quoteBody.amount.amount", - "if (quoteBody.amountType === 'RECEIVE') {", - " environment.quoteTransferAmount = (+quoteBody.amount.amount) + environment.quotePayeeFspFee + environment.quotePayeeFspCommission", - "}", - "environment.quoteExpiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" - ], - "scriptingEngine": "javascript" - } - }, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 3, - "priority": 1, - "description": "post /transfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/transfers/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 4, - "priority": 1, - "description": "post /transactionRequests", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/transactionRequests" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/transactionRequests/{ID}", - "params": { - "body": { - "transactionRequestState": "RECEIVED" - } - }, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 5, - "priority": 1, - "description": "get /quotes/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/quotes/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 6, - "priority": 1, - "description": "get /participants/{Type}/{ID}/{SubId}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/participants/{Type}/{ID}/{SubId}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/participants/{Type}/{ID}/{SubId}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 7, - "priority": 1, - "description": "post /participants/{Type}/{ID}/{SubId}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/participants/{Type}/{ID}/{SubId}" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/participants/{Type}/{ID}/{SubId}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 8, - "priority": 1, - "description": "get /participants/{Type}/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/participants/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/participants/{Type}/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 9, - "priority": 1, - "description": "post /participants/{Type}/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/participants/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/participants/{Type}/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 10, - "priority": 1, - "description": "post /participants", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/participants" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/participants/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 11, - "priority": 1, - "description": "get /parties/{Type}/{ID}/{SubId}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}/{SubId}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/parties/{Type}/{ID}/{SubId}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 12, - "priority": 1, - "description": "get /transactionRequests/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/transactionRequests/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/transactionRequests/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 13, - "priority": 1, - "description": "get /authorizations/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/authorizations/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/authorizations/{ID}", - "params": { - "body": { - "responseType": "ENTERED" - } - }, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 14, - "priority": 1, - "description": "get /transfers/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/transfers/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 15, - "priority": 1, - "description": "get /transactions/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/transactions/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/transactions/{ID}", - "params": { - "body": { - "transactionState": "COMPLETED" - } - }, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 16, - "priority": 1, - "description": "get /bulkQuotes/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/bulkQuotes/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 17, - "priority": 1, - "description": "post /bulkQuotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/bulkQuotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/bulkQuotes/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 18, - "priority": 1, - "description": "get /bulkTransfers/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/bulkTransfers/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "type": "callback", - "version": 1, - "ruleId": 19, - "priority": 1, - "description": "post /bulkTransfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/bulkTransfers" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/bulkTransfers/{ID}", - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - } +[ + { + "ruleId": 20, + "priority": 1, + "description": "get /parties/{Type}/{ID} for pinkbank", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "pinkbankfsp", + "path": "FSPIOP-Source" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}", + "params": { + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=1.0", + "FSPIOP-Source": "greenbankfsp" + }, + "body": { + "party": { + "partyIdInfo": { + "fspId": "greenbankfsp" + }, + "merchantClassificationCode": null, + "name": "Justin Pierre", + "personalInfo": { + "complexName": { + "firstName": "Justin", + "middleName": "Pierre", + "lastName": "Trudeau" + }, + "dateOfBirth": "1971-12-25" + } + } + }, + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "MOCK_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { + "ruleId": 1, + "priority": 1, + "description": "get /parties/{Type}/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}", + "params": { + "headers": { + "Content-Type": "application/vnd.interoperability.parties+json;version=1.0" + }, + "body": { + "party": { + "partyIdInfo": { + "partySubIdOrType": null + } + } + }, + "scripts": {} + }, + "type": "MOCK_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { + "type": "callback", + "version": 1, + "ruleId": 2, + "priority": 1, + "description": "post /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}", + "params": { + "body": { + "transferAmount": { + "currency": "{$request.body.amount.currency}", + "amount": "{$environment.quoteTransferAmount}" + }, + "payeeReceiveAmount": { + "currency": "{$request.body.amount.currency}", + "amount": "{$environment.quotePayeeReceiveAmount}" + }, + "payeeFspFee": { + "currency": "{$request.body.amount.currency}", + "amount": "{$environment.quotePayeeFspFee}" + }, + "payeeFspCommission": { + "currency": "{$request.body.amount.currency}", + "amount": "{$environment.quotePayeeFspCommission}" + }, + "expiration": "{$environment.quoteExpiration}" + }, + "scripts": { + "exec": [ + "const quoteBody = JSON.parse(request.body)", + "environment.quoteTransferAmount = quoteBody.amount.amount", + "environment.quotePayeeFspFee = 0.2", + "environment.quotePayeeFspCommission = 0.3", + "environment.quotePayeeReceiveAmount = quoteBody.amount.amount", + "if (quoteBody.amountType === 'RECEIVE') {", + " environment.quoteTransferAmount = (+quoteBody.amount.amount) + environment.quotePayeeFspFee + environment.quotePayeeFspCommission", + "}", + "environment.quoteExpiration =new Date(new Date().getTime() + 24 * 60 * 60 * 1000).toISOString()" + ], + "scriptingEngine": "javascript" + } + }, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 3, + "priority": 1, + "description": "post /transfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 4, + "priority": 1, + "description": "post /transactionRequests", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transactionRequests" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transactionRequests/{ID}", + "params": { + "body": { + "transactionRequestState": "RECEIVED" + } + }, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 5, + "priority": 1, + "description": "get /quotes/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 6, + "priority": 1, + "description": "get /participants/{Type}/{ID}/{SubId}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/participants/{Type}/{ID}/{SubId}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/participants/{Type}/{ID}/{SubId}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 7, + "priority": 1, + "description": "post /participants/{Type}/{ID}/{SubId}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/participants/{Type}/{ID}/{SubId}" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/participants/{Type}/{ID}/{SubId}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 8, + "priority": 1, + "description": "get /participants/{Type}/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/participants/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/participants/{Type}/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 9, + "priority": 1, + "description": "post /participants/{Type}/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/participants/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/participants/{Type}/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 10, + "priority": 1, + "description": "post /participants", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/participants" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/participants/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 11, + "priority": 1, + "description": "get /parties/{Type}/{ID}/{SubId}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}/{SubId}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}/{SubId}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 12, + "priority": 1, + "description": "get /transactionRequests/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transactionRequests/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/transactionRequests/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 13, + "priority": 1, + "description": "get /authorizations/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/authorizations/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/authorizations/{ID}", + "params": { + "body": { + "responseType": "ENTERED" + } + }, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 14, + "priority": 1, + "description": "get /transfers/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 15, + "priority": 1, + "description": "get /transactions/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/transactions/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/transactions/{ID}", + "params": { + "body": { + "transactionState": "COMPLETED" + } + }, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 16, + "priority": 1, + "description": "get /bulkQuotes/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/bulkQuotes/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 17, + "priority": 1, + "description": "post /bulkQuotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/bulkQuotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/bulkQuotes/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 18, + "priority": 1, + "description": "get /bulkTransfers/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/bulkTransfers/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "type": "callback", + "version": 1, + "ruleId": 19, + "priority": 1, + "description": "post /bulkTransfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/bulkTransfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/bulkTransfers/{ID}", + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + } ] \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/p2p-limit.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/p2p-limit.json index 3200dbc..c395e62 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/p2p-limit.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_callback/p2p-limit.json @@ -1,129 +1,129 @@ -[ - { - "ruleId": 1, - "priority": 1, - "description": "get /parties/{Type}/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": "put", - "path": "/parties/{Type}/{ID}", - "params": { - "scripts": { - "exec": [ - "const ttkAllowedAmount = pm.environment.get('ttkAllowedAmount')", - "if (ttkAllowedAmount === undefined) {", - " pm.environment.set('ttkAllowedAmount', 1000)", - "}" - ] - } - }, - "type": "MOCK_CALLBACK" - }, - "type": "callback", - "version": 1 - }, - { - "type": "callback", - "version": 1, - "ruleId": 2, - "priority": 1, - "description": "post /quotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": {}, - "delay": 0, - "type": "MOCK_CALLBACK" - } - }, - { - "ruleId": 3, - "priority": 1, - "description": "post /transfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "body", - "operator": "equal", - "value": "testingtoolkitdfsp", - "path": "payeeFsp" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/transfers/{ID}", - "params": { - "scripts": { - "exec": [ - "const body = JSON.parse(pm.request.body)", - "var ttkdfspTotalAmount = pm.environment.get('ttkdfspTotalAmount') || 0", - "var ttkAllowedAmount = pm.environment.get('ttkAllowedAmount')", - "ttkdfspTotalAmount += +body.amount.amount", - "ttkAllowedAmount -= +body.amount.amount", - "pm.environment.set('ttkdfspTotalAmount', ttkdfspTotalAmount)", - "pm.environment.set('ttkAllowedAmount', ttkAllowedAmount)" - ] - } - }, - "type": "MOCK_CALLBACK" - }, - "type": "callback", - "version": 1 - } +[ + { + "ruleId": 1, + "priority": 1, + "description": "get /parties/{Type}/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": "put", + "path": "/parties/{Type}/{ID}", + "params": { + "scripts": { + "exec": [ + "const ttkAllowedAmount = pm.environment.get('ttkAllowedAmount')", + "if (ttkAllowedAmount === undefined) {", + " pm.environment.set('ttkAllowedAmount', 1000)", + "}" + ] + } + }, + "type": "MOCK_CALLBACK" + }, + "type": "callback", + "version": 1 + }, + { + "type": "callback", + "version": 1, + "ruleId": 2, + "priority": 1, + "description": "post /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": {}, + "delay": 0, + "type": "MOCK_CALLBACK" + } + }, + { + "ruleId": 3, + "priority": 1, + "description": "post /transfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "testingtoolkitdfsp", + "path": "payeeFsp" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/transfers/{ID}", + "params": { + "scripts": { + "exec": [ + "const body = JSON.parse(pm.request.body)", + "var ttkdfspTotalAmount = pm.environment.get('ttkdfspTotalAmount') || 0", + "var ttkAllowedAmount = pm.environment.get('ttkAllowedAmount')", + "ttkdfspTotalAmount += +body.amount.amount", + "ttkAllowedAmount -= +body.amount.amount", + "pm.environment.set('ttkdfspTotalAmount', ttkdfspTotalAmount)", + "pm.environment.set('ttkAllowedAmount', ttkAllowedAmount)" + ] + } + }, + "type": "MOCK_CALLBACK" + }, + "type": "callback", + "version": 1 + } ] \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/config.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/config.json index 599ca8f..2d6fe49 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/config.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/config.json @@ -1,3 +1,3 @@ -{ - "activeRulesFile": "default.json" +{ + "activeRulesFile": "default.json" } \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/default.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/default.json index a4e3ee0..9765fe5 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/default.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_forward/default.json @@ -1,482 +1,482 @@ -[ - { - "ruleId": 1, - "priority": 1, - "description": "get /parties/{Type}/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp", - "path": "fspiop-source" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "params": { - "to": "payee", - "dfspId": "userdfsp2" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "ruleId": 2, - "priority": 1, - "description": "put /parties/{Type}/{ID} to payer", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "put" - } - ] - }, - "event": { - "params": { - "to": "payer", - "dfspId": "userdfsp" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "ruleId": 3, - "priority": 1, - "description": "post /quotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp2", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "params": { - "to": "payee", - "dfspId": "userdfsp2" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "ruleId": 4, - "priority": 1, - "description": "put /quotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "put" - } - ] - }, - "event": { - "params": { - "to": "payer", - "dfspId": "userdfsp" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "type": "forward", - "version": 1, - "ruleId": 5, - "priority": 1, - "description": "post /transfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "body", - "operator": "equal", - "value": "userdfsp2", - "path": "payeeFsp" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "params": { - "to": "payee", - "dfspId": "userdfsp2" - }, - "type": "FORWARD" - } - }, - { - "type": "forward", - "version": 1, - "ruleId": 6, - "priority": 1, - "description": "put /transfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "put" - } - ] - }, - "event": { - "params": { - "to": "payer", - "dfspId": "userdfsp" - }, - "type": "FORWARD" - } - }, - { - "ruleId": 7, - "priority": 1, - "description": "get /parties/{Type}/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp2", - "path": "fspiop-source" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "params": { - "to": "payer", - "dfspId": "userdfsp" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "ruleId": 8, - "priority": 1, - "description": "put /parties/{Type}/{ID}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp2", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/parties/{Type}/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "put" - } - ] - }, - "event": { - "params": { - "to": "payee", - "dfspId": "userdfsp2" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "ruleId": 9, - "priority": 1, - "description": "post /quotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "params": { - "to": "payer", - "dfspId": "userdfsp" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "ruleId": 10, - "priority": 1, - "description": "put /quotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp2", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "put" - } - ] - }, - "event": { - "params": { - "to": "payee", - "dfspId": "userdfsp2" - }, - "type": "FORWARD" - }, - "type": "forward", - "version": 1 - }, - { - "type": "forward", - "version": 1, - "ruleId": 11, - "priority": 1, - "description": "post /transfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "body", - "operator": "equal", - "value": "userdfsp", - "path": "payeeFsp" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "params": { - "to": "payer", - "dfspId": "userdfsp" - }, - "type": "FORWARD" - } - }, - { - "type": "forward", - "version": 1, - "ruleId": 12, - "priority": 1, - "description": "put /transfers", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "headers", - "operator": "equal", - "value": "userdfsp2", - "path": "fspiop-destination" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/transfers/{ID}" - }, - { - "fact": "method", - "operator": "equal", - "value": "put" - } - ] - }, - "event": { - "params": { - "to": "payee", - "dfspId": "userdfsp2" - }, - "type": "FORWARD" - } - } +[ + { + "ruleId": 1, + "priority": 1, + "description": "get /parties/{Type}/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp", + "path": "fspiop-source" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "params": { + "to": "payee", + "dfspId": "userdfsp2" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "ruleId": 2, + "priority": 1, + "description": "put /parties/{Type}/{ID} to payer", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "put" + } + ] + }, + "event": { + "params": { + "to": "payer", + "dfspId": "userdfsp" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "ruleId": 3, + "priority": 1, + "description": "post /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp2", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "params": { + "to": "payee", + "dfspId": "userdfsp2" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "ruleId": 4, + "priority": 1, + "description": "put /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "put" + } + ] + }, + "event": { + "params": { + "to": "payer", + "dfspId": "userdfsp" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "type": "forward", + "version": 1, + "ruleId": 5, + "priority": 1, + "description": "post /transfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "userdfsp2", + "path": "payeeFsp" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "params": { + "to": "payee", + "dfspId": "userdfsp2" + }, + "type": "FORWARD" + } + }, + { + "type": "forward", + "version": 1, + "ruleId": 6, + "priority": 1, + "description": "put /transfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "put" + } + ] + }, + "event": { + "params": { + "to": "payer", + "dfspId": "userdfsp" + }, + "type": "FORWARD" + } + }, + { + "ruleId": 7, + "priority": 1, + "description": "get /parties/{Type}/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp2", + "path": "fspiop-source" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "params": { + "to": "payer", + "dfspId": "userdfsp" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "ruleId": 8, + "priority": 1, + "description": "put /parties/{Type}/{ID}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp2", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/parties/{Type}/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "put" + } + ] + }, + "event": { + "params": { + "to": "payee", + "dfspId": "userdfsp2" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "ruleId": 9, + "priority": 1, + "description": "post /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "params": { + "to": "payer", + "dfspId": "userdfsp" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "ruleId": 10, + "priority": 1, + "description": "put /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp2", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "put" + } + ] + }, + "event": { + "params": { + "to": "payee", + "dfspId": "userdfsp2" + }, + "type": "FORWARD" + }, + "type": "forward", + "version": 1 + }, + { + "type": "forward", + "version": 1, + "ruleId": 11, + "priority": 1, + "description": "post /transfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "equal", + "value": "userdfsp", + "path": "payeeFsp" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "params": { + "to": "payer", + "dfspId": "userdfsp" + }, + "type": "FORWARD" + } + }, + { + "type": "forward", + "version": 1, + "ruleId": 12, + "priority": 1, + "description": "put /transfers", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "headers", + "operator": "equal", + "value": "userdfsp2", + "path": "fspiop-destination" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/transfers/{ID}" + }, + { + "fact": "method", + "operator": "equal", + "value": "put" + } + ] + }, + "event": { + "params": { + "to": "payee", + "dfspId": "userdfsp2" + }, + "type": "FORWARD" + } + } ] \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/config.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/config.json index 599ca8f..2d6fe49 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/config.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/config.json @@ -1,3 +1,3 @@ -{ - "activeRulesFile": "default.json" +{ + "activeRulesFile": "default.json" } \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/default.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/default.json index b4df83c..2ca458e 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/default.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_response/default.json @@ -1,220 +1,220 @@ -[ - { - "type": "response", - "version": 1.0, - "ruleId": 1, - "priority": 1, - "description": "post /settlementWindows/{id}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "settlements", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/settlementWindows/{id}" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "state": "OPEN" - }, - "statusCode": "200" - }, - "delay": 0, - "type": "MOCK_RESPONSE" - } - }, - { - "type": "response", - "version": 1.0, - "ruleId": 3, - "priority": 1, - "description": "post /settlements", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "settlements", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/settlements" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "id": "123", - "state": "PENDING_SETTLEMENT", - "settlementWindows": [ - [ - { - "id": 123, - "createdDate": "1954-11-03", - "state": "PENDING_SETTLEMENT", - "reason": "do", - "changedDate": "1954-11-03" - } - ] - ], - "participants": [ - { - "id": -91450113, - "accounts": [ - { - "id": 81795155, - "reason": "veniam est proident commodo aliqua", - "state": "PENDING_SETTLEMENT", - "netSettlementAmount": { - "amount": 100, - "currency": "USD" - } - } - ] - } - ] - }, - "statusCode": "200" - }, - "delay": 0, - "type": "FIXED_RESPONSE" - } - }, - { - "type": "response", - "version": 1.0, - "ruleId": 4, - "priority": 1, - "description": "get /settlements/{id}", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "settlements", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/settlements/{id}" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": { - "id": "{$request.params.id}", - "state": "PS_TRANSFERS_RECORDED", - "settlementWindows": [ - [ - { - "createdDate": "2020-02-10", - "id": "{$request.params.id}", - "state": "PS_TRANSFERS_RECORDED", - "reason": "amet cillum culpa v", - "changedDate": "2020-02-10" - } - ] - ], - "participants": [ - { - "id": -35933071, - "accounts": [ - { - "id": -14386227, - "reason": "aliquip aliqua nulla deserunt", - "state": "PS_TRANSFERS_RECORDED", - "netSettlementAmount": { - "amount": 100, - "currency": "USD" - } - } - ] - } - ] - }, - "statusCode": "200" - }, - "delay": 0, - "type": "FIXED_RESPONSE" - } - }, - { - "type": "response", - "version": 1.0, - "ruleId": 5, - "priority": 1, - "description": "get /settlementWindows", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "settlements", - "asynchronous": false - }, - "conditions": { - "all": [ - { - "fact": "operationPath", - "operator": "equal", - "value": "/settlementWindows" - }, - { - "fact": "method", - "operator": "equal", - "value": "get" - } - ] - }, - "event": { - "method": null, - "path": null, - "params": { - "body": [ - { - "createdDate": "2020-02-10", - "id": 123, - "state": "{$request.query.state}", - "reason": "string", - "changedDate": "2020-02-10" - } - ], - "statusCode": "200" - }, - "delay": 0, - "type": "FIXED_RESPONSE" - } - } +[ + { + "type": "response", + "version": 1.0, + "ruleId": 1, + "priority": 1, + "description": "post /settlementWindows/{id}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "settlements", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/settlementWindows/{id}" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "state": "OPEN" + }, + "statusCode": "200" + }, + "delay": 0, + "type": "MOCK_RESPONSE" + } + }, + { + "type": "response", + "version": 1.0, + "ruleId": 3, + "priority": 1, + "description": "post /settlements", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "settlements", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/settlements" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "id": "123", + "state": "PENDING_SETTLEMENT", + "settlementWindows": [ + [ + { + "id": 123, + "createdDate": "1954-11-03", + "state": "PENDING_SETTLEMENT", + "reason": "do", + "changedDate": "1954-11-03" + } + ] + ], + "participants": [ + { + "id": -91450113, + "accounts": [ + { + "id": 81795155, + "reason": "veniam est proident commodo aliqua", + "state": "PENDING_SETTLEMENT", + "netSettlementAmount": { + "amount": 100, + "currency": "USD" + } + } + ] + } + ] + }, + "statusCode": "200" + }, + "delay": 0, + "type": "FIXED_RESPONSE" + } + }, + { + "type": "response", + "version": 1.0, + "ruleId": 4, + "priority": 1, + "description": "get /settlements/{id}", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "settlements", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/settlements/{id}" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": { + "id": "{$request.params.id}", + "state": "PS_TRANSFERS_RECORDED", + "settlementWindows": [ + [ + { + "createdDate": "2020-02-10", + "id": "{$request.params.id}", + "state": "PS_TRANSFERS_RECORDED", + "reason": "amet cillum culpa v", + "changedDate": "2020-02-10" + } + ] + ], + "participants": [ + { + "id": -35933071, + "accounts": [ + { + "id": -14386227, + "reason": "aliquip aliqua nulla deserunt", + "state": "PS_TRANSFERS_RECORDED", + "netSettlementAmount": { + "amount": 100, + "currency": "USD" + } + } + ] + } + ] + }, + "statusCode": "200" + }, + "delay": 0, + "type": "FIXED_RESPONSE" + } + }, + { + "type": "response", + "version": 1.0, + "ruleId": 5, + "priority": 1, + "description": "get /settlementWindows", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "settlements", + "asynchronous": false + }, + "conditions": { + "all": [ + { + "fact": "operationPath", + "operator": "equal", + "value": "/settlementWindows" + }, + { + "fact": "method", + "operator": "equal", + "value": "get" + } + ] + }, + "event": { + "method": null, + "path": null, + "params": { + "body": [ + { + "createdDate": "2020-02-10", + "id": 123, + "state": "{$request.query.state}", + "reason": "string", + "changedDate": "2020-02-10" + } + ], + "statusCode": "200" + }, + "delay": 0, + "type": "FIXED_RESPONSE" + } + } ] \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/config.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/config.json index 599ca8f..2d6fe49 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/config.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/config.json @@ -1,3 +1,3 @@ -{ - "activeRulesFile": "default.json" +{ + "activeRulesFile": "default.json" } \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/default.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/default.json index d62b760..4e27a91 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/default.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/default.json @@ -1,45 +1,45 @@ -[ - { - "ruleId": 1, - "priority": 1, - "description": "Fail transfer on quote lookup when amount is 1234.", - "apiVersion": { - "minorVersion": 1, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "body", - "operator": "numericEqual", - "value": "1234", - "path": "amount.amount" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/quotes/{ID}/error", - "params": { - "scripts": { - "scriptingEngine": "postman" - } - }, - "type": "MOCK_ERROR_CALLBACK" - }, - "type": "validation", - "version": 1 - } +[ + { + "ruleId": 1, + "priority": 1, + "description": "Fail transfer on quote lookup when amount is 1234.", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericEqual", + "value": "1234", + "path": "amount.amount" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "scripts": { + "scriptingEngine": "postman" + } + }, + "type": "MOCK_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + } ] \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/p2p-limit.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/p2p-limit.json index 232bee2..5e17a6e 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/p2p-limit.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/rules_validation/p2p-limit.json @@ -1,55 +1,55 @@ -[ - { - "ruleId": 1, - "priority": 1, - "description": "post /quotes", - "apiVersion": { - "minorVersion": 0, - "majorVersion": 1, - "type": "fspiop", - "asynchronous": true - }, - "conditions": { - "all": [ - { - "fact": "body", - "operator": "numericGreaterThan", - "value": "{$environment.ttkAllowedAmount}", - "path": "amount.amount" - }, - { - "fact": "body", - "operator": "equal", - "value": "testingtoolkitdfsp", - "path": "payee.partyIdInfo.fspId" - }, - { - "fact": "operationPath", - "operator": "equal", - "value": "/quotes" - }, - { - "fact": "method", - "operator": "equal", - "value": "post" - } - ] - }, - "event": { - "method": "put", - "path": "/quotes/{ID}/error", - "params": { - "body": { - "errorInformation": { - "errorCode": "5100", - "errorDescription": "The total allowed amount for the dfsp has been reached" - } - }, - "scripts": {} - }, - "type": "MOCK_ERROR_CALLBACK" - }, - "type": "validation", - "version": 1 - } +[ + { + "ruleId": 1, + "priority": 1, + "description": "post /quotes", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "conditions": { + "all": [ + { + "fact": "body", + "operator": "numericGreaterThan", + "value": "{$environment.ttkAllowedAmount}", + "path": "amount.amount" + }, + { + "fact": "body", + "operator": "equal", + "value": "testingtoolkitdfsp", + "path": "payee.partyIdInfo.fspId" + }, + { + "fact": "operationPath", + "operator": "equal", + "value": "/quotes" + }, + { + "fact": "method", + "operator": "equal", + "value": "post" + } + ] + }, + "event": { + "method": "put", + "path": "/quotes/{ID}/error", + "params": { + "body": { + "errorInformation": { + "errorCode": "5100", + "errorDescription": "The total allowed amount for the dfsp has been reached" + } + }, + "scripts": {} + }, + "type": "MOCK_ERROR_CALLBACK" + }, + "type": "validation", + "version": 1 + } ] \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/system_config.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/system_config.json index 4f6fb46..296e008 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/system_config.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/system_config.json @@ -1,122 +1,122 @@ -{ - "API_PORT": 5000, - "HOSTING_ENABLED": false, - "INBOUND_MUTUAL_TLS_ENABLED": false, - "OUTBOUND_MUTUAL_TLS_ENABLED": false, - "CONFIG_VERSIONS": { - "response": 1, - "callback": 1, - "validation": 1, - "forward": 1, - "userSettings": 1 - }, - "DB": { - "URI": "mongodb://ttk:ttk@localhost:27017/ttk" - }, - "OAUTH": { - "AUTH_ENABLED": false, - "APP_OAUTH_CLIENT_KEY": "ttk", - "APP_OAUTH_CLIENT_SECRET": "secret", - "MTA_ROLE": "Application/MTA", - "PTA_ROLE": "Application/PTA", - "EVERYONE_ROLE": "Internal/everyone", - "OAUTH2_TOKEN_ISS": "http://mojaloop-testing-toolkit:5050/api/oauth2/token", - "OAUTH2_ISSUER": "http://mojaloop-testing-toolkit:5050/api/oauth2/token", - "EMBEDDED_CERTIFICATE": "CERTIFICATE" - }, - "CONNECTION_MANAGER": { - "ENABLED": false, - "API_URL": "http://connection-manager-api:5061", - "AUTH_ENABLED": false, - "HUB_USERNAME": "hub", - "HUB_PASSWORD": "hub" - }, - "KEYCLOAK": { - "ENABLED": false, - "API_URL": "http://localhost:8080", - "REALM": "testingtoolkit", - "ADMIN_REALM": "master", - "ADMIN_USERNAME": "admin", - "ADMIN_PASSWORD": "admin", - "ADMIN_CLIENT_ID": "admin-cli" - }, - "SERVER_LOGS": { - "ENABLED": true, - "RESULTS_PAGE_SIZE": 50, - "ADAPTER": { - "TYPE": "ELASTICSEARCH", - "INDEX": "moja*", - "API_URL": "http://dev1-elasticsearch.mojaloop.live/" - } - }, - "HTTP_CLIENT": { - "KEEP_ALIVE": true, - "MAX_SOCKETS": 50, - "UNUSED_AGENTS_EXPIRY_MS": 1800000, - "UNUSED_AGENTS_CHECK_TIMER_MS": 300000 - }, - "INIT_CONFIG": { - "objectStore": {} - }, - "API_DEFINITIONS": [ - { - "type": "fspiop", - "version": "1.0", - "folderPath": "fspiop_1.0", - "asynchronous": true - }, - { - "type": "fspiop", - "version": "1.1", - "folderPath": "fspiop_1.1", - "asynchronous": true - }, - { - "type": "settlements", - "version": "1.0", - "folderPath": "settlements_1.0" - }, - { - "type": "settlements", - "version": "2.0", - "folderPath": "settlements_2.0" - }, - { - "type": "central_admin", - "caption": "(old)", - "version": "9.3", - "folderPath": "central_admin_old_9.3" - }, - { - "type": "central_admin", - "version": "1.0", - "folderPath": "central_admin_1.0" - }, - { - "type": "als_admin", - "version": "1.1", - "folderPath": "als_admin_1.1" - }, - { - "type": "mojaloop_simulator", - "version": "0.1", - "folderPath": "mojaloop_simulator_0.1" - }, - { - "type": "mojaloop_sdk_outbound_scheme_adapter", - "version": "1.0", - "folderPath": "mojaloop_sdk_outbound_scheme_adapter_1.0" - }, - { - "type": "payment_manager", - "version": "1.4", - "folderPath": "payment_manager_1.4" - }, - { - "type": "fx-api", - "version": "2.0", - "folderPath": "fx-api_2.0", - "asynchronous": true - } - ] +{ + "API_PORT": 5000, + "HOSTING_ENABLED": false, + "INBOUND_MUTUAL_TLS_ENABLED": false, + "OUTBOUND_MUTUAL_TLS_ENABLED": false, + "CONFIG_VERSIONS": { + "response": 1, + "callback": 1, + "validation": 1, + "forward": 1, + "userSettings": 1 + }, + "DB": { + "URI": "mongodb://ttk:ttk@localhost:27017/ttk" + }, + "OAUTH": { + "AUTH_ENABLED": false, + "APP_OAUTH_CLIENT_KEY": "ttk", + "APP_OAUTH_CLIENT_SECRET": "secret", + "MTA_ROLE": "Application/MTA", + "PTA_ROLE": "Application/PTA", + "EVERYONE_ROLE": "Internal/everyone", + "OAUTH2_TOKEN_ISS": "http://mojaloop-testing-toolkit:5050/api/oauth2/token", + "OAUTH2_ISSUER": "http://mojaloop-testing-toolkit:5050/api/oauth2/token", + "EMBEDDED_CERTIFICATE": "CERTIFICATE" + }, + "CONNECTION_MANAGER": { + "ENABLED": false, + "API_URL": "http://connection-manager-api:5061", + "AUTH_ENABLED": false, + "HUB_USERNAME": "hub", + "HUB_PASSWORD": "hub" + }, + "KEYCLOAK": { + "ENABLED": false, + "API_URL": "http://localhost:8080", + "REALM": "testingtoolkit", + "ADMIN_REALM": "master", + "ADMIN_USERNAME": "admin", + "ADMIN_PASSWORD": "admin", + "ADMIN_CLIENT_ID": "admin-cli" + }, + "SERVER_LOGS": { + "ENABLED": true, + "RESULTS_PAGE_SIZE": 50, + "ADAPTER": { + "TYPE": "ELASTICSEARCH", + "INDEX": "moja*", + "API_URL": "http://dev1-elasticsearch.mojaloop.live/" + } + }, + "HTTP_CLIENT": { + "KEEP_ALIVE": true, + "MAX_SOCKETS": 50, + "UNUSED_AGENTS_EXPIRY_MS": 1800000, + "UNUSED_AGENTS_CHECK_TIMER_MS": 300000 + }, + "INIT_CONFIG": { + "objectStore": {} + }, + "API_DEFINITIONS": [ + { + "type": "fspiop", + "version": "1.0", + "folderPath": "fspiop_1.0", + "asynchronous": true + }, + { + "type": "fspiop", + "version": "1.1", + "folderPath": "fspiop_1.1", + "asynchronous": true + }, + { + "type": "settlements", + "version": "1.0", + "folderPath": "settlements_1.0" + }, + { + "type": "settlements", + "version": "2.0", + "folderPath": "settlements_2.0" + }, + { + "type": "central_admin", + "caption": "(old)", + "version": "9.3", + "folderPath": "central_admin_old_9.3" + }, + { + "type": "central_admin", + "version": "1.0", + "folderPath": "central_admin_1.0" + }, + { + "type": "als_admin", + "version": "1.1", + "folderPath": "als_admin_1.1" + }, + { + "type": "mojaloop_simulator", + "version": "0.1", + "folderPath": "mojaloop_simulator_0.1" + }, + { + "type": "mojaloop_sdk_outbound_scheme_adapter", + "version": "1.0", + "folderPath": "mojaloop_sdk_outbound_scheme_adapter_1.0" + }, + { + "type": "payment_manager", + "version": "1.4", + "folderPath": "payment_manager_1.4" + }, + { + "type": "fx-api", + "version": "2.0", + "folderPath": "fx-api_2.0", + "asynchronous": true + } + ] } \ No newline at end of file diff --git a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/user_config.json b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/user_config.json index 46e9343..e3541f8 100644 --- a/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/user_config.json +++ b/on-premise-deploy/testing-toolkit/docker-compose/as-a-switch/spec_files/user_config.json @@ -1,103 +1,103 @@ -{ - "VERSION": 1, - "CALLBACK_ENDPOINT": "http://sdk-scheme-adapter:4000", - "CALLBACK_RESOURCE_ENDPOINTS": { - "enabled": false, - "endpoints": [ - { - "method": "put", - "path": "/parties/{Type}/{ID}", - "endpoint": "http://localhost:4002" - }, - { - "method": "put", - "path": "/quotes/{ID}", - "endpoint": "http://localhost:3002" - }, - { - "method": "put", - "path": "/transfers/{ID}", - "endpoint": "http://localhost:3000" - } - ] - }, - "HUB_ONLY_MODE": false, - "ENDPOINTS_DFSP_WISE": { - "dfsps": { - "userdfsp": { - "defaultEndpoint": "http://scheme-adapter:4000", - "endpoints": [] - }, - "userdfsp2": { - "defaultEndpoint": "http://scheme-adapter2:4000", - "endpoints": [] - } - } - }, - "SEND_CALLBACK_ENABLE": true, - "FSPID": "testingtoolkitdfsp", - "DEFAULT_USER_FSPID": "userdfsp", - "TRANSFERS_VALIDATION_WITH_PREVIOUS_QUOTES": true, - "TRANSFERS_VALIDATION_ILP_PACKET": true, - "TRANSFERS_VALIDATION_CONDITION": true, - "ILP_SECRET": "secret", - "VERSIONING_SUPPORT_ENABLE": true, - "VALIDATE_INBOUND_JWS": false, - "VALIDATE_INBOUND_PUT_PARTIES_JWS": false, - "JWS_SIGN": false, - "JWS_SIGN_PUT_PARTIES": false, - "CLIENT_MUTUAL_TLS_ENABLED": false, - "ADVANCED_FEATURES_ENABLED": true, - "CALLBACK_TIMEOUT": 10000, - "DEFAULT_REQUEST_TIMEOUT": 15000, - "SCRIPT_TIMEOUT": 5000, - "LOG_SERVER_UI_URL": "http://dev1-efk.mojaloop.live/app/kibana", - "UI_CONFIGURATION": { - "MOBILE_SIMULATOR": { - "HUB_CONSOLE_ENABLED": true - } - }, - "CLIENT_TLS_CREDS": [ - { - "HOST": "testfsp1", - "CERT": "-----BEGIN CERTIFICATE-----\nMIIFATCCAumgAwIBAgIUEcEtqgcXBoTykvaD6PprzY8kxpYwDQYJKoZIhvcNAQEL\nBQAwfzERMA8GA1UEChMITW9kdXNCb3gxHDAaBgNVBAsTE0luZnJhc3RydWN0dXJl\nIFRlYW0xTDBKBgNVBAMTQ3Rlc3Rmc3AxLnFhLnByZS5teWFubWFycGF5LXByZS5p\nby5pbnRlcm5hbCB0ZXN0ZnNwMSBJbnRlcm1lZGlhdGUgQ0EwHhcNMjEwMjIyMTkw\nMTEyWhcNMjMwMjIzMDY0MDA2WjBdMREwDwYDVQQKEwhNb2R1c0JveDEcMBoGA1UE\nCxMTSW5mcmFzdHJ1Y3R1cmUgVGVhbTEqMCgGA1UEAxMhdGVzdGZzcDEucWEucHJl\nLm15YW5tYXJwYXktcHJlLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEApndEBbmdlfrpnidagKb2D32bEL+iGYxLEicdQVs24018zNPdbrIYtXyDjgjA\nq718HH5XQW2FSz6cA1CbQ6jLuY88EZRUiCSJ4rCkENWw+mpVLyOd+mcYU4JwOQNC\nP+W8GGcW/haifkXtHEDUO4pIxnXWC6DftvxZ3TH5PxtWO8aJcsoj94oBTPOhnGi0\nC356XyseYl7o7hdxZu3DvY3Wyh/k5pDDHOCjQYxl9wjtW+BVWMCFxRaCu4f/3LVj\nca9BccwZ8O4Rdhu6lhJEUCUgTqdx3vXRB1xzwHT0W7gariy4RVbvwE35AaCliyEr\n4O5WlCvAMOct7POYDAwNuoeb7wIDAQABo4GWMIGTMA4GA1UdDwEB/wQEAwIDqDAT\nBgNVHSUEDDAKBggrBgEFBQcDAjAdBgNVHQ4EFgQU2alVxVOOplYXiLAYCDaII4E0\n/WgwHwYDVR0jBBgwFoAUCFvcCetcirxZPE3N6qMdOo5H7Z4wLAYDVR0RBCUwI4Ih\ndGVzdGZzcDEucWEucHJlLm15YW5tYXJwYXktcHJlLmlvMA0GCSqGSIb3DQEBCwUA\nA4ICAQBkX5LItY0calp7NT21O8z+iufVNV8onEch4J7HJjEVwtCB4UVl7LrWJ3cw\n9KLt7nj85/AUuuhtNPJO9DW/x+0xRyW94Ef5MYHP3nheFWTag8riYl/1SXljOssS\nHCpTvRhirnfGeqBGO1OBwCbkYNIEZI95eMerVoPFm0PfGBb4DJ6mUdfc3qzeOP7K\nOlE5VMhwH2PYv1TS7Hpj1k/1dxpdvyOs7EKVvWD+OokLhJaHgU8NWVetTUtsXSN/\nTv06ZN8JGTN/Udm7POVyEaol8Jw2FRGGKcwOBKbqroNs6POqTofqZeL4SFAkzzQL\nvOAhbQIB6GSznG1Gg1G9IjGVCMXUhpNK2PD8RR1ovzi0MZlRkITGRPhBYQf5xMFl\nZeq0mGFQR3VYDdlwT0O37C8fpaYvpdupeYdxcB623PNz1VkO1MbsXnOoHY8kcFGa\nMh4IARCeR/MwXNWHpGrd6J5Mzmhk0Vy8GyBbqcROUpNR/XTZYRTyfTEq5+amJyLi\n67OB9FP5cS7oQhj7gsaQCTJlxbh/CjmQdKmIimWSEZkDePK5eExNPafBk47tx4KA\nFmh9pIqRyheROesa/zTDGYySNcVd14dl703pyZQNO4b5rap0SZoyGDTfI+7OqAHM\nAz0kWYyZps2nqPZgbwDFigIy2TESvoXahCCtNUoCy9sawa3Diw==\n-----END CERTIFICATE-----", - "KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEApndEBbmdlfrpnidagKb2D32bEL+iGYxLEicdQVs24018zNPd\nbrIYtXyDjgjAq718HH5XQW2FSz6cA1CbQ6jLuY88EZRUiCSJ4rCkENWw+mpVLyOd\n+mcYU4JwOQNCP+W8GGcW/haifkXtHEDUO4pIxnXWC6DftvxZ3TH5PxtWO8aJcsoj\n94oBTPOhnGi0C356XyseYl7o7hdxZu3DvY3Wyh/k5pDDHOCjQYxl9wjtW+BVWMCF\nxRaCu4f/3LVjca9BccwZ8O4Rdhu6lhJEUCUgTqdx3vXRB1xzwHT0W7gariy4RVbv\nwE35AaCliyEr4O5WlCvAMOct7POYDAwNuoeb7wIDAQABAoIBAB4YIawHSn36xpFY\n+/uWM5XJV2dHvb5wpoG5oIhYPSwKri05gCaq+9yTjhT3cB2cO/vKu2uQqTBZOUtA\nH1G0CmCZjHqBHmcec+8PkBmbCEu9PXkwLzc9vCAczL0B4dA7cC3ZNUbqQKYjbiJV\ndgjtjwqR8whXJRqntHdQuYa3InfbufcHNHhSXJwE9MqVRpsv/BfY9wjhQfGBHUnT\nCz41xj1bu8Uy4+/1sRF/l9fYDm5E6WbgzvI49/fM7hA+8fQqoRkFLlEzzBhWb93Q\n2qVo2Y5RhVpffdyxPYX7b9RI7UmUZYp2sLl5GYj5ZzTzsffwUdPl2pZlRkYJGvUo\nortpToECgYEA17NVIZgeQ5VcSsZKGJlzPkcdPoWCk7RY5DugxTaNwSE/uO25B/Ax\nBPE6ZC9LbfXyfTQXaam2VtpSzvNJ7p7j30qkEK0Z+I2pGAVohZg4enkHaIQkYtIP\naZZ/wce5R8VZq6EpToprTm3cG6T+nNVOzqRjUqgnUZyY8nWy2CD5OucCgYEAxZEb\nOKjo9Iwrod2uOZlQDAsnTvgqZySW/lORrnfEWmOEiJpRvjlxMfNPNlc2iMTBQShq\naPZi48g17btU8ACs2NOH/FXuxooDe+0gJDj48WP9/bBzOAOJqhKZ+g9l/Cr978yJ\nAHNh/w8foUUkqAfxmXoTImw7LdSaPIc7ewAlPbkCgYAcGq6d6O8QiTZ0O6/N0riU\nRbnGuqiPzDDE1AwXhgskPcvKsZapNR998FxWT185nZERxSbDyqwKVvnxIvvgDm3M\nWzJTReqbWwHMMnAy7+lz868GbCk9gvclH8nXmslGU61iUmZKaHigyGmkZHQURSq2\ne+7BB03QMWIwPSunQ2yVwwKBgQCbPrzvNvtnPsYCeZmwNSLLc/A9g5B+YCguTSjK\nud4XUOASH4FgQu8J2zFBeCKoMkPRmZqURBfM+cQ2vN+vgDhSYVYYGMZ6SHUYamq5\nS/OCa5poQMEpIM6KT/eioXr4PigwyL5XFlPJAu9N4HE/gI5+lYh3oiiWiNtx+Knq\nq2CYMQKBgQCv+QTGDrSc3SUaWT+JMoFdfzvJyyqQOUvgRbSGAp5GryYqI9dozx70\nlT2IdoAZ0DHrJhNs13Pr7ngXwqS6pKlZU8NSX2ch7h5ZwIsYJESzKwXF/frLMQSy\nTPV3d0hb7UaW3wqOx2Dbj8vJJdvUo3UUkOcmgesqGg3nf3t51I6k0A==\n-----END RSA PRIVATE KEY-----" - }, - { - "HOST": "payeefsp", - "CERT": "-----BEGIN CERTIFICATE-----\nMIIFATCCAumgAwIBAgIUBDD1woZm3eqYA8FXUyiaAHu6sDkwDQYJKoZIhvcNAQEL\nBQAwfzERMA8GA1UEChMITW9kdXNCb3gxHDAaBgNVBAsTE0luZnJhc3RydWN0dXJl\nIFRlYW0xTDBKBgNVBAMTQ3BheWVlZnNwLnFhLnByZS5teWFubWFycGF5LXByZS5p\nby5pbnRlcm5hbCBwYXllZWZzcCBJbnRlcm1lZGlhdGUgQ0EwHhcNMjEwMjIyMTkw\nMTEyWhcNMjMwMjIzMDY0MDA1WjBdMREwDwYDVQQKEwhNb2R1c0JveDEcMBoGA1UE\nCxMTSW5mcmFzdHJ1Y3R1cmUgVGVhbTEqMCgGA1UEAxMhcGF5ZWVmc3AucWEucHJl\nLm15YW5tYXJwYXktcHJlLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAwyJf0nOXqUSeYRJ3+QQGnkZ+s9yPlqYqNRyDpyqj9mLNWZ3F2lLgHQ/6idmB\ni+M4AoVWs9+ihr5zFTl0piEQkgqjBa6oCg3yqHmya9H/+xrD8SPQpKEI0LifPI75\nhHDqCNhuynA/JTiK2K0dH+Ea0jHQJfEyTmXwMJd0zqdeIBeAeMtyW1icZ6e/28ri\nmUEYPPk18dUoCMktpO0vXjJSH1a2YFI0eAp8kdEiuQc2bz/b5PW2aaurn8RSrtAC\ng2XASVs2mn2wfjq4zmx8LyhJHatU3nzQPQ6OOAcow/Lbbi5VSwQdXF0KwnMBY+x5\nE0H2mm0jIUfDIf6oZohtLVx8MQIDAQABo4GWMIGTMA4GA1UdDwEB/wQEAwIDqDAT\nBgNVHSUEDDAKBggrBgEFBQcDAjAdBgNVHQ4EFgQUCBshFUmmVQowZ4hS4lKGo4em\nG1MwHwYDVR0jBBgwFoAUb9x3dRUpXiQg40v5kFnYtesB5iUwLAYDVR0RBCUwI4Ih\ncGF5ZWVmc3AucWEucHJlLm15YW5tYXJwYXktcHJlLmlvMA0GCSqGSIb3DQEBCwUA\nA4ICAQBn+4cUHlaCdLM2U0zcYBrBAgNGUn74TgLc0lRzm+KlfS6lMhzMQtML+bwY\n6OMcDqd4RTozA98U8UH+aG3GBJlDGoccUGYuGcr/w6ZdNQ46tzqQ3lRG9VKv1L2V\n3gnox3EmnhwnPR2PERtvYUhBDfUcAJhQc/MN7aNdk9JYMAHy+VF7V7Mie6u99doj\noANKUf6NZfLZ0XAMuQIcGvvDv2TorNs33PR3dFyBH/HY0a19rVLiPUCK8WTWpjvO\nAwTmqiV38HwbJ/nFW9Skt3OM1GaPnfS6Eg+RT4JPVQG/Gg26XLuP15LQAOHTV6zi\nY7EwtBMs7FFEXE2p6E94YUNy2kKz4f9sZlxEImZ9hmpa9mRcM5WqSyHVQiEJantY\n2RMCbStjR5F2KUC5a0kQ/IywekfUtaUhfPKz0zrxN5TVywXX8MTqIscUgdZgpE0j\nxu7fiFrMmOEbin0gdTk5ojV3q4FToewezY/CVRSjf3/e/oNgVmvasyT5/bXtf+Ds\nmToyjUCuWeQN0N6xF6uXztr3DRsUCKIu72fSQD189MXcknSoj9xYVrRyNqvEllwy\nSyVd3XtHhRuW4ynRgPxqb8oI1cleOBOBi2MCOHQrnGqYq/e9K/GLXztmR2GAAkV3\nm/Dy3o5fDBi7UYiMBhUnZTGEz7xfREFl7kvgFLzqIsnHXc8caA==\n-----END CERTIFICATE-----", - "KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwyJf0nOXqUSeYRJ3+QQGnkZ+s9yPlqYqNRyDpyqj9mLNWZ3F\n2lLgHQ/6idmBi+M4AoVWs9+ihr5zFTl0piEQkgqjBa6oCg3yqHmya9H/+xrD8SPQ\npKEI0LifPI75hHDqCNhuynA/JTiK2K0dH+Ea0jHQJfEyTmXwMJd0zqdeIBeAeMty\nW1icZ6e/28rimUEYPPk18dUoCMktpO0vXjJSH1a2YFI0eAp8kdEiuQc2bz/b5PW2\naaurn8RSrtACg2XASVs2mn2wfjq4zmx8LyhJHatU3nzQPQ6OOAcow/Lbbi5VSwQd\nXF0KwnMBY+x5E0H2mm0jIUfDIf6oZohtLVx8MQIDAQABAoIBAAvRTB5Rs9CjgDf+\nx1dEYCY7vLal1+hWvd2jkXGRSobEaw1PWckkFcCM1C5/BrJzG1RDwQF5vL0OUafq\nZ98bx4YgsMjKUBDz0UtUu3J+MFODxnQXKC6gNgl19ObU/dWAhRvuB5+o9poJd5cx\nvL7OgjJSo/l4RwSqdcZrlb5iMngc+SEL/BWK8rsrNd21M7z+kPKLxohbECnH1yu7\nLbfCuoO2yUqMdevcm/qgRq0TpdWwagHZRBOMkAWpLbchOdpftyv6zYjsQWiIKnOW\nyLCMr1iZvpdxwYKr2eD+ki5AOVVuaqreY88C240YPVloTgrmrTZmjC4jr+eTL7XM\nvFXQAfECgYEA7mLDidTQVxnUS+RPUcjn1ylnBcuwyzRsd314DiW91FsDKBKEVje3\nHxRiOsNWQ3xqYNF3jZFctLY4TeFCSGzRFizxg40ZZV/vbUL34cTIX8x6ASdzzmqO\ngW535Oa8kMSd0IjXciXnEsCzaQQ+q52EEi7DeHv2CSyldOBouY9SCd0CgYEA0Y16\nMZHh1+eY8wloxHcwsAJNjh3pgVi3NT8bQKLJWvkRYPBcH+Qvg3cYhXIXL+EUlMtt\nyArmTxG3qTF3u8p/qrYNn/pguX3ICfbVJDrxbgobpIVpkPwDyacm9R8KVFwNQUXx\nrBcBo6Th0OX9bk8wX0mv0jRS8vWZv0vJhWZreGUCgYEAnUv2EsCmKJMWjm08GY8j\ny8m5/Q0Gv078M2xLB6rHs5PKZWqyf+GLp6pflr7F8Qnrd68/394G+gcy59C3V+rV\nnHhTdKZqF4ZSChqiTgr23J+j8ZcCxzVwit9FpXjK/AuAxtVEtEFmU+1rdOQkJkFt\noEHTIXFKS4t2McTR1X9IdtECgYB/6jGt8pP+3FPD/3lhfDRPLIi0+NNh7oqfSS9U\njEoHa0RNfUtu+DZ8tIVWaCd5RZbvoSIZW3XszC7la9nf2yOFTG4Sup6ye/JRCshe\nvlBD0I3BJuMi6oNRY+Rm+pSunCZHMu/sEXshrnNdtha2cEZh1DQsR15fCsbYO+X+\ntV9i9QKBgFqy36h5eDETA7Qvlw6cOQATukoNRux4PrvXHjdhRDtNlZeMUdpU00L+\n4vsyMOcsigJerOAA6Q4ATuNhoVlJW2CHYt39UD7Xiamsm33IzFx3HdNIJcRQ/+l+\n8Sa2UGfazug2B7fwHXxUZrek8VoJQtcAKeQoO1Fj3zd04pNjwE4K\n-----END RSA PRIVATE KEY-----" - }, - { - "HOST": "payerfsp", - "CERT": "-----BEGIN CERTIFICATE-----\nMIIFATCCAumgAwIBAgIUUJwMg2LBzd3FZBz75YVuk2s0q3gwDQYJKoZIhvcNAQEL\nBQAwfzERMA8GA1UEChMITW9kdXNCb3gxHDAaBgNVBAsTE0luZnJhc3RydWN0dXJl\nIFRlYW0xTDBKBgNVBAMTQ3BheWVyZnNwLnFhLnByZS5teWFubWFycGF5LXByZS5p\nby5pbnRlcm5hbCBwYXllcmZzcCBJbnRlcm1lZGlhdGUgQ0EwHhcNMjEwMjIyMTkw\nMTE2WhcNMjMwMjIzMDY0MDA5WjBdMREwDwYDVQQKEwhNb2R1c0JveDEcMBoGA1UE\nCxMTSW5mcmFzdHJ1Y3R1cmUgVGVhbTEqMCgGA1UEAxMhcGF5ZXJmc3AucWEucHJl\nLm15YW5tYXJwYXktcHJlLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAsCJqQwV2i8Asi349qUUbcYtx07IQ8Gp6ZbsXPbGmOSeQ/LN/uofGs5LDs13M\nLDUNhFrSb6et5Y/Dj85j0qMvzhW1cgcxMXNYLhwWCAX99sqBGhnLfF6rSSi7ZkbE\nAtTDwHqBLk/Es0ts512k1H6ReejLbsgGYDwiuZULXpfd4Iw9t6V22lQw6B1n9CLm\nNueTKkUM7jAN5LnF4fBCof3jpTB821taDog0Dla7DUGV1AdIyyJyLqk+8obDqXuC\niooGwUTrBUOTrWRNlP/Tw7W0Lv76duoqLQs2INUeKRfUJYei/+cy2fFkZZ8GKaHG\nZ2eoOQ0L9VumbeCzW8MOsO4QawIDAQABo4GWMIGTMA4GA1UdDwEB/wQEAwIDqDAT\nBgNVHSUEDDAKBggrBgEFBQcDAjAdBgNVHQ4EFgQUr+lCpfITlgJJoxuW6NBFoT1t\nqAcwHwYDVR0jBBgwFoAU4UukJy4iiDZUSB5DrcfOAr6spT8wLAYDVR0RBCUwI4Ih\ncGF5ZXJmc3AucWEucHJlLm15YW5tYXJwYXktcHJlLmlvMA0GCSqGSIb3DQEBCwUA\nA4ICAQCHEus15MfR1svIOgalbtmwJPDwBURaryWf2D9BkKV2Csdlzp0miRxkhgn9\nWZ+Cym0GiMfmo6FZv+OCXbakBYFycs2lfgZXt6r3Vt6zwZcW0l5/iYUHn8g+BKYO\n9CBJpBwRpn4rDXwUCbHWXF1tHCWMg3eooLN9I2Ly2DZvSPmgH8c08W2SE72nfVyi\nqa/zdD7u8g+XxXXJd7A1AZDTE+cQ29goTpIDQQVpw+a/a9yT9BEbiKtScUTounX0\nmu0uPpBSLgQ3lkXJEy46O7etWjXpSUW8HnKiEDloDmkmKGxFj9m5wtsIZVmu+kYP\nZQWBLgN6goyuxB/cIiAC8mqLgv8/+AcZ91jpCy3dZ6a/Nla3Xq+L046AnpOYHLJp\nizV/O0UQdV/pdPtn0D7Jci++rsKBMWovX1bHPxqxHsnxMYHaUap1DFU2LWKKYBl2\nZcOfNb2My2IXK/tqEegkJoEQx+gFGGjWeV4iw/cZZosIoM4ibubS1BF3I3er+0Fo\nT3uqZJuqBePdu6II6Vbg+i6v3P0KRUYRRs3yNm9VuuNHfcc+KQaHH4iYsPi5fk95\n+EIDBWtGUu9pxx8trc33v51t7dKyQqNH4qLrKywM9OybG/FZT2aCRRXtjuMgmaN+\nXfV5OYksS9Mj+JFtCNWmhWC8BLAtfdyLejLpofUDwrdfwFwZ0g==\n-----END CERTIFICATE-----", - "KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAsCJqQwV2i8Asi349qUUbcYtx07IQ8Gp6ZbsXPbGmOSeQ/LN/\nuofGs5LDs13MLDUNhFrSb6et5Y/Dj85j0qMvzhW1cgcxMXNYLhwWCAX99sqBGhnL\nfF6rSSi7ZkbEAtTDwHqBLk/Es0ts512k1H6ReejLbsgGYDwiuZULXpfd4Iw9t6V2\n2lQw6B1n9CLmNueTKkUM7jAN5LnF4fBCof3jpTB821taDog0Dla7DUGV1AdIyyJy\nLqk+8obDqXuCiooGwUTrBUOTrWRNlP/Tw7W0Lv76duoqLQs2INUeKRfUJYei/+cy\n2fFkZZ8GKaHGZ2eoOQ0L9VumbeCzW8MOsO4QawIDAQABAoIBAQCfRy/y1cDjFfDy\nYEHgjccIggJ4XuGkl5WB45Nbzge0Tcx2SNhr1RbiEwl4bY0SORO1KfB82hSOsNg3\ndnuc4sd7RPRlXo2k21rVr75YmRqVj4D6GnOCT5XzvariDYJ50PAIYn/pYmdNgBrG\ni09gfeiOZu94idgCNL9uNZMngow53vddASgFH+fN4W3xWxXgexXRIxzhObvJGzux\nS2gCvePJ6n//lNIFcB1DR0ewpeLSwvmX6lZDg9IBoWbSCE/jlnAO7owzHphg8+IV\naONKIqeI0JAR1Fnmnh2t06ovVLYdx2eRo29Oqb6W//smHFfMBF22YF6Uq6HGuPQr\nSzHo6+hRAoGBAOTQf8V1qSW19WOMyDFCvvsUweGYlHJsU4dlZV7NaJAUh5n39W3x\nnJi7jZSDW/OUY/7wfGEI+k6WS7ICkZYD+an6Q7l6c4aKq6YkOCQmh2J/b+ZkAkzy\n7b3AyNG1r81fxnq1DMZC4htIDmtt2ru1fElPk8vxAgjagdtxk+v68gezAoGBAMUP\noMvtXa4qgEIk+aYv3S55P1xD4cdjYDtq1PKnkcKuzgj5QqRF3FnsWDKsNHfrD7IM\nFREFx0/iyLBVk1IrjrxHA0m3T0GrAvjpMVtyZDLa2oiKgSVLiBbTigmLebsBQSda\n2COs1IZ2mhgKM6Luyk42r5COL96BjsUHS+lpP3hpAoGBANFreuXw0IUxSox4d2mO\nm1kWIHUnvwYS20hapzLjcUYdZBapeTnNHvQzBFve9jOzpunYlR4Cp4VxzYn5C+Jv\ndPv7kCycREvpczy2faOol9SwqmwFMI3Y8XrwjVxSm7quY+w+9Jgo8uThSEFO5BlU\n+5HlgXHw/Vm5E40TIL2kigw9AoGAffd4fQMVoDCw3hdOsmnkREHjO7J00AT5TeID\nj72IEl+1es0DSYkSyzSmSHYF8CYFWXYZvVDpUGqSiQ2a56rKShZGxsdz1XFgrAY8\ns80SueNmUGPhHBsFOjotAd7ziJPLt0F96ogfLnkAFZ/n1B46mfahEZGijeRZhB8e\n6myJ0wkCgYEA1fMa/pwU2JdNvoAoCh18FWAKk/j7nmF8NPb3a9g7Eyo7Kd5CywdG\nIqDOla0gX1ZvidSj8ujJU/6NVRfjXsaOAWb/shMvFnQF5EZHt/0Om0AUufkqxXly\nJ4rTmFSt4UqDlcm6B1avenWIRVIhDZIH+q07L1OudmX+PDmWVJ0PnSw=\n-----END RSA PRIVATE KEY-----" - } - ], - "GITHUB_CONFIG": { - "TEST_CASES_REPO_OWNER": "mojaloop", - "TEST_CASES_REPO_NAME": "testing-toolkit-test-cases", - "TEST_CASES_REPO_DEFAULT_RELEASE_TAG": "latest", - "TEST_CASES_REPO_BASE_PATH": "collections/dfsp", - "TEST_CASES_REPO_HUB_GP_PATH": "collections/hub/golden_path", - "TEST_CASES_REPO_HUB_PROVISIONING_PATH": "collections/hub/provisioning" - }, - "DEFAULT_ENVIRONMENT_FILE_NAME": "hub_local_environment.json", - "LABELS": [ - { - "name": "p2p", - "description": "tests related to p2p transfer", - "color": "red" - }, - { - "name": "settlements", - "description": "tests related to settlements", - "color": "green" - }, - { - "name": "quotes", - "description": "tests related to quoting service", - "color": "blue" - } - ] -} +{ + "VERSION": 1, + "CALLBACK_ENDPOINT": "http://sdk-scheme-adapter:4000", + "CALLBACK_RESOURCE_ENDPOINTS": { + "enabled": false, + "endpoints": [ + { + "method": "put", + "path": "/parties/{Type}/{ID}", + "endpoint": "http://localhost:4002" + }, + { + "method": "put", + "path": "/quotes/{ID}", + "endpoint": "http://localhost:3002" + }, + { + "method": "put", + "path": "/transfers/{ID}", + "endpoint": "http://localhost:3000" + } + ] + }, + "HUB_ONLY_MODE": false, + "ENDPOINTS_DFSP_WISE": { + "dfsps": { + "userdfsp": { + "defaultEndpoint": "http://scheme-adapter:4000", + "endpoints": [] + }, + "userdfsp2": { + "defaultEndpoint": "http://scheme-adapter2:4000", + "endpoints": [] + } + } + }, + "SEND_CALLBACK_ENABLE": true, + "FSPID": "testingtoolkitdfsp", + "DEFAULT_USER_FSPID": "userdfsp", + "TRANSFERS_VALIDATION_WITH_PREVIOUS_QUOTES": true, + "TRANSFERS_VALIDATION_ILP_PACKET": true, + "TRANSFERS_VALIDATION_CONDITION": true, + "ILP_SECRET": "secret", + "VERSIONING_SUPPORT_ENABLE": true, + "VALIDATE_INBOUND_JWS": false, + "VALIDATE_INBOUND_PUT_PARTIES_JWS": false, + "JWS_SIGN": false, + "JWS_SIGN_PUT_PARTIES": false, + "CLIENT_MUTUAL_TLS_ENABLED": false, + "ADVANCED_FEATURES_ENABLED": true, + "CALLBACK_TIMEOUT": 10000, + "DEFAULT_REQUEST_TIMEOUT": 15000, + "SCRIPT_TIMEOUT": 5000, + "LOG_SERVER_UI_URL": "http://dev1-efk.mojaloop.live/app/kibana", + "UI_CONFIGURATION": { + "MOBILE_SIMULATOR": { + "HUB_CONSOLE_ENABLED": true + } + }, + "CLIENT_TLS_CREDS": [ + { + "HOST": "testfsp1", + "CERT": "-----BEGIN CERTIFICATE-----\nMIIFATCCAumgAwIBAgIUEcEtqgcXBoTykvaD6PprzY8kxpYwDQYJKoZIhvcNAQEL\nBQAwfzERMA8GA1UEChMITW9kdXNCb3gxHDAaBgNVBAsTE0luZnJhc3RydWN0dXJl\nIFRlYW0xTDBKBgNVBAMTQ3Rlc3Rmc3AxLnFhLnByZS5teWFubWFycGF5LXByZS5p\nby5pbnRlcm5hbCB0ZXN0ZnNwMSBJbnRlcm1lZGlhdGUgQ0EwHhcNMjEwMjIyMTkw\nMTEyWhcNMjMwMjIzMDY0MDA2WjBdMREwDwYDVQQKEwhNb2R1c0JveDEcMBoGA1UE\nCxMTSW5mcmFzdHJ1Y3R1cmUgVGVhbTEqMCgGA1UEAxMhdGVzdGZzcDEucWEucHJl\nLm15YW5tYXJwYXktcHJlLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEApndEBbmdlfrpnidagKb2D32bEL+iGYxLEicdQVs24018zNPdbrIYtXyDjgjA\nq718HH5XQW2FSz6cA1CbQ6jLuY88EZRUiCSJ4rCkENWw+mpVLyOd+mcYU4JwOQNC\nP+W8GGcW/haifkXtHEDUO4pIxnXWC6DftvxZ3TH5PxtWO8aJcsoj94oBTPOhnGi0\nC356XyseYl7o7hdxZu3DvY3Wyh/k5pDDHOCjQYxl9wjtW+BVWMCFxRaCu4f/3LVj\nca9BccwZ8O4Rdhu6lhJEUCUgTqdx3vXRB1xzwHT0W7gariy4RVbvwE35AaCliyEr\n4O5WlCvAMOct7POYDAwNuoeb7wIDAQABo4GWMIGTMA4GA1UdDwEB/wQEAwIDqDAT\nBgNVHSUEDDAKBggrBgEFBQcDAjAdBgNVHQ4EFgQU2alVxVOOplYXiLAYCDaII4E0\n/WgwHwYDVR0jBBgwFoAUCFvcCetcirxZPE3N6qMdOo5H7Z4wLAYDVR0RBCUwI4Ih\ndGVzdGZzcDEucWEucHJlLm15YW5tYXJwYXktcHJlLmlvMA0GCSqGSIb3DQEBCwUA\nA4ICAQBkX5LItY0calp7NT21O8z+iufVNV8onEch4J7HJjEVwtCB4UVl7LrWJ3cw\n9KLt7nj85/AUuuhtNPJO9DW/x+0xRyW94Ef5MYHP3nheFWTag8riYl/1SXljOssS\nHCpTvRhirnfGeqBGO1OBwCbkYNIEZI95eMerVoPFm0PfGBb4DJ6mUdfc3qzeOP7K\nOlE5VMhwH2PYv1TS7Hpj1k/1dxpdvyOs7EKVvWD+OokLhJaHgU8NWVetTUtsXSN/\nTv06ZN8JGTN/Udm7POVyEaol8Jw2FRGGKcwOBKbqroNs6POqTofqZeL4SFAkzzQL\nvOAhbQIB6GSznG1Gg1G9IjGVCMXUhpNK2PD8RR1ovzi0MZlRkITGRPhBYQf5xMFl\nZeq0mGFQR3VYDdlwT0O37C8fpaYvpdupeYdxcB623PNz1VkO1MbsXnOoHY8kcFGa\nMh4IARCeR/MwXNWHpGrd6J5Mzmhk0Vy8GyBbqcROUpNR/XTZYRTyfTEq5+amJyLi\n67OB9FP5cS7oQhj7gsaQCTJlxbh/CjmQdKmIimWSEZkDePK5eExNPafBk47tx4KA\nFmh9pIqRyheROesa/zTDGYySNcVd14dl703pyZQNO4b5rap0SZoyGDTfI+7OqAHM\nAz0kWYyZps2nqPZgbwDFigIy2TESvoXahCCtNUoCy9sawa3Diw==\n-----END CERTIFICATE-----", + "KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEApndEBbmdlfrpnidagKb2D32bEL+iGYxLEicdQVs24018zNPd\nbrIYtXyDjgjAq718HH5XQW2FSz6cA1CbQ6jLuY88EZRUiCSJ4rCkENWw+mpVLyOd\n+mcYU4JwOQNCP+W8GGcW/haifkXtHEDUO4pIxnXWC6DftvxZ3TH5PxtWO8aJcsoj\n94oBTPOhnGi0C356XyseYl7o7hdxZu3DvY3Wyh/k5pDDHOCjQYxl9wjtW+BVWMCF\nxRaCu4f/3LVjca9BccwZ8O4Rdhu6lhJEUCUgTqdx3vXRB1xzwHT0W7gariy4RVbv\nwE35AaCliyEr4O5WlCvAMOct7POYDAwNuoeb7wIDAQABAoIBAB4YIawHSn36xpFY\n+/uWM5XJV2dHvb5wpoG5oIhYPSwKri05gCaq+9yTjhT3cB2cO/vKu2uQqTBZOUtA\nH1G0CmCZjHqBHmcec+8PkBmbCEu9PXkwLzc9vCAczL0B4dA7cC3ZNUbqQKYjbiJV\ndgjtjwqR8whXJRqntHdQuYa3InfbufcHNHhSXJwE9MqVRpsv/BfY9wjhQfGBHUnT\nCz41xj1bu8Uy4+/1sRF/l9fYDm5E6WbgzvI49/fM7hA+8fQqoRkFLlEzzBhWb93Q\n2qVo2Y5RhVpffdyxPYX7b9RI7UmUZYp2sLl5GYj5ZzTzsffwUdPl2pZlRkYJGvUo\nortpToECgYEA17NVIZgeQ5VcSsZKGJlzPkcdPoWCk7RY5DugxTaNwSE/uO25B/Ax\nBPE6ZC9LbfXyfTQXaam2VtpSzvNJ7p7j30qkEK0Z+I2pGAVohZg4enkHaIQkYtIP\naZZ/wce5R8VZq6EpToprTm3cG6T+nNVOzqRjUqgnUZyY8nWy2CD5OucCgYEAxZEb\nOKjo9Iwrod2uOZlQDAsnTvgqZySW/lORrnfEWmOEiJpRvjlxMfNPNlc2iMTBQShq\naPZi48g17btU8ACs2NOH/FXuxooDe+0gJDj48WP9/bBzOAOJqhKZ+g9l/Cr978yJ\nAHNh/w8foUUkqAfxmXoTImw7LdSaPIc7ewAlPbkCgYAcGq6d6O8QiTZ0O6/N0riU\nRbnGuqiPzDDE1AwXhgskPcvKsZapNR998FxWT185nZERxSbDyqwKVvnxIvvgDm3M\nWzJTReqbWwHMMnAy7+lz868GbCk9gvclH8nXmslGU61iUmZKaHigyGmkZHQURSq2\ne+7BB03QMWIwPSunQ2yVwwKBgQCbPrzvNvtnPsYCeZmwNSLLc/A9g5B+YCguTSjK\nud4XUOASH4FgQu8J2zFBeCKoMkPRmZqURBfM+cQ2vN+vgDhSYVYYGMZ6SHUYamq5\nS/OCa5poQMEpIM6KT/eioXr4PigwyL5XFlPJAu9N4HE/gI5+lYh3oiiWiNtx+Knq\nq2CYMQKBgQCv+QTGDrSc3SUaWT+JMoFdfzvJyyqQOUvgRbSGAp5GryYqI9dozx70\nlT2IdoAZ0DHrJhNs13Pr7ngXwqS6pKlZU8NSX2ch7h5ZwIsYJESzKwXF/frLMQSy\nTPV3d0hb7UaW3wqOx2Dbj8vJJdvUo3UUkOcmgesqGg3nf3t51I6k0A==\n-----END RSA PRIVATE KEY-----" + }, + { + "HOST": "payeefsp", + "CERT": "-----BEGIN CERTIFICATE-----\nMIIFATCCAumgAwIBAgIUBDD1woZm3eqYA8FXUyiaAHu6sDkwDQYJKoZIhvcNAQEL\nBQAwfzERMA8GA1UEChMITW9kdXNCb3gxHDAaBgNVBAsTE0luZnJhc3RydWN0dXJl\nIFRlYW0xTDBKBgNVBAMTQ3BheWVlZnNwLnFhLnByZS5teWFubWFycGF5LXByZS5p\nby5pbnRlcm5hbCBwYXllZWZzcCBJbnRlcm1lZGlhdGUgQ0EwHhcNMjEwMjIyMTkw\nMTEyWhcNMjMwMjIzMDY0MDA1WjBdMREwDwYDVQQKEwhNb2R1c0JveDEcMBoGA1UE\nCxMTSW5mcmFzdHJ1Y3R1cmUgVGVhbTEqMCgGA1UEAxMhcGF5ZWVmc3AucWEucHJl\nLm15YW5tYXJwYXktcHJlLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAwyJf0nOXqUSeYRJ3+QQGnkZ+s9yPlqYqNRyDpyqj9mLNWZ3F2lLgHQ/6idmB\ni+M4AoVWs9+ihr5zFTl0piEQkgqjBa6oCg3yqHmya9H/+xrD8SPQpKEI0LifPI75\nhHDqCNhuynA/JTiK2K0dH+Ea0jHQJfEyTmXwMJd0zqdeIBeAeMtyW1icZ6e/28ri\nmUEYPPk18dUoCMktpO0vXjJSH1a2YFI0eAp8kdEiuQc2bz/b5PW2aaurn8RSrtAC\ng2XASVs2mn2wfjq4zmx8LyhJHatU3nzQPQ6OOAcow/Lbbi5VSwQdXF0KwnMBY+x5\nE0H2mm0jIUfDIf6oZohtLVx8MQIDAQABo4GWMIGTMA4GA1UdDwEB/wQEAwIDqDAT\nBgNVHSUEDDAKBggrBgEFBQcDAjAdBgNVHQ4EFgQUCBshFUmmVQowZ4hS4lKGo4em\nG1MwHwYDVR0jBBgwFoAUb9x3dRUpXiQg40v5kFnYtesB5iUwLAYDVR0RBCUwI4Ih\ncGF5ZWVmc3AucWEucHJlLm15YW5tYXJwYXktcHJlLmlvMA0GCSqGSIb3DQEBCwUA\nA4ICAQBn+4cUHlaCdLM2U0zcYBrBAgNGUn74TgLc0lRzm+KlfS6lMhzMQtML+bwY\n6OMcDqd4RTozA98U8UH+aG3GBJlDGoccUGYuGcr/w6ZdNQ46tzqQ3lRG9VKv1L2V\n3gnox3EmnhwnPR2PERtvYUhBDfUcAJhQc/MN7aNdk9JYMAHy+VF7V7Mie6u99doj\noANKUf6NZfLZ0XAMuQIcGvvDv2TorNs33PR3dFyBH/HY0a19rVLiPUCK8WTWpjvO\nAwTmqiV38HwbJ/nFW9Skt3OM1GaPnfS6Eg+RT4JPVQG/Gg26XLuP15LQAOHTV6zi\nY7EwtBMs7FFEXE2p6E94YUNy2kKz4f9sZlxEImZ9hmpa9mRcM5WqSyHVQiEJantY\n2RMCbStjR5F2KUC5a0kQ/IywekfUtaUhfPKz0zrxN5TVywXX8MTqIscUgdZgpE0j\nxu7fiFrMmOEbin0gdTk5ojV3q4FToewezY/CVRSjf3/e/oNgVmvasyT5/bXtf+Ds\nmToyjUCuWeQN0N6xF6uXztr3DRsUCKIu72fSQD189MXcknSoj9xYVrRyNqvEllwy\nSyVd3XtHhRuW4ynRgPxqb8oI1cleOBOBi2MCOHQrnGqYq/e9K/GLXztmR2GAAkV3\nm/Dy3o5fDBi7UYiMBhUnZTGEz7xfREFl7kvgFLzqIsnHXc8caA==\n-----END CERTIFICATE-----", + "KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwyJf0nOXqUSeYRJ3+QQGnkZ+s9yPlqYqNRyDpyqj9mLNWZ3F\n2lLgHQ/6idmBi+M4AoVWs9+ihr5zFTl0piEQkgqjBa6oCg3yqHmya9H/+xrD8SPQ\npKEI0LifPI75hHDqCNhuynA/JTiK2K0dH+Ea0jHQJfEyTmXwMJd0zqdeIBeAeMty\nW1icZ6e/28rimUEYPPk18dUoCMktpO0vXjJSH1a2YFI0eAp8kdEiuQc2bz/b5PW2\naaurn8RSrtACg2XASVs2mn2wfjq4zmx8LyhJHatU3nzQPQ6OOAcow/Lbbi5VSwQd\nXF0KwnMBY+x5E0H2mm0jIUfDIf6oZohtLVx8MQIDAQABAoIBAAvRTB5Rs9CjgDf+\nx1dEYCY7vLal1+hWvd2jkXGRSobEaw1PWckkFcCM1C5/BrJzG1RDwQF5vL0OUafq\nZ98bx4YgsMjKUBDz0UtUu3J+MFODxnQXKC6gNgl19ObU/dWAhRvuB5+o9poJd5cx\nvL7OgjJSo/l4RwSqdcZrlb5iMngc+SEL/BWK8rsrNd21M7z+kPKLxohbECnH1yu7\nLbfCuoO2yUqMdevcm/qgRq0TpdWwagHZRBOMkAWpLbchOdpftyv6zYjsQWiIKnOW\nyLCMr1iZvpdxwYKr2eD+ki5AOVVuaqreY88C240YPVloTgrmrTZmjC4jr+eTL7XM\nvFXQAfECgYEA7mLDidTQVxnUS+RPUcjn1ylnBcuwyzRsd314DiW91FsDKBKEVje3\nHxRiOsNWQ3xqYNF3jZFctLY4TeFCSGzRFizxg40ZZV/vbUL34cTIX8x6ASdzzmqO\ngW535Oa8kMSd0IjXciXnEsCzaQQ+q52EEi7DeHv2CSyldOBouY9SCd0CgYEA0Y16\nMZHh1+eY8wloxHcwsAJNjh3pgVi3NT8bQKLJWvkRYPBcH+Qvg3cYhXIXL+EUlMtt\nyArmTxG3qTF3u8p/qrYNn/pguX3ICfbVJDrxbgobpIVpkPwDyacm9R8KVFwNQUXx\nrBcBo6Th0OX9bk8wX0mv0jRS8vWZv0vJhWZreGUCgYEAnUv2EsCmKJMWjm08GY8j\ny8m5/Q0Gv078M2xLB6rHs5PKZWqyf+GLp6pflr7F8Qnrd68/394G+gcy59C3V+rV\nnHhTdKZqF4ZSChqiTgr23J+j8ZcCxzVwit9FpXjK/AuAxtVEtEFmU+1rdOQkJkFt\noEHTIXFKS4t2McTR1X9IdtECgYB/6jGt8pP+3FPD/3lhfDRPLIi0+NNh7oqfSS9U\njEoHa0RNfUtu+DZ8tIVWaCd5RZbvoSIZW3XszC7la9nf2yOFTG4Sup6ye/JRCshe\nvlBD0I3BJuMi6oNRY+Rm+pSunCZHMu/sEXshrnNdtha2cEZh1DQsR15fCsbYO+X+\ntV9i9QKBgFqy36h5eDETA7Qvlw6cOQATukoNRux4PrvXHjdhRDtNlZeMUdpU00L+\n4vsyMOcsigJerOAA6Q4ATuNhoVlJW2CHYt39UD7Xiamsm33IzFx3HdNIJcRQ/+l+\n8Sa2UGfazug2B7fwHXxUZrek8VoJQtcAKeQoO1Fj3zd04pNjwE4K\n-----END RSA PRIVATE KEY-----" + }, + { + "HOST": "payerfsp", + "CERT": "-----BEGIN CERTIFICATE-----\nMIIFATCCAumgAwIBAgIUUJwMg2LBzd3FZBz75YVuk2s0q3gwDQYJKoZIhvcNAQEL\nBQAwfzERMA8GA1UEChMITW9kdXNCb3gxHDAaBgNVBAsTE0luZnJhc3RydWN0dXJl\nIFRlYW0xTDBKBgNVBAMTQ3BheWVyZnNwLnFhLnByZS5teWFubWFycGF5LXByZS5p\nby5pbnRlcm5hbCBwYXllcmZzcCBJbnRlcm1lZGlhdGUgQ0EwHhcNMjEwMjIyMTkw\nMTE2WhcNMjMwMjIzMDY0MDA5WjBdMREwDwYDVQQKEwhNb2R1c0JveDEcMBoGA1UE\nCxMTSW5mcmFzdHJ1Y3R1cmUgVGVhbTEqMCgGA1UEAxMhcGF5ZXJmc3AucWEucHJl\nLm15YW5tYXJwYXktcHJlLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAsCJqQwV2i8Asi349qUUbcYtx07IQ8Gp6ZbsXPbGmOSeQ/LN/uofGs5LDs13M\nLDUNhFrSb6et5Y/Dj85j0qMvzhW1cgcxMXNYLhwWCAX99sqBGhnLfF6rSSi7ZkbE\nAtTDwHqBLk/Es0ts512k1H6ReejLbsgGYDwiuZULXpfd4Iw9t6V22lQw6B1n9CLm\nNueTKkUM7jAN5LnF4fBCof3jpTB821taDog0Dla7DUGV1AdIyyJyLqk+8obDqXuC\niooGwUTrBUOTrWRNlP/Tw7W0Lv76duoqLQs2INUeKRfUJYei/+cy2fFkZZ8GKaHG\nZ2eoOQ0L9VumbeCzW8MOsO4QawIDAQABo4GWMIGTMA4GA1UdDwEB/wQEAwIDqDAT\nBgNVHSUEDDAKBggrBgEFBQcDAjAdBgNVHQ4EFgQUr+lCpfITlgJJoxuW6NBFoT1t\nqAcwHwYDVR0jBBgwFoAU4UukJy4iiDZUSB5DrcfOAr6spT8wLAYDVR0RBCUwI4Ih\ncGF5ZXJmc3AucWEucHJlLm15YW5tYXJwYXktcHJlLmlvMA0GCSqGSIb3DQEBCwUA\nA4ICAQCHEus15MfR1svIOgalbtmwJPDwBURaryWf2D9BkKV2Csdlzp0miRxkhgn9\nWZ+Cym0GiMfmo6FZv+OCXbakBYFycs2lfgZXt6r3Vt6zwZcW0l5/iYUHn8g+BKYO\n9CBJpBwRpn4rDXwUCbHWXF1tHCWMg3eooLN9I2Ly2DZvSPmgH8c08W2SE72nfVyi\nqa/zdD7u8g+XxXXJd7A1AZDTE+cQ29goTpIDQQVpw+a/a9yT9BEbiKtScUTounX0\nmu0uPpBSLgQ3lkXJEy46O7etWjXpSUW8HnKiEDloDmkmKGxFj9m5wtsIZVmu+kYP\nZQWBLgN6goyuxB/cIiAC8mqLgv8/+AcZ91jpCy3dZ6a/Nla3Xq+L046AnpOYHLJp\nizV/O0UQdV/pdPtn0D7Jci++rsKBMWovX1bHPxqxHsnxMYHaUap1DFU2LWKKYBl2\nZcOfNb2My2IXK/tqEegkJoEQx+gFGGjWeV4iw/cZZosIoM4ibubS1BF3I3er+0Fo\nT3uqZJuqBePdu6II6Vbg+i6v3P0KRUYRRs3yNm9VuuNHfcc+KQaHH4iYsPi5fk95\n+EIDBWtGUu9pxx8trc33v51t7dKyQqNH4qLrKywM9OybG/FZT2aCRRXtjuMgmaN+\nXfV5OYksS9Mj+JFtCNWmhWC8BLAtfdyLejLpofUDwrdfwFwZ0g==\n-----END CERTIFICATE-----", + "KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEAsCJqQwV2i8Asi349qUUbcYtx07IQ8Gp6ZbsXPbGmOSeQ/LN/\nuofGs5LDs13MLDUNhFrSb6et5Y/Dj85j0qMvzhW1cgcxMXNYLhwWCAX99sqBGhnL\nfF6rSSi7ZkbEAtTDwHqBLk/Es0ts512k1H6ReejLbsgGYDwiuZULXpfd4Iw9t6V2\n2lQw6B1n9CLmNueTKkUM7jAN5LnF4fBCof3jpTB821taDog0Dla7DUGV1AdIyyJy\nLqk+8obDqXuCiooGwUTrBUOTrWRNlP/Tw7W0Lv76duoqLQs2INUeKRfUJYei/+cy\n2fFkZZ8GKaHGZ2eoOQ0L9VumbeCzW8MOsO4QawIDAQABAoIBAQCfRy/y1cDjFfDy\nYEHgjccIggJ4XuGkl5WB45Nbzge0Tcx2SNhr1RbiEwl4bY0SORO1KfB82hSOsNg3\ndnuc4sd7RPRlXo2k21rVr75YmRqVj4D6GnOCT5XzvariDYJ50PAIYn/pYmdNgBrG\ni09gfeiOZu94idgCNL9uNZMngow53vddASgFH+fN4W3xWxXgexXRIxzhObvJGzux\nS2gCvePJ6n//lNIFcB1DR0ewpeLSwvmX6lZDg9IBoWbSCE/jlnAO7owzHphg8+IV\naONKIqeI0JAR1Fnmnh2t06ovVLYdx2eRo29Oqb6W//smHFfMBF22YF6Uq6HGuPQr\nSzHo6+hRAoGBAOTQf8V1qSW19WOMyDFCvvsUweGYlHJsU4dlZV7NaJAUh5n39W3x\nnJi7jZSDW/OUY/7wfGEI+k6WS7ICkZYD+an6Q7l6c4aKq6YkOCQmh2J/b+ZkAkzy\n7b3AyNG1r81fxnq1DMZC4htIDmtt2ru1fElPk8vxAgjagdtxk+v68gezAoGBAMUP\noMvtXa4qgEIk+aYv3S55P1xD4cdjYDtq1PKnkcKuzgj5QqRF3FnsWDKsNHfrD7IM\nFREFx0/iyLBVk1IrjrxHA0m3T0GrAvjpMVtyZDLa2oiKgSVLiBbTigmLebsBQSda\n2COs1IZ2mhgKM6Luyk42r5COL96BjsUHS+lpP3hpAoGBANFreuXw0IUxSox4d2mO\nm1kWIHUnvwYS20hapzLjcUYdZBapeTnNHvQzBFve9jOzpunYlR4Cp4VxzYn5C+Jv\ndPv7kCycREvpczy2faOol9SwqmwFMI3Y8XrwjVxSm7quY+w+9Jgo8uThSEFO5BlU\n+5HlgXHw/Vm5E40TIL2kigw9AoGAffd4fQMVoDCw3hdOsmnkREHjO7J00AT5TeID\nj72IEl+1es0DSYkSyzSmSHYF8CYFWXYZvVDpUGqSiQ2a56rKShZGxsdz1XFgrAY8\ns80SueNmUGPhHBsFOjotAd7ziJPLt0F96ogfLnkAFZ/n1B46mfahEZGijeRZhB8e\n6myJ0wkCgYEA1fMa/pwU2JdNvoAoCh18FWAKk/j7nmF8NPb3a9g7Eyo7Kd5CywdG\nIqDOla0gX1ZvidSj8ujJU/6NVRfjXsaOAWb/shMvFnQF5EZHt/0Om0AUufkqxXly\nJ4rTmFSt4UqDlcm6B1avenWIRVIhDZIH+q07L1OudmX+PDmWVJ0PnSw=\n-----END RSA PRIVATE KEY-----" + } + ], + "GITHUB_CONFIG": { + "TEST_CASES_REPO_OWNER": "mojaloop", + "TEST_CASES_REPO_NAME": "testing-toolkit-test-cases", + "TEST_CASES_REPO_DEFAULT_RELEASE_TAG": "latest", + "TEST_CASES_REPO_BASE_PATH": "collections/dfsp", + "TEST_CASES_REPO_HUB_GP_PATH": "collections/hub/golden_path", + "TEST_CASES_REPO_HUB_PROVISIONING_PATH": "collections/hub/provisioning" + }, + "DEFAULT_ENVIRONMENT_FILE_NAME": "hub_local_environment.json", + "LABELS": [ + { + "name": "p2p", + "description": "tests related to p2p transfer", + "color": "red" + }, + { + "name": "settlements", + "description": "tests related to settlements", + "color": "green" + }, + { + "name": "quotes", + "description": "tests related to quoting service", + "color": "blue" + } + ] +} diff --git a/on-premise-deploy/testing-toolkit/environments/environment.json b/on-premise-deploy/testing-toolkit/environments/environment.json index d9ec5ba..6d87ac8 100644 --- a/on-premise-deploy/testing-toolkit/environments/environment.json +++ b/on-premise-deploy/testing-toolkit/environments/environment.json @@ -1,51 +1,51 @@ -{ - "inputValues": { - "BASE_CENTRAL_LEDGER_ADMIN": "", - "CALLBACK_ENDPOINT_BASE_URL": "http://172.17.0.1:5000", - "HOST_ACCOUNT_LOOKUP_SERVICE": "http://account-lookup-service.local", - "HOST_CENTRAL_LEDGER": "http://central-ledger.local", - "HOST_CENTRAL_SETTLEMENT": "http://central-settlement.local/v1", - "HOST_ML_API_ADAPTER": "http://ml-api-adapter.local", - "HOST_QUOTING_SERVICE": "http://quoting-service.local", - "HOST_SIMULATOR": "http://moja-simulator.local", - "HOST_TRANSACTION_REQUESTS_SERVICE": "http://transaction-request-service.local", - "HUB_OPERATOR_BEARER_TOKEN": "NOT_APPLICABLE", - "accept": "application/vnd.interoperability.parties+json;version=1.0", - "acceptQuotes": "application/vnd.interoperability.quotes+json;version=1.0", - "acceptTransfers": "application/vnd.interoperability.transfers+json;version=1.0", - "amount": "100", - "condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks", - "contentTransfers": "application/vnd.interoperability.transfers+json;version=1.0", - "contentType": "application/vnd.interoperability.parties+json;version=1.0", - "contentTypeQuotes": "application/vnd.interoperability.quotes+json;version=1.0", - "currency": "USD", - "fromDOB": "1984-01-01", - "fromFirstName": "Firstname", - "fromFspId": "testingtoolkitdfsp", - "fromIdType": "MSISDN", - "fromIdValue": "44123456789", - "fromLastName": "Lastname", - "fromMiddleName": "Middlename", - "fspiopSignature": "{\"signature\":\"iU4GBXSfY8twZMj1zXX1CTe3LDO8Zvgui53icrriBxCUF_wltQmnjgWLWI4ZUEueVeOeTbDPBZazpBWYvBYpl5WJSUoXi14nVlangcsmu2vYkQUPmHtjOW-yb2ng6_aPfwd7oHLWrWzcsjTF-S4dW7GZRPHEbY_qCOhEwmmMOnE1FWF1OLvP0dM0r4y7FlnrZNhmuVIFhk_pMbEC44rtQmMFv4pm4EVGqmIm3eyXz0GkX8q_O1kGBoyIeV_P6RRcZ0nL6YUVMhPFSLJo6CIhL2zPm54Qdl2nVzDFWn_shVyV0Cl5vpcMJxJ--O_Zcbmpv6lxqDdygTC782Ob3CNMvg\\\",\\\"protectedHeader\\\":\\\"eyJhbGciOiJSUzI1NiIsIkZTUElPUC1VUkkiOiIvdHJhbnNmZXJzIiwiRlNQSU9QLUhUVFAtTWV0aG9kIjoiUE9TVCIsIkZTUElPUC1Tb3VyY2UiOiJPTUwiLCJGU1BJT1AtRGVzdGluYXRpb24iOiJNVE5Nb2JpbGVNb25leSIsIkRhdGUiOiIifQ\"}", - "homeTransactionId": "123ABC", - "hub_operator": "NOT_APPLICABLE", - "ilpPacket": "AQAAAAAAAADIEHByaXZhdGUucGF5ZWVmc3CCAiB7InRyYW5zYWN0aW9uSWQiOiIyZGY3NzRlMi1mMWRiLTRmZjctYTQ5NS0yZGRkMzdhZjdjMmMiLCJxdW90ZUlkIjoiMDNhNjA1NTAtNmYyZi00NTU2LThlMDQtMDcwM2UzOWI4N2ZmIiwicGF5ZWUiOnsicGFydHlJZEluZm8iOnsicGFydHlJZFR5cGUiOiJNU0lTRE4iLCJwYXJ0eUlkZW50aWZpZXIiOiIyNzcxMzgwMzkxMyIsImZzcElkIjoicGF5ZWVmc3AifSwicGVyc29uYWxJbmZvIjp7ImNvbXBsZXhOYW1lIjp7fX19LCJwYXllciI6eyJwYXJ0eUlkSW5mbyI6eyJwYXJ0eUlkVHlwZSI6Ik1TSVNETiIsInBhcnR5SWRlbnRpZmllciI6IjI3NzEzODAzOTExIiwiZnNwSWQiOiJwYXllcmZzcCJ9LCJwZXJzb25hbEluZm8iOnsiY29tcGxleE5hbWUiOnt9fX0sImFtb3VudCI6eyJjdXJyZW5jeSI6IlVTRCIsImFtb3VudCI6IjIwMCJ9LCJ0cmFuc2FjdGlvblR5cGUiOnsic2NlbmFyaW8iOiJERVBPU0lUIiwic3ViU2NlbmFyaW8iOiJERVBPU0lUIiwiaW5pdGlhdG9yIjoiUEFZRVIiLCJpbml0aWF0b3JUeXBlIjoiQ09OU1VNRVIiLCJyZWZ1bmRJbmZvIjp7fX19", - "invalidFulfillment": "_3cco-YN5OGpRKVWV3n6x6uNpBTH9tYUdOYmHA", - "note": "test", - "payeeIdType": "MSISDN", - "payeeIdentifier": "22556999125", - "payeefsp": "payeefsp", - "payerIdType": "MSISDN", - "payerIdentifier": "22507008181", - "payerfsp": "testingtoolkitdfsp", - "toFspId": "payeefsp", - "toIdType": "MSISDN", - "toIdValue": "27713803912", - "toDOB": "1970-01-01", - "toFirstName": "Payeefirst", - "toMiddleName": "Payeemiddle", - "toLastName": "Payeelast", - "validCondition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM", - "validFulfillment": "UNlJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA" - } -} +{ + "inputValues": { + "BASE_CENTRAL_LEDGER_ADMIN": "", + "CALLBACK_ENDPOINT_BASE_URL": "http://172.17.0.1:5000", + "HOST_ACCOUNT_LOOKUP_SERVICE": "http://account-lookup-service.local", + "HOST_CENTRAL_LEDGER": "http://central-ledger.local", + "HOST_CENTRAL_SETTLEMENT": "http://central-settlement.local/v1", + "HOST_ML_API_ADAPTER": "http://ml-api-adapter.local", + "HOST_QUOTING_SERVICE": "http://quoting-service.local", + "HOST_SIMULATOR": "http://moja-simulator.local", + "HOST_TRANSACTION_REQUESTS_SERVICE": "http://transaction-request-service.local", + "HUB_OPERATOR_BEARER_TOKEN": "NOT_APPLICABLE", + "accept": "application/vnd.interoperability.parties+json;version=1.0", + "acceptQuotes": "application/vnd.interoperability.quotes+json;version=1.0", + "acceptTransfers": "application/vnd.interoperability.transfers+json;version=1.0", + "amount": "100", + "condition": "HOr22-H3AfTDHrSkPjJtVPRdKouuMkDXTR4ejlQa8Ks", + "contentTransfers": "application/vnd.interoperability.transfers+json;version=1.0", + "contentType": "application/vnd.interoperability.parties+json;version=1.0", + "contentTypeQuotes": "application/vnd.interoperability.quotes+json;version=1.0", + "currency": "USD", + "fromDOB": "1984-01-01", + "fromFirstName": "Firstname", + "fromFspId": "testingtoolkitdfsp", + "fromIdType": "MSISDN", + "fromIdValue": "44123456789", + "fromLastName": "Lastname", + "fromMiddleName": "Middlename", + "fspiopSignature": "{\"signature\":\"iU4GBXSfY8twZMj1zXX1CTe3LDO8Zvgui53icrriBxCUF_wltQmnjgWLWI4ZUEueVeOeTbDPBZazpBWYvBYpl5WJSUoXi14nVlangcsmu2vYkQUPmHtjOW-yb2ng6_aPfwd7oHLWrWzcsjTF-S4dW7GZRPHEbY_qCOhEwmmMOnE1FWF1OLvP0dM0r4y7FlnrZNhmuVIFhk_pMbEC44rtQmMFv4pm4EVGqmIm3eyXz0GkX8q_O1kGBoyIeV_P6RRcZ0nL6YUVMhPFSLJo6CIhL2zPm54Qdl2nVzDFWn_shVyV0Cl5vpcMJxJ--O_Zcbmpv6lxqDdygTC782Ob3CNMvg\\\",\\\"protectedHeader\\\":\\\"eyJhbGciOiJSUzI1NiIsIkZTUElPUC1VUkkiOiIvdHJhbnNmZXJzIiwiRlNQSU9QLUhUVFAtTWV0aG9kIjoiUE9TVCIsIkZTUElPUC1Tb3VyY2UiOiJPTUwiLCJGU1BJT1AtRGVzdGluYXRpb24iOiJNVE5Nb2JpbGVNb25leSIsIkRhdGUiOiIifQ\"}", + "homeTransactionId": "123ABC", + "hub_operator": "NOT_APPLICABLE", + "ilpPacket": "AQAAAAAAAADIEHByaXZhdGUucGF5ZWVmc3CCAiB7InRyYW5zYWN0aW9uSWQiOiIyZGY3NzRlMi1mMWRiLTRmZjctYTQ5NS0yZGRkMzdhZjdjMmMiLCJxdW90ZUlkIjoiMDNhNjA1NTAtNmYyZi00NTU2LThlMDQtMDcwM2UzOWI4N2ZmIiwicGF5ZWUiOnsicGFydHlJZEluZm8iOnsicGFydHlJZFR5cGUiOiJNU0lTRE4iLCJwYXJ0eUlkZW50aWZpZXIiOiIyNzcxMzgwMzkxMyIsImZzcElkIjoicGF5ZWVmc3AifSwicGVyc29uYWxJbmZvIjp7ImNvbXBsZXhOYW1lIjp7fX19LCJwYXllciI6eyJwYXJ0eUlkSW5mbyI6eyJwYXJ0eUlkVHlwZSI6Ik1TSVNETiIsInBhcnR5SWRlbnRpZmllciI6IjI3NzEzODAzOTExIiwiZnNwSWQiOiJwYXllcmZzcCJ9LCJwZXJzb25hbEluZm8iOnsiY29tcGxleE5hbWUiOnt9fX0sImFtb3VudCI6eyJjdXJyZW5jeSI6IlVTRCIsImFtb3VudCI6IjIwMCJ9LCJ0cmFuc2FjdGlvblR5cGUiOnsic2NlbmFyaW8iOiJERVBPU0lUIiwic3ViU2NlbmFyaW8iOiJERVBPU0lUIiwiaW5pdGlhdG9yIjoiUEFZRVIiLCJpbml0aWF0b3JUeXBlIjoiQ09OU1VNRVIiLCJyZWZ1bmRJbmZvIjp7fX19", + "invalidFulfillment": "_3cco-YN5OGpRKVWV3n6x6uNpBTH9tYUdOYmHA", + "note": "test", + "payeeIdType": "MSISDN", + "payeeIdentifier": "22556999125", + "payeefsp": "payeefsp", + "payerIdType": "MSISDN", + "payerIdentifier": "22507008181", + "payerfsp": "testingtoolkitdfsp", + "toFspId": "payeefsp", + "toIdType": "MSISDN", + "toIdValue": "27713803912", + "toDOB": "1970-01-01", + "toFirstName": "Payeefirst", + "toMiddleName": "Payeemiddle", + "toLastName": "Payeelast", + "validCondition": "GRzLaTP7DJ9t4P-a_BA0WA9wzzlsugf00-Tn6kESAfM", + "validFulfillment": "UNlJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA" + } +} diff --git a/package.json b/package.json index 5b88bc9..be360a8 100644 --- a/package.json +++ b/package.json @@ -1,115 +1,115 @@ -{ - "name": "mojaloop-payment-manager-ui", - "version": "1.17.5", - "private": true, - "proxy": "http://localhost:10000", - "engines": { - "node": "=16.x" - }, - "dependencies": { - "@modusbox/modusbox-ui-components": "^1.23.0", - "@redux-saga/testing-utils": "^1.1.3", - "@testing-library/jest-dom": "^4.2.4", - "@testing-library/react": "^9.3.2", - "@testing-library/user-event": "^7.1.2", - "@types/classnames": "^2.2.10", - "@types/d3": "^5.7.2", - "@types/history": "^4.7.6", - "@types/jest": "^24.0.0", - "@types/lodash": "^4.14.157", - "@types/node": "^16.11.27", - "@types/react": "^16.9.0", - "@types/react-dom": "^16.9.0", - "@types/react-redux": "^7.1.9", - "@types/react-router-dom": "^5.1.5", - "@types/redux": "^3.6.0", - "@types/webpack-env": "^1.15.2", - "@typescript-eslint/eslint-plugin": "^3.4.0", - "apexcharts": "^3.22.0", - "axe-core": "^4.0.2", - "axios": "^0.19.2", - "classnames": "^2.2.6", - "color-scheme": "^1.0.1", - "connected-react-router": "^6.8.0", - "d3": "^5.16.0", - "eslint": "^7.3.1", - "eslint-config-airbnb": "^18.2.0", - "eslint-config-airbnb-typescript": "^8.0.2", - "eslint-config-prettier": "^6.11.0", - "eslint-config-react-app": "^5.2.1", - "eslint-import-resolver-typescript": "^2.0.0", - "eslint-loader": "^4.0.2", - "eslint-plugin-flowtype": "^5.1.3", - "eslint-plugin-import": "^2.21.2", - "eslint-plugin-jsx-a11y": "^6.3.1", - "eslint-plugin-prettier": "^3.1.4", - "eslint-plugin-react": "^7.20.0", - "eslint-plugin-react-hooks": "^4.0.4", - "framer-motion": "^1.11.1", - "history": "4.10.1", - "husky": "^4.2.5", - "lodash": "^4.17.19", - "moment": "^2.27.0", - "normalize.css": "^8.0.1", - "pondjs": "^0.9.0", - "prettier": "^2.0.5", - "prettier-eslint": "^11.0.0", - "prettier-eslint-cli": "^5.0.0", - "react": "^16.13.1", - "react-apexcharts": "^1.3.7", - "react-app-rewired": "^2.2.1", - "react-dom": "^16.13.1", - "react-redux": "^7.2.0", - "react-router-dom": "^5.2.0", - "react-scripts": "3.4.1", - "redux": "^4.0.5", - "redux-devtools-extension": "^2.13.8", - "redux-saga": "^1.1.3", - "reselect": "^4.0.0", - "sass": "^1.50.0", - "sass-loader": "^12.0.0", - "serve": "^11.3.2", - "svg-sprite-loader": "^5.0.0", - "typescript": "~3.7.2", - "xlsx": "^0.17.5" - }, - "scripts": { - "start": "react-app-rewired start", - "build": "react-app-rewired build", - "test": "react-app-rewired test", - "test:nowatch": "CI=true react-app-rewired test --env=jsdom", - "eject": "react-app-rewired eject", - "serve": "npm start --prefix server", - "lint": "eslint --ext .js,.jsx,.ts,.tsx src --color", - "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx src --color --fix", - "prettier": "prettier --write 'src/**/*.{ts,tsx,js,scss,css,json}'", - "proxy": "npm start --prefix proxy", - "release": "standard-version --releaseCommitMessageFormat 'chore(release): {{currentTag}} [skip ci]'", - "snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "redux-mock-store": "^1.5.4", - "standard-version": "^9.5.0" - }, - "husky": { - "hooks": { - "pre-commit": "yarn prettier && yarn lint", - "pre-push": "yarn test:nowatch" - } - } -} +{ + "name": "mojaloop-payment-manager-ui", + "version": "1.17.5", + "private": true, + "proxy": "http://localhost:10000", + "engines": { + "node": "=16.x" + }, + "dependencies": { + "@modusbox/modusbox-ui-components": "^1.23.0", + "@redux-saga/testing-utils": "^1.1.3", + "@testing-library/jest-dom": "^4.2.4", + "@testing-library/react": "^9.3.2", + "@testing-library/user-event": "^7.1.2", + "@types/classnames": "^2.2.10", + "@types/d3": "^5.7.2", + "@types/history": "^4.7.6", + "@types/jest": "^24.0.0", + "@types/lodash": "^4.14.157", + "@types/node": "^16.11.27", + "@types/react": "^16.9.0", + "@types/react-dom": "^16.9.0", + "@types/react-redux": "^7.1.9", + "@types/react-router-dom": "^5.1.5", + "@types/redux": "^3.6.0", + "@types/webpack-env": "^1.15.2", + "@typescript-eslint/eslint-plugin": "^3.4.0", + "apexcharts": "^3.22.0", + "axe-core": "^4.0.2", + "axios": "^0.19.2", + "classnames": "^2.2.6", + "color-scheme": "^1.0.1", + "connected-react-router": "^6.8.0", + "d3": "^5.16.0", + "eslint": "^7.3.1", + "eslint-config-airbnb": "^18.2.0", + "eslint-config-airbnb-typescript": "^8.0.2", + "eslint-config-prettier": "^6.11.0", + "eslint-config-react-app": "^5.2.1", + "eslint-import-resolver-typescript": "^2.0.0", + "eslint-loader": "^4.0.2", + "eslint-plugin-flowtype": "^5.1.3", + "eslint-plugin-import": "^2.21.2", + "eslint-plugin-jsx-a11y": "^6.3.1", + "eslint-plugin-prettier": "^3.1.4", + "eslint-plugin-react": "^7.20.0", + "eslint-plugin-react-hooks": "^4.0.4", + "framer-motion": "^1.11.1", + "history": "4.10.1", + "husky": "^4.2.5", + "lodash": "^4.17.19", + "moment": "^2.27.0", + "normalize.css": "^8.0.1", + "pondjs": "^0.9.0", + "prettier": "^2.0.5", + "prettier-eslint": "^11.0.0", + "prettier-eslint-cli": "^5.0.0", + "react": "^16.13.1", + "react-apexcharts": "^1.3.7", + "react-app-rewired": "^2.2.1", + "react-dom": "^16.13.1", + "react-redux": "^7.2.0", + "react-router-dom": "^5.2.0", + "react-scripts": "3.4.1", + "redux": "^4.0.5", + "redux-devtools-extension": "^2.13.8", + "redux-saga": "^1.1.3", + "reselect": "^4.0.0", + "sass": "^1.50.0", + "sass-loader": "^12.0.0", + "serve": "^11.3.2", + "svg-sprite-loader": "^5.0.0", + "typescript": "~3.7.2", + "xlsx": "^0.17.5" + }, + "scripts": { + "start": "react-app-rewired start", + "build": "react-app-rewired build", + "test": "react-app-rewired test", + "test:nowatch": "CI=true react-app-rewired test --env=jsdom", + "eject": "react-app-rewired eject", + "serve": "npm start --prefix server", + "lint": "eslint --ext .js,.jsx,.ts,.tsx src --color", + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx src --color --fix", + "prettier": "prettier --write 'src/**/*.{ts,tsx,js,scss,css,json}'", + "proxy": "npm start --prefix proxy", + "release": "standard-version --releaseCommitMessageFormat 'chore(release): {{currentTag}} [skip ci]'", + "snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'" + }, + "eslintConfig": { + "extends": "react-app" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "redux-mock-store": "^1.5.4", + "standard-version": "^9.5.0" + }, + "husky": { + "hooks": { + "pre-commit": "yarn prettier && yarn lint", + "pre-push": "yarn test:nowatch" + } + } +} diff --git a/proxy/index.js b/proxy/index.js index 648b7dc..061366d 100644 --- a/proxy/index.js +++ b/proxy/index.js @@ -1,19 +1,19 @@ -// eslint-disable-next-line -const proxy = require('http-proxy-middleware'); -const convert = require('koa-connect'); -const Koa = require('koa'); -const http = require('http'); - -const app = new Koa(); -app.use(convert(proxy.createProxyMiddleware('/', { - //target: 'https://pm4ml.dev.uncdf.uncdfmfi.org', // DEVELOPMENT - target: 'http://localhost:4000', // QA - pathRewrite: { - '^/api': '/', - }, - changeOrigin: true, - secure: false -}))); - - -http.createServer({}, app.callback()).listen(10000); +// eslint-disable-next-line +const proxy = require('http-proxy-middleware'); +const convert = require('koa-connect'); +const Koa = require('koa'); +const http = require('http'); + +const app = new Koa(); +app.use(convert(proxy.createProxyMiddleware('/', { + //target: 'https://pm4ml.dev.uncdf.uncdfmfi.org', // DEVELOPMENT + target: 'http://localhost:4000', // QA + pathRewrite: { + '^/api': '/', + }, + changeOrigin: true, + secure: false +}))); + + +http.createServer({}, app.callback()).listen(10000); diff --git a/proxy/index.js.old b/proxy/index.js.old index 648b7dc..061366d 100644 --- a/proxy/index.js.old +++ b/proxy/index.js.old @@ -1,19 +1,19 @@ -// eslint-disable-next-line -const proxy = require('http-proxy-middleware'); -const convert = require('koa-connect'); -const Koa = require('koa'); -const http = require('http'); - -const app = new Koa(); -app.use(convert(proxy.createProxyMiddleware('/', { - //target: 'https://pm4ml.dev.uncdf.uncdfmfi.org', // DEVELOPMENT - target: 'http://localhost:4000', // QA - pathRewrite: { - '^/api': '/', - }, - changeOrigin: true, - secure: false -}))); - - -http.createServer({}, app.callback()).listen(10000); +// eslint-disable-next-line +const proxy = require('http-proxy-middleware'); +const convert = require('koa-connect'); +const Koa = require('koa'); +const http = require('http'); + +const app = new Koa(); +app.use(convert(proxy.createProxyMiddleware('/', { + //target: 'https://pm4ml.dev.uncdf.uncdfmfi.org', // DEVELOPMENT + target: 'http://localhost:4000', // QA + pathRewrite: { + '^/api': '/', + }, + changeOrigin: true, + secure: false +}))); + + +http.createServer({}, app.callback()).listen(10000); diff --git a/proxy/package-lock.json b/proxy/package-lock.json index 788c722..7205ef0 100644 --- a/proxy/package-lock.json +++ b/proxy/package-lock.json @@ -1,1373 +1,1373 @@ -{ - "name": "server", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true - }, - "@szmarczak/http-timer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", - "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, - "requires": { - "defer-to-connect": "^1.0.1" - } - }, - "@types/http-proxy": { - "version": "1.17.4", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.4.tgz", - "integrity": "sha512-IrSHl2u6AWXduUaDLqYpt45tLVCtYv7o4Z0s1KghBCDgIIS9oW5K1H8mZG/A2CfeLdEa7rTd1ACOiHBc1EMT2Q==", - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "14.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.1.tgz", - "integrity": "sha512-aYNbO+FZ/3KGeQCEkNhHFRIzBOUgc7QvcVNKXbfnhDkSfwUv91JsQQa10rDgKSTSLkXZ1UIyPe4FJJNVgw1xWQ==" - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", - "dev": true, - "requires": { - "string-width": "^3.0.0" - }, - "dependencies": { - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - } - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true - }, - "boxen": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", - "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", - "dev": true, - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "cli-boxes": "^2.2.0", - "string-width": "^4.1.0", - "term-size": "^2.1.0", - "type-fest": "^0.8.1", - "widest-line": "^3.1.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "cache-content-type": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", - "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", - "requires": { - "mime-types": "^2.1.18", - "ylru": "^1.2.0" - } - }, - "cacheable-request": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", - "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, - "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "dependencies": { - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true - } - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - } - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true - }, - "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "configstore": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", - "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", - "dev": true, - "requires": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - } - }, - "connect-history-api-fallback": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", - "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==" - }, - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "requires": { - "safe-buffer": "5.1.2" - } - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "cookies": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", - "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", - "requires": { - "depd": "~2.0.0", - "keygrip": "~1.1.0" - }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } - } - }, - "crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, - "defer-to-connect": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "requires": { - "is-obj": "^2.0.0" - } - }, - "dotenv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", - "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "escape-goat": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "global-dirs": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", - "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", - "dev": true, - "requires": { - "ini": "^1.3.5" - } - }, - "got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "requires": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true - }, - "http-assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz", - "integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==", - "requires": { - "deep-equal": "~1.0.1", - "http-errors": "~1.7.2" - }, - "dependencies": { - "http-errors": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", - "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - } - } - } - }, - "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true - }, - "http-errors": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", - "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "dependencies": { - "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - } - } - }, - "http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - } - }, - "http-proxy-middleware": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.5.tgz", - "integrity": "sha512-CKzML7u4RdGob8wuKI//H8Ein6wNTEQR7yjVEzPbhBLGdOfkfvgTnp2HLnniKBDP9QW4eG10/724iTWLBeER3g==", - "requires": { - "@types/http-proxy": "^1.17.4", - "http-proxy": "^1.18.1", - "is-glob": "^4.0.1", - "lodash": "^4.17.19", - "micromatch": "^4.0.2" - } - }, - "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", - "dev": true - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-generator-function": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", - "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==" - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-installed-globally": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", - "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", - "dev": true, - "requires": { - "global-dirs": "^2.0.1", - "is-path-inside": "^3.0.1" - } - }, - "is-npm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", - "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", - "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, - "json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", - "dev": true - }, - "keygrip": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", - "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", - "requires": { - "tsscmp": "1.0.6" - } - }, - "keyv": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", - "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, - "requires": { - "json-buffer": "3.0.0" - } - }, - "koa": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/koa/-/koa-2.13.0.tgz", - "integrity": "sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ==", - "requires": { - "accepts": "^1.3.5", - "cache-content-type": "^1.0.0", - "content-disposition": "~0.5.2", - "content-type": "^1.0.4", - "cookies": "~0.8.0", - "debug": "~3.1.0", - "delegates": "^1.0.0", - "depd": "^1.1.2", - "destroy": "^1.0.4", - "encodeurl": "^1.0.2", - "escape-html": "^1.0.3", - "fresh": "~0.5.2", - "http-assert": "^1.3.0", - "http-errors": "^1.6.3", - "is-generator-function": "^1.0.7", - "koa-compose": "^4.1.0", - "koa-convert": "^1.2.0", - "on-finished": "^2.3.0", - "only": "~0.0.2", - "parseurl": "^1.3.2", - "statuses": "^1.5.0", - "type-is": "^1.6.16", - "vary": "^1.1.2" - } - }, - "koa-compose": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", - "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==" - }, - "koa-connect": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/koa-connect/-/koa-connect-2.1.0.tgz", - "integrity": "sha512-O9pcFafHk0oQsBevlbTBlB9co+2RUQJ4zCzu3qJPmGlGoeEZkne+7gWDkecqDPSbCtED6LmhlQladxs6NjOnMQ==" - }, - "koa-convert": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz", - "integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=", - "requires": { - "co": "^4.6.0", - "koa-compose": "^3.0.0" - }, - "dependencies": { - "koa-compose": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", - "integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=", - "requires": { - "any-promise": "^1.1.0" - } - } - } - }, - "latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, - "requires": { - "package-json": "^6.3.0" - } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "requires": { - "mime-db": "1.44.0" - } - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" - }, - "nodemon": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.5.tgz", - "integrity": "sha512-6/jqtZvJdk092pVnD2AIH19KQ9GQZAKOZVy/yT1ueL6aoV+Ix7a1lVZStXzvEh0fP4zE41DDWlkVoHjR6WlozA==", - "dev": true, - "requires": { - "chokidar": "^3.2.2", - "debug": "^3.2.6", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.0.4", - "pstree.remy": "^1.1.7", - "semver": "^5.7.1", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.3", - "update-notifier": "^4.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", - "dev": true - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "only": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", - "integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q=" - }, - "p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true - }, - "package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "requires": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" - }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true - }, - "pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pupa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", - "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==", - "dev": true, - "requires": { - "escape-goat": "^2.0.0" - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "registry-auth-token": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz", - "integrity": "sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w==", - "dev": true, - "requires": { - "rc": "^1.2.8" - } - }, - "registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, - "requires": { - "rc": "^1.2.8" - } - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" - }, - "responselike": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", - "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", - "dev": true, - "requires": { - "lowercase-keys": "^1.0.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, - "requires": { - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "term-size": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz", - "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==", - "dev": true - }, - "to-readable-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" - }, - "touch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", - "dev": true, - "requires": { - "nopt": "~1.0.10" - } - }, - "tsscmp": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", - "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==" - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "undefsafe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", - "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", - "dev": true, - "requires": { - "debug": "^2.2.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, - "requires": { - "crypto-random-string": "^2.0.0" - } - }, - "update-notifier": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", - "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", - "dev": true, - "requires": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.3.1", - "is-npm": "^4.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - } - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "dev": true, - "requires": { - "prepend-http": "^2.0.0" - } - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "requires": { - "string-width": "^4.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "xdg-basedir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true - }, - "ylru": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", - "integrity": "sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ==" - } - } -} +{ + "name": "server", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@types/http-proxy": { + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.4.tgz", + "integrity": "sha512-IrSHl2u6AWXduUaDLqYpt45tLVCtYv7o4Z0s1KghBCDgIIS9oW5K1H8mZG/A2CfeLdEa7rTd1ACOiHBc1EMT2Q==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.10.1.tgz", + "integrity": "sha512-aYNbO+FZ/3KGeQCEkNhHFRIzBOUgc7QvcVNKXbfnhDkSfwUv91JsQQa10rDgKSTSLkXZ1UIyPe4FJJNVgw1xWQ==" + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true + }, + "boxen": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", + "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "cli-boxes": "^2.2.0", + "string-width": "^4.1.0", + "term-size": "^2.1.0", + "type-fest": "^0.8.1", + "widest-line": "^3.1.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "cache-content-type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", + "requires": { + "mime-types": "^2.1.18", + "ylru": "^1.2.0" + } + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", + "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==" + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookies": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", + "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", + "requires": { + "depd": "~2.0.0", + "keygrip": "~1.1.0" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + } + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "follow-redirects": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", + "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-dirs": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", + "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", + "dev": true, + "requires": { + "ini": "^1.3.5" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true + }, + "http-assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz", + "integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==", + "requires": { + "deep-equal": "~1.0.1", + "http-errors": "~1.7.2" + }, + "dependencies": { + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + } + } + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "http-errors": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", + "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + } + } + }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-middleware": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.5.tgz", + "integrity": "sha512-CKzML7u4RdGob8wuKI//H8Ein6wNTEQR7yjVEzPbhBLGdOfkfvgTnp2HLnniKBDP9QW4eG10/724iTWLBeER3g==", + "requires": { + "@types/http-proxy": "^1.17.4", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.19", + "micromatch": "^4.0.2" + } + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-installed-globally": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", + "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", + "dev": true, + "requires": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + } + }, + "is-npm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", + "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "keygrip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", + "requires": { + "tsscmp": "1.0.6" + } + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "koa": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.13.0.tgz", + "integrity": "sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ==", + "requires": { + "accepts": "^1.3.5", + "cache-content-type": "^1.0.0", + "content-disposition": "~0.5.2", + "content-type": "^1.0.4", + "cookies": "~0.8.0", + "debug": "~3.1.0", + "delegates": "^1.0.0", + "depd": "^1.1.2", + "destroy": "^1.0.4", + "encodeurl": "^1.0.2", + "escape-html": "^1.0.3", + "fresh": "~0.5.2", + "http-assert": "^1.3.0", + "http-errors": "^1.6.3", + "is-generator-function": "^1.0.7", + "koa-compose": "^4.1.0", + "koa-convert": "^1.2.0", + "on-finished": "^2.3.0", + "only": "~0.0.2", + "parseurl": "^1.3.2", + "statuses": "^1.5.0", + "type-is": "^1.6.16", + "vary": "^1.1.2" + } + }, + "koa-compose": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==" + }, + "koa-connect": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/koa-connect/-/koa-connect-2.1.0.tgz", + "integrity": "sha512-O9pcFafHk0oQsBevlbTBlB9co+2RUQJ4zCzu3qJPmGlGoeEZkne+7gWDkecqDPSbCtED6LmhlQladxs6NjOnMQ==" + }, + "koa-convert": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz", + "integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=", + "requires": { + "co": "^4.6.0", + "koa-compose": "^3.0.0" + }, + "dependencies": { + "koa-compose": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", + "integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=", + "requires": { + "any-promise": "^1.1.0" + } + } + } + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, + "nodemon": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.5.tgz", + "integrity": "sha512-6/jqtZvJdk092pVnD2AIH19KQ9GQZAKOZVy/yT1ueL6aoV+Ix7a1lVZStXzvEh0fP4zE41DDWlkVoHjR6WlozA==", + "dev": true, + "requires": { + "chokidar": "^3.2.2", + "debug": "^3.2.6", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.7", + "semver": "^5.7.1", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.3", + "update-notifier": "^4.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "only": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q=" + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pupa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", + "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==", + "dev": true, + "requires": { + "escape-goat": "^2.0.0" + } + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "registry-auth-token": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz", + "integrity": "sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "term-size": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz", + "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==", + "dev": true + }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "requires": { + "nopt": "~1.0.10" + } + }, + "tsscmp": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==" + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "undefsafe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", + "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", + "dev": true, + "requires": { + "debug": "^2.2.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "update-notifier": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", + "dev": true, + "requires": { + "boxen": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "requires": { + "string-width": "^4.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true + }, + "ylru": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", + "integrity": "sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ==" + } + } +} diff --git a/proxy/package.json b/proxy/package.json index 0ea4cd7..6753cea 100644 --- a/proxy/package.json +++ b/proxy/package.json @@ -1,22 +1,22 @@ -{ - "name": "server", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "start": "nodemon index.js", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "connect-history-api-fallback": "^1.6.0", - "dotenv": "^8.2.0", - "http-proxy-middleware": "^1.0.5", - "koa": "^2.13.0", - "koa-connect": "^2.1.0" - }, - "devDependencies": { - "nodemon": "^2.0.5" - } -} +{ + "name": "server", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "nodemon index.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "connect-history-api-fallback": "^1.6.0", + "dotenv": "^8.2.0", + "http-proxy-middleware": "^1.0.5", + "koa": "^2.13.0", + "koa-connect": "^2.1.0" + }, + "devDependencies": { + "nodemon": "^2.0.5" + } +} diff --git a/proxy/yarn.lock b/proxy/yarn.lock index 260a4d0..1fd8ee0 100644 --- a/proxy/yarn.lock +++ b/proxy/yarn.lock @@ -1,1137 +1,1137 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== - -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== - dependencies: - defer-to-connect "^1.0.1" - -"@types/http-proxy@^1.17.4": - version "1.17.4" - resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.4.tgz#e7c92e3dbe3e13aa799440ff42e6d3a17a9d045b" - integrity sha512-IrSHl2u6AWXduUaDLqYpt45tLVCtYv7o4Z0s1KghBCDgIIS9oW5K1H8mZG/A2CfeLdEa7rTd1ACOiHBc1EMT2Q== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "14.14.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.6.tgz#146d3da57b3c636cc0d1769396ce1cfa8991147f" - integrity sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw== - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -accepts@^1.3.5: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -ansi-align@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" - integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== - dependencies: - string-width "^3.0.0" - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -any-promise@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - -anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -binary-extensions@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" - integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== - -boxen@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" - integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^5.3.1" - chalk "^3.0.0" - cli-boxes "^2.2.0" - string-width "^4.1.0" - term-size "^2.1.0" - type-fest "^0.8.1" - widest-line "^3.1.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.1, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -cache-content-type@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-content-type/-/cache-content-type-1.0.1.tgz#035cde2b08ee2129f4a8315ea8f00a00dba1453c" - integrity sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA== - dependencies: - mime-types "^2.1.18" - ylru "^1.2.0" - -cacheable-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chokidar@^3.2.2: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.5.0" - optionalDependencies: - fsevents "~2.1.2" - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cli-boxes@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" - integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -configstore@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" - integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== - dependencies: - dot-prop "^5.2.0" - graceful-fs "^4.1.2" - make-dir "^3.0.0" - unique-string "^2.0.0" - write-file-atomic "^3.0.0" - xdg-basedir "^4.0.0" - -connect-history-api-fallback@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" - integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== - -content-disposition@~0.5.2: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-type@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookies@~0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" - integrity sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow== - dependencies: - depd "~2.0.0" - keygrip "~1.1.0" - -crypto-random-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" - integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== - -debug@^2.2.0: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= - dependencies: - mimic-response "^1.0.0" - -deep-equal@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@^1.1.2, depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -depd@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -destroy@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -dot-prop@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" - integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== - dependencies: - is-obj "^2.0.0" - -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encodeurl@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -escape-goat@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" - integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== - -escape-html@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -eventemitter3@^4.0.0: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -follow-redirects@^1.0.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" - integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== - -fresh@~0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fsevents@~2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - -get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== - dependencies: - is-glob "^4.0.1" - -global-dirs@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.0.1.tgz#acdf3bb6685bcd55cb35e8a052266569e9469201" - integrity sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A== - dependencies: - ini "^1.3.5" - -got@^9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" - -graceful-fs@^4.1.2: - version "4.2.4" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-yarn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" - integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== - -http-assert@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.4.1.tgz#c5f725d677aa7e873ef736199b89686cceb37878" - integrity sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw== - dependencies: - deep-equal "~1.0.1" - http-errors "~1.7.2" - -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-errors@^1.6.3: - version "1.8.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" - integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-proxy-middleware@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-1.0.6.tgz#0618557722f450375d3796d701a8ac5407b3b94e" - integrity sha512-NyL6ZB6cVni7pl+/IT2W0ni5ME00xR0sN27AQZZrpKn1b+qRh+mLbBxIq9Cq1oGfmTc7BUq4HB77mxwCaxAYNg== - dependencies: - "@types/http-proxy" "^1.17.4" - http-proxy "^1.18.1" - is-glob "^4.0.1" - lodash "^4.17.20" - micromatch "^4.0.2" - -http-proxy@^1.18.1: - version "1.18.1" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" - integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== - dependencies: - eventemitter3 "^4.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -ignore-by-default@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" - integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= - -import-lazy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" - integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inherits@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@^1.3.5, ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-function@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.7.tgz#d2132e529bb0000a7f80794d4bdf5cd5e5813522" - integrity sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-installed-globally@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141" - integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== - dependencies: - global-dirs "^2.0.1" - is-path-inside "^3.0.1" - -is-npm@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" - integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" - integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== - -is-path-inside@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" - integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== - -is-typedarray@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -is-yarn-global@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" - integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== - -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= - -keygrip@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" - integrity sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ== - dependencies: - tsscmp "1.0.6" - -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== - dependencies: - json-buffer "3.0.0" - -koa-compose@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-3.2.1.tgz#a85ccb40b7d986d8e5a345b3a1ace8eabcf54de7" - integrity sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec= - dependencies: - any-promise "^1.1.0" - -koa-compose@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" - integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== - -koa-connect@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/koa-connect/-/koa-connect-2.1.0.tgz#16bce0a917c4cb24233aaac83fbc5b83804b4a1c" - integrity sha512-O9pcFafHk0oQsBevlbTBlB9co+2RUQJ4zCzu3qJPmGlGoeEZkne+7gWDkecqDPSbCtED6LmhlQladxs6NjOnMQ== - -koa-convert@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/koa-convert/-/koa-convert-1.2.0.tgz#da40875df49de0539098d1700b50820cebcd21d0" - integrity sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA= - dependencies: - co "^4.6.0" - koa-compose "^3.0.0" - -koa@^2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501" - integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ== - dependencies: - accepts "^1.3.5" - cache-content-type "^1.0.0" - content-disposition "~0.5.2" - content-type "^1.0.4" - cookies "~0.8.0" - debug "~3.1.0" - delegates "^1.0.0" - depd "^1.1.2" - destroy "^1.0.4" - encodeurl "^1.0.2" - escape-html "^1.0.3" - fresh "~0.5.2" - http-assert "^1.3.0" - http-errors "^1.6.3" - is-generator-function "^1.0.7" - koa-compose "^4.1.0" - koa-convert "^1.2.0" - on-finished "^2.3.0" - only "~0.0.2" - parseurl "^1.3.2" - statuses "^1.5.0" - type-is "^1.6.16" - vary "^1.1.2" - -latest-version@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" - integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== - dependencies: - package-json "^6.3.0" - -lodash@^4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== - dependencies: - braces "^3.0.1" - picomatch "^2.0.5" - -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@^2.1.18, mime-types@~2.1.24: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - -mimic-response@^1.0.0, mimic-response@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.0: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -nodemon@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.6.tgz#1abe1937b463aaf62f0d52e2b7eaadf28cc2240d" - integrity sha512-4I3YDSKXg6ltYpcnZeHompqac4E6JeAMpGm8tJnB9Y3T0ehasLa4139dJOcCrB93HHrUMsCrKtoAlXTqT5n4AQ== - dependencies: - chokidar "^3.2.2" - debug "^3.2.6" - ignore-by-default "^1.0.1" - minimatch "^3.0.4" - pstree.remy "^1.1.7" - semver "^5.7.1" - supports-color "^5.5.0" - touch "^3.1.0" - undefsafe "^2.0.3" - update-notifier "^4.1.0" - -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= - dependencies: - abbrev "1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-url@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" - integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== - -on-finished@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -only@~0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" - integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= - -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== - -package-json@^6.3.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" - integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== - dependencies: - got "^9.6.0" - registry-auth-token "^4.0.0" - registry-url "^5.0.0" - semver "^6.2.0" - -parseurl@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= - -pstree.remy@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" - integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pupa@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" - integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== - dependencies: - escape-goat "^2.0.0" - -rc@^1.2.8: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== - dependencies: - picomatch "^2.2.1" - -registry-auth-token@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.0.tgz#1d37dffda72bbecd0f581e4715540213a65eb7da" - integrity sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w== - dependencies: - rc "^1.2.8" - -registry-url@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" - integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== - dependencies: - rc "^1.2.8" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= - dependencies: - lowercase-keys "^1.0.0" - -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -semver-diff@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" - integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== - dependencies: - semver "^6.3.0" - -semver@^5.7.1: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -"statuses@>= 1.5.0 < 2", statuses@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string-width@^4.0.0, string-width@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" - -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -supports-color@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -term-size@^2.1.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" - integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== - -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -touch@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" - integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== - dependencies: - nopt "~1.0.10" - -tsscmp@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" - integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -type-is@^1.6.16: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -typedarray-to-buffer@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" - integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== - dependencies: - is-typedarray "^1.0.0" - -undefsafe@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae" - integrity sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A== - dependencies: - debug "^2.2.0" - -unique-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" - integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== - dependencies: - crypto-random-string "^2.0.0" - -update-notifier@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3" - integrity sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A== - dependencies: - boxen "^4.2.0" - chalk "^3.0.0" - configstore "^5.0.1" - has-yarn "^2.1.0" - import-lazy "^2.1.0" - is-ci "^2.0.0" - is-installed-globally "^0.3.1" - is-npm "^4.0.0" - is-yarn-global "^0.3.0" - latest-version "^5.0.0" - pupa "^2.0.1" - semver-diff "^3.1.1" - xdg-basedir "^4.0.0" - -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= - dependencies: - prepend-http "^2.0.0" - -vary@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -widest-line@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" - integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== - dependencies: - string-width "^4.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write-file-atomic@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" - integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== - dependencies: - imurmurhash "^0.1.4" - is-typedarray "^1.0.0" - signal-exit "^3.0.2" - typedarray-to-buffer "^3.1.5" - -xdg-basedir@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" - integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== - -ylru@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f" - integrity sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ== +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== + +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + +"@types/http-proxy@^1.17.4": + version "1.17.4" + resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.4.tgz#e7c92e3dbe3e13aa799440ff42e6d3a17a9d045b" + integrity sha512-IrSHl2u6AWXduUaDLqYpt45tLVCtYv7o4Z0s1KghBCDgIIS9oW5K1H8mZG/A2CfeLdEa7rTd1ACOiHBc1EMT2Q== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "14.14.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.6.tgz#146d3da57b3c636cc0d1769396ce1cfa8991147f" + integrity sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +accepts@^1.3.5: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +ansi-align@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb" + integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw== + dependencies: + string-width "^3.0.0" + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +any-promise@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + +anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +boxen@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" + integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^5.3.1" + chalk "^3.0.0" + cli-boxes "^2.2.0" + string-width "^4.1.0" + term-size "^2.1.0" + type-fest "^0.8.1" + widest-line "^3.1.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.1, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +cache-content-type@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-content-type/-/cache-content-type-1.0.1.tgz#035cde2b08ee2129f4a8315ea8f00a00dba1453c" + integrity sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA== + dependencies: + mime-types "^2.1.18" + ylru "^1.2.0" + +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@^3.2.2: + version "3.4.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.1.2" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cli-boxes@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + dependencies: + mimic-response "^1.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +configstore@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96" + integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA== + dependencies: + dot-prop "^5.2.0" + graceful-fs "^4.1.2" + make-dir "^3.0.0" + unique-string "^2.0.0" + write-file-atomic "^3.0.0" + xdg-basedir "^4.0.0" + +connect-history-api-fallback@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" + integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== + +content-disposition@~0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + +content-type@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookies@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" + integrity sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow== + dependencies: + depd "~2.0.0" + keygrip "~1.1.0" + +crypto-random-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" + integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== + +debug@^2.2.0: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + +deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +defer-to-connect@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" + integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +depd@^1.1.2, depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +depd@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +destroy@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + +dot-prop@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" + integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== + dependencies: + is-obj "^2.0.0" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +encodeurl@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +escape-goat@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" + integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== + +escape-html@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +eventemitter3@^4.0.0: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +follow-redirects@^1.0.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" + integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== + +fresh@~0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +global-dirs@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.0.1.tgz#acdf3bb6685bcd55cb35e8a052266569e9469201" + integrity sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A== + dependencies: + ini "^1.3.5" + +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +graceful-fs@^4.1.2: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-yarn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" + integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== + +http-assert@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.4.1.tgz#c5f725d677aa7e873ef736199b89686cceb37878" + integrity sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw== + dependencies: + deep-equal "~1.0.1" + http-errors "~1.7.2" + +http-cache-semantics@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + +http-errors@^1.6.3: + version "1.8.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" + integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-proxy-middleware@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-1.0.6.tgz#0618557722f450375d3796d701a8ac5407b3b94e" + integrity sha512-NyL6ZB6cVni7pl+/IT2W0ni5ME00xR0sN27AQZZrpKn1b+qRh+mLbBxIq9Cq1oGfmTc7BUq4HB77mxwCaxAYNg== + dependencies: + "@types/http-proxy" "^1.17.4" + http-proxy "^1.18.1" + is-glob "^4.0.1" + lodash "^4.17.20" + micromatch "^4.0.2" + +http-proxy@^1.18.1: + version "1.18.1" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" + integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== + dependencies: + eventemitter3 "^4.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +ignore-by-default@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" + integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk= + +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inherits@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^1.3.5, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-generator-function@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.7.tgz#d2132e529bb0000a7f80794d4bdf5cd5e5813522" + integrity sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-installed-globally@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141" + integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== + dependencies: + global-dirs "^2.0.1" + is-path-inside "^3.0.1" + +is-npm@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" + integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + +is-path-inside@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" + integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== + +is-typedarray@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-yarn-global@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" + integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + +keygrip@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" + integrity sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ== + dependencies: + tsscmp "1.0.6" + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== + dependencies: + json-buffer "3.0.0" + +koa-compose@^3.0.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-3.2.1.tgz#a85ccb40b7d986d8e5a345b3a1ace8eabcf54de7" + integrity sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec= + dependencies: + any-promise "^1.1.0" + +koa-compose@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" + integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== + +koa-connect@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/koa-connect/-/koa-connect-2.1.0.tgz#16bce0a917c4cb24233aaac83fbc5b83804b4a1c" + integrity sha512-O9pcFafHk0oQsBevlbTBlB9co+2RUQJ4zCzu3qJPmGlGoeEZkne+7gWDkecqDPSbCtED6LmhlQladxs6NjOnMQ== + +koa-convert@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/koa-convert/-/koa-convert-1.2.0.tgz#da40875df49de0539098d1700b50820cebcd21d0" + integrity sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA= + dependencies: + co "^4.6.0" + koa-compose "^3.0.0" + +koa@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501" + integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ== + dependencies: + accepts "^1.3.5" + cache-content-type "^1.0.0" + content-disposition "~0.5.2" + content-type "^1.0.4" + cookies "~0.8.0" + debug "~3.1.0" + delegates "^1.0.0" + depd "^1.1.2" + destroy "^1.0.4" + encodeurl "^1.0.2" + escape-html "^1.0.3" + fresh "~0.5.2" + http-assert "^1.3.0" + http-errors "^1.6.3" + is-generator-function "^1.0.7" + koa-compose "^4.1.0" + koa-convert "^1.2.0" + on-finished "^2.3.0" + only "~0.0.2" + parseurl "^1.3.2" + statuses "^1.5.0" + type-is "^1.6.16" + vary "^1.1.2" + +latest-version@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" + integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== + dependencies: + package-json "^6.3.0" + +lodash@^4.17.20: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + +mime-db@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== + +mime-types@^2.1.18, mime-types@~2.1.24: + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + dependencies: + mime-db "1.44.0" + +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + +nodemon@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.6.tgz#1abe1937b463aaf62f0d52e2b7eaadf28cc2240d" + integrity sha512-4I3YDSKXg6ltYpcnZeHompqac4E6JeAMpGm8tJnB9Y3T0ehasLa4139dJOcCrB93HHrUMsCrKtoAlXTqT5n4AQ== + dependencies: + chokidar "^3.2.2" + debug "^3.2.6" + ignore-by-default "^1.0.1" + minimatch "^3.0.4" + pstree.remy "^1.1.7" + semver "^5.7.1" + supports-color "^5.5.0" + touch "^3.1.0" + undefsafe "^2.0.3" + update-notifier "^4.1.0" + +nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= + dependencies: + abbrev "1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@^4.1.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" + integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== + +on-finished@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +only@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" + integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= + +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== + +package-json@^6.3.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" + integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== + dependencies: + got "^9.6.0" + registry-auth-token "^4.0.0" + registry-url "^5.0.0" + semver "^6.2.0" + +parseurl@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + +pstree.remy@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" + integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pupa@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" + integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== + dependencies: + escape-goat "^2.0.0" + +rc@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + dependencies: + picomatch "^2.2.1" + +registry-auth-token@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.0.tgz#1d37dffda72bbecd0f581e4715540213a65eb7da" + integrity sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w== + dependencies: + rc "^1.2.8" + +registry-url@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" + integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== + dependencies: + rc "^1.2.8" + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +semver-diff@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" + integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== + dependencies: + semver "^6.3.0" + +semver@^5.7.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +signal-exit@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + +"statuses@>= 1.5.0 < 2", statuses@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.0.0, string-width@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +term-size@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" + integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== + +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + +touch@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" + integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA== + dependencies: + nopt "~1.0.10" + +tsscmp@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" + integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== + +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + +type-is@^1.6.16: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +undefsafe@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae" + integrity sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A== + dependencies: + debug "^2.2.0" + +unique-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" + integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== + dependencies: + crypto-random-string "^2.0.0" + +update-notifier@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3" + integrity sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A== + dependencies: + boxen "^4.2.0" + chalk "^3.0.0" + configstore "^5.0.1" + has-yarn "^2.1.0" + import-lazy "^2.1.0" + is-ci "^2.0.0" + is-installed-globally "^0.3.1" + is-npm "^4.0.0" + is-yarn-global "^0.3.0" + latest-version "^5.0.0" + pupa "^2.0.1" + semver-diff "^3.1.1" + xdg-basedir "^4.0.0" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + +vary@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" + integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + +xdg-basedir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" + integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== + +ylru@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f" + integrity sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ== diff --git a/public/index.html b/public/index.html index f2a252f..d1e6c3b 100644 --- a/public/index.html +++ b/public/index.html @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - Payment Manager - - - -
- - - + + + + + + + + + + + + + + + + Payment Manager + + + +
+ + + diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..2f2be64 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,25 +1,25 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/public/robots.txt b/public/robots.txt index e9e57dc..9dd52a5 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,3 +1,3 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/server/.dockerignore b/server/.dockerignore index 2fa8c6b..39562d3 100644 --- a/server/.dockerignore +++ b/server/.dockerignore @@ -1,8 +1,8 @@ -/node_modules - -# misc -.DS_Store - -npm-debug.log* -yarn-debug.log* -yarn-error.log* +/node_modules + +# misc +.DS_Store + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/server/.gitignore b/server/.gitignore index 4d29575..c067634 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -1,23 +1,23 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/server/index.js b/server/index.js index c418f06..7d126cf 100644 --- a/server/index.js +++ b/server/index.js @@ -1,21 +1,21 @@ -const express = require('express'); -const path = require('path'); -const app = express(); - -app.use(express.static(path.join(__dirname, 'build'))); - -app.get('/config', function (req, res) { - res.send({ - API_BASE_URL: process.env.API_BASE_URL, - CHECK_SESSION_URL: process.env.CHECK_SESSION_URL, - LOGIN_URL: process.env.LOGIN_URL, - LOGIN_PROVIDER: process.env.LOGIN_PROVIDER, - LOGOUT_URL: process.env.LOGOUT_URL, - }); -}); - -app.get('/*', function (req, res) { - res.sendFile(path.join(__dirname, 'build', 'index.html')); -}); - +const express = require('express'); +const path = require('path'); +const app = express(); + +app.use(express.static(path.join(__dirname, 'build'))); + +app.get('/config', function (req, res) { + res.send({ + API_BASE_URL: process.env.API_BASE_URL, + CHECK_SESSION_URL: process.env.CHECK_SESSION_URL, + LOGIN_URL: process.env.LOGIN_URL, + LOGIN_PROVIDER: process.env.LOGIN_PROVIDER, + LOGOUT_URL: process.env.LOGOUT_URL, + }); +}); + +app.get('/*', function (req, res) { + res.sendFile(path.join(__dirname, 'build', 'index.html')); +}); + app.listen(8080); \ No newline at end of file diff --git a/server/package-lock.json b/server/package-lock.json index 18b2a0c..5a97ef5 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,372 +1,372 @@ -{ - "name": "connection_manager_server", - "version": "1.1.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" - } - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", - "requires": { - "bytes": "3.0.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "~1.6.3", - "iconv-lite": "0.4.23", - "on-finished": "~2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "~1.6.16" - } - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, - "express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", - "requires": { - "accepts": "~1.3.5", - "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", - "content-type": "~1.0.4", - "cookie": "0.3.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.1.1", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.4", - "qs": "6.5.2", - "range-parser": "~1.2.0", - "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - } - }, - "finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", - "unpipe": "~1.0.0" - } - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "ipaddr.js": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", - "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "requires": { - "mime-db": "1.40.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "proxy-addr": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", - "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.0" - } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "raw-body": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", - "unpipe": "1.0.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" - } - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" - } - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - }, - "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.18" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - } - } -} +{ + "name": "connection_manager_server", + "version": "1.1.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "requires": { + "mime-types": "~2.1.18", + "negotiator": "0.6.1" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "body-parser": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "~2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "express": { + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", + "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "requires": { + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.2", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ipaddr.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "proxy-addr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.0" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.18" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + } + } +} diff --git a/server/package.json b/server/package.json index 50e589e..0aac67c 100644 --- a/server/package.json +++ b/server/package.json @@ -1,24 +1,24 @@ -{ - "name": "payment_manager_server", - "version": "1.1.1", - "description": "Payment Manager web app server", - "main": "index.js", - "scripts": { - "start": "node index.js", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/modusintegration/tsp.git" - }, - "author": "", - "license": "ISC", - "bugs": { - "url": "https://github.com/modusintegration/tsp/issues" - }, - "homepage": "https://github.com/modusintegration/tsp#readme", - "dependencies": { - "cors": "^2.8.5", - "express": "^4.16.4" - } -} +{ + "name": "payment_manager_server", + "version": "1.1.1", + "description": "Payment Manager web app server", + "main": "index.js", + "scripts": { + "start": "node index.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/modusintegration/tsp.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/modusintegration/tsp/issues" + }, + "homepage": "https://github.com/modusintegration/tsp#readme", + "dependencies": { + "cors": "^2.8.5", + "express": "^4.16.4" + } +} diff --git a/server/yarn.lock b/server/yarn.lock index 3443280..6e19bad 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -1,402 +1,402 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/http-proxy@^1.17.4": - version "1.17.4" - resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.4.tgz#e7c92e3dbe3e13aa799440ff42e6d3a17a9d045b" - integrity sha512-IrSHl2u6AWXduUaDLqYpt45tLVCtYv7o4Z0s1KghBCDgIIS9oW5K1H8mZG/A2CfeLdEa7rTd1ACOiHBc1EMT2Q== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "14.11.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.2.tgz#2de1ed6670439387da1c9f549a2ade2b0a799256" - integrity sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA== - -accepts@^1.3.5: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -any-promise@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= - -braces@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -cache-content-type@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-content-type/-/cache-content-type-1.0.1.tgz#035cde2b08ee2129f4a8315ea8f00a00dba1453c" - integrity sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA== - dependencies: - mime-types "^2.1.18" - ylru "^1.2.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -connect-history-api-fallback@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" - integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== - -content-disposition@~0.5.2: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-type@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookies@~0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" - integrity sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow== - dependencies: - depd "~2.0.0" - keygrip "~1.1.0" - -debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -deep-equal@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - -depd@^1.1.2, depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -depd@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -destroy@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -encodeurl@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -escape-html@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -eventemitter3@^4.0.0: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -follow-redirects@^1.0.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" - integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== - -fresh@~0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -http-assert@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.4.1.tgz#c5f725d677aa7e873ef736199b89686cceb37878" - integrity sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw== - dependencies: - deep-equal "~1.0.1" - http-errors "~1.7.2" - -http-errors@^1.6.3: - version "1.8.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" - integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-proxy-middleware@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-1.0.5.tgz#4c6e25d95a411e3d750bc79ccf66290675176dc2" - integrity sha512-CKzML7u4RdGob8wuKI//H8Ein6wNTEQR7yjVEzPbhBLGdOfkfvgTnp2HLnniKBDP9QW4eG10/724iTWLBeER3g== - dependencies: - "@types/http-proxy" "^1.17.4" - http-proxy "^1.18.1" - is-glob "^4.0.1" - lodash "^4.17.19" - micromatch "^4.0.2" - -http-proxy@^1.18.1: - version "1.18.1" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" - integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== - dependencies: - eventemitter3 "^4.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -inherits@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-generator-function@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.7.tgz#d2132e529bb0000a7f80794d4bdf5cd5e5813522" - integrity sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw== - -is-glob@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -keygrip@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" - integrity sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ== - dependencies: - tsscmp "1.0.6" - -koa-compose@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-3.2.1.tgz#a85ccb40b7d986d8e5a345b3a1ace8eabcf54de7" - integrity sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec= - dependencies: - any-promise "^1.1.0" - -koa-compose@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" - integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== - -koa-connect@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/koa-connect/-/koa-connect-2.1.0.tgz#16bce0a917c4cb24233aaac83fbc5b83804b4a1c" - integrity sha512-O9pcFafHk0oQsBevlbTBlB9co+2RUQJ4zCzu3qJPmGlGoeEZkne+7gWDkecqDPSbCtED6LmhlQladxs6NjOnMQ== - -koa-convert@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/koa-convert/-/koa-convert-1.2.0.tgz#da40875df49de0539098d1700b50820cebcd21d0" - integrity sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA= - dependencies: - co "^4.6.0" - koa-compose "^3.0.0" - -koa@^2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501" - integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ== - dependencies: - accepts "^1.3.5" - cache-content-type "^1.0.0" - content-disposition "~0.5.2" - content-type "^1.0.4" - cookies "~0.8.0" - debug "~3.1.0" - delegates "^1.0.0" - depd "^1.1.2" - destroy "^1.0.4" - encodeurl "^1.0.2" - escape-html "^1.0.3" - fresh "~0.5.2" - http-assert "^1.3.0" - http-errors "^1.6.3" - is-generator-function "^1.0.7" - koa-compose "^4.1.0" - koa-convert "^1.2.0" - on-finished "^2.3.0" - only "~0.0.2" - parseurl "^1.3.2" - statuses "^1.5.0" - type-is "^1.6.16" - vary "^1.1.2" - -lodash@^4.17.19: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -micromatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" - integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== - dependencies: - braces "^3.0.1" - picomatch "^2.0.5" - -mime-db@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" - integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== - -mime-types@^2.1.18, mime-types@~2.1.24: - version "2.1.27" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" - integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== - dependencies: - mime-db "1.44.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -on-finished@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -only@~0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" - integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= - -parseurl@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -picomatch@^2.0.5: - version "2.2.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" - integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -"statuses@>= 1.5.0 < 2", statuses@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -tsscmp@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" - integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== - -type-is@^1.6.16: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -vary@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -ylru@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f" - integrity sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ== +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/http-proxy@^1.17.4": + version "1.17.4" + resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.4.tgz#e7c92e3dbe3e13aa799440ff42e6d3a17a9d045b" + integrity sha512-IrSHl2u6AWXduUaDLqYpt45tLVCtYv7o4Z0s1KghBCDgIIS9oW5K1H8mZG/A2CfeLdEa7rTd1ACOiHBc1EMT2Q== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "14.11.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.2.tgz#2de1ed6670439387da1c9f549a2ade2b0a799256" + integrity sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA== + +accepts@^1.3.5: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +any-promise@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +cache-content-type@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-content-type/-/cache-content-type-1.0.1.tgz#035cde2b08ee2129f4a8315ea8f00a00dba1453c" + integrity sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA== + dependencies: + mime-types "^2.1.18" + ylru "^1.2.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +connect-history-api-fallback@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" + integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== + +content-disposition@~0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + +content-type@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookies@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" + integrity sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow== + dependencies: + depd "~2.0.0" + keygrip "~1.1.0" + +debug@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +depd@^1.1.2, depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +depd@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +destroy@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +encodeurl@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + +escape-html@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +eventemitter3@^4.0.0: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +follow-redirects@^1.0.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" + integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== + +fresh@~0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +http-assert@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.4.1.tgz#c5f725d677aa7e873ef736199b89686cceb37878" + integrity sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw== + dependencies: + deep-equal "~1.0.1" + http-errors "~1.7.2" + +http-errors@^1.6.3: + version "1.8.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" + integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-proxy-middleware@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-1.0.5.tgz#4c6e25d95a411e3d750bc79ccf66290675176dc2" + integrity sha512-CKzML7u4RdGob8wuKI//H8Ein6wNTEQR7yjVEzPbhBLGdOfkfvgTnp2HLnniKBDP9QW4eG10/724iTWLBeER3g== + dependencies: + "@types/http-proxy" "^1.17.4" + http-proxy "^1.18.1" + is-glob "^4.0.1" + lodash "^4.17.19" + micromatch "^4.0.2" + +http-proxy@^1.18.1: + version "1.18.1" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" + integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== + dependencies: + eventemitter3 "^4.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +inherits@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-generator-function@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.7.tgz#d2132e529bb0000a7f80794d4bdf5cd5e5813522" + integrity sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw== + +is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +keygrip@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" + integrity sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ== + dependencies: + tsscmp "1.0.6" + +koa-compose@^3.0.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-3.2.1.tgz#a85ccb40b7d986d8e5a345b3a1ace8eabcf54de7" + integrity sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec= + dependencies: + any-promise "^1.1.0" + +koa-compose@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" + integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== + +koa-connect@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/koa-connect/-/koa-connect-2.1.0.tgz#16bce0a917c4cb24233aaac83fbc5b83804b4a1c" + integrity sha512-O9pcFafHk0oQsBevlbTBlB9co+2RUQJ4zCzu3qJPmGlGoeEZkne+7gWDkecqDPSbCtED6LmhlQladxs6NjOnMQ== + +koa-convert@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/koa-convert/-/koa-convert-1.2.0.tgz#da40875df49de0539098d1700b50820cebcd21d0" + integrity sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA= + dependencies: + co "^4.6.0" + koa-compose "^3.0.0" + +koa@^2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.0.tgz#25217e05efd3358a7e5ddec00f0a380c9b71b501" + integrity sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ== + dependencies: + accepts "^1.3.5" + cache-content-type "^1.0.0" + content-disposition "~0.5.2" + content-type "^1.0.4" + cookies "~0.8.0" + debug "~3.1.0" + delegates "^1.0.0" + depd "^1.1.2" + destroy "^1.0.4" + encodeurl "^1.0.2" + escape-html "^1.0.3" + fresh "~0.5.2" + http-assert "^1.3.0" + http-errors "^1.6.3" + is-generator-function "^1.0.7" + koa-compose "^4.1.0" + koa-convert "^1.2.0" + on-finished "^2.3.0" + only "~0.0.2" + parseurl "^1.3.2" + statuses "^1.5.0" + type-is "^1.6.16" + vary "^1.1.2" + +lodash@^4.17.19: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + +mime-db@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" + integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== + +mime-types@^2.1.18, mime-types@~2.1.24: + version "2.1.27" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" + integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== + dependencies: + mime-db "1.44.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + +on-finished@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + +only@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" + integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= + +parseurl@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +picomatch@^2.0.5: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +"statuses@>= 1.5.0 < 2", statuses@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + +tsscmp@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" + integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== + +type-is@^1.6.16: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +vary@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + +ylru@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f" + integrity sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ== diff --git a/src/App/App.css b/src/App/App.css index 91150a3..ad9b96a 100644 --- a/src/App/App.css +++ b/src/App/App.css @@ -1,39 +1,39 @@ -.App { - height: 100%; - width: 100%; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} +.App { + height: 100%; + width: 100%; +} + +.App-logo { + height: 40vmin; + pointer-events: none; +} + +@media (prefers-reduced-motion: no-preference) { + .App-logo { + animation: App-logo-spin infinite 20s linear; + } +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #61dafb; +} + +@keyframes App-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/src/App/App.test.tsx b/src/App/App.test.tsx index 4e838dc..c61a5b7 100644 --- a/src/App/App.test.tsx +++ b/src/App/App.test.tsx @@ -1,26 +1,26 @@ -import React from 'react'; -import { render } from 'test-utils'; -import App from './App'; - -// see https://github.com/apexcharts/react-apexcharts/issues/197 -// need to mock apexcharts until upstream fixes the issue - -// I added only the following two mocks. -jest.mock('react-apexcharts', () => - jest.fn(() => { - return null; - }) -); -jest.mock('apexcharts', () => ({ - exec: jest.fn(() => { - return new Promise((resolve, reject) => { - resolve('uri'); - }); - }), -})); - -test('renders the main menu', () => { - const { getByText } = render(); - const linkElement = getByText(/BUSINESS OPS/i); - expect(linkElement).toBeInTheDocument(); -}); +import React from 'react'; +import { render } from 'test-utils'; +import App from './App'; + +// see https://github.com/apexcharts/react-apexcharts/issues/197 +// need to mock apexcharts until upstream fixes the issue + +// I added only the following two mocks. +jest.mock('react-apexcharts', () => + jest.fn(() => { + return null; + }) +); +jest.mock('apexcharts', () => ({ + exec: jest.fn(() => { + return new Promise((resolve, reject) => { + resolve('uri'); + }); + }), +})); + +test('renders the main menu', () => { + const { getByText } = render(); + const linkElement = getByText(/BUSINESS OPS/i); + expect(linkElement).toBeInTheDocument(); +}); diff --git a/src/App/App.tsx b/src/App/App.tsx index 44fa80f..59aca7e 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -1,79 +1,79 @@ -import { Switch, Route, Redirect } from 'react-router-dom'; -import React, { FC } from 'react'; -import './App.css'; -import Layout from './Layout'; -import TechnicalDashboard from './TechnicalDashboard'; -import Transfers from './Transfers'; -import SuccessToast from './SuccessToast'; -import ErrorModal from './ErrorModal'; -import connectors from './connectors'; -import { User } from './types'; -import FxpTechnicalDashboard from './FxpTechnicalDashboard'; -import FxpTransfers from './FxpConversions'; -import FxpConversions from './FxpConversions'; - -interface AppProps { - isSuccessToastVisible: boolean; - isErrorModalVisible: boolean; - errorModalContent: string; - onCloseErrorModal: () => void; - userInfo?: User; - logoutUrl: string; -} - -const App: FC = ({ - isSuccessToastVisible, - isErrorModalVisible, - errorModalContent, - onCloseErrorModal, - userInfo, -}) => { - return ( -
- - - - - - - {/* - uncomment when dashboard uses real data and not mock - - */} - - - - - - {/* process.env.NODE_ENV === 'development' && */} - - - - - - - - - - - - - - -
- ); -}; - -export default connectors(App); +import { Switch, Route, Redirect } from 'react-router-dom'; +import React, { FC } from 'react'; +import './App.css'; +import Layout from './Layout'; +import TechnicalDashboard from './TechnicalDashboard'; +import Transfers from './Transfers'; +import SuccessToast from './SuccessToast'; +import ErrorModal from './ErrorModal'; +import connectors from './connectors'; +import { User } from './types'; +import FxpTechnicalDashboard from './FxpTechnicalDashboard'; +import FxpTransfers from './FxpConversions'; +import FxpConversions from './FxpConversions'; + +interface AppProps { + isSuccessToastVisible: boolean; + isErrorModalVisible: boolean; + errorModalContent: string; + onCloseErrorModal: () => void; + userInfo?: User; + logoutUrl: string; +} + +const App: FC = ({ + isSuccessToastVisible, + isErrorModalVisible, + errorModalContent, + onCloseErrorModal, + userInfo, +}) => { + return ( +
+ + + + + + + {/* + uncomment when dashboard uses real data and not mock + + */} + + + + + + {/* process.env.NODE_ENV === 'development' && */} + + + + + + + + + + + + + + +
+ ); +}; + +export default connectors(App); diff --git a/src/App/ConnectionWizard/ConnectionWizard.css b/src/App/ConnectionWizard/ConnectionWizard.css index 7416873..e0452ed 100644 --- a/src/App/ConnectionWizard/ConnectionWizard.css +++ b/src/App/ConnectionWizard/ConnectionWizard.css @@ -1,18 +1,18 @@ -.connection-wizard__loader { - height: 300px; - display: flex; - align-items: center; - justify-content: center; -} - -.connection-wizard__phases-header { - margin-bottom: 20px; -} - -.connection-wizard__phases__back-link { - margin-left: 40px; -} - -.connection-wizard__steps { - max-width: 150px; -} +.connection-wizard__loader { + height: 300px; + display: flex; + align-items: center; + justify-content: center; +} + +.connection-wizard__phases-header { + margin-bottom: 20px; +} + +.connection-wizard__phases__back-link { + margin-left: 40px; +} + +.connection-wizard__steps { + max-width: 150px; +} diff --git a/src/App/ConnectionWizard/ConnectionWizardRouter.tsx b/src/App/ConnectionWizard/ConnectionWizardRouter.tsx index 5e94316..1a169d4 100644 --- a/src/App/ConnectionWizard/ConnectionWizardRouter.tsx +++ b/src/App/ConnectionWizard/ConnectionWizardRouter.tsx @@ -1,123 +1,123 @@ -import { Switch, Route, Redirect, useRouteMatch } from 'react-router-dom'; -import React, { FC } from 'react'; -import { ErrorBox, Spinner } from 'components'; -import EnvironmentRouter from './Environment'; -import EnvironmentsOverview from './Environments'; -import loadEnvironmentsStatus from './Shared/hocs/loadEnvironmentsStatus'; -import loadEnvironmentStatus from './Shared/hocs/loadEnvironmentStatus'; -import { Environment, EnvironmentStatus } from './types'; -import connector from './connectors'; -import './ConnectionWizard.css'; - -const EnvironmentsOverviewWithStatus = loadEnvironmentsStatus(EnvironmentsOverview); -const EnvironmentRouterWithStatus = loadEnvironmentStatus(EnvironmentRouter); - -interface WizardRouterLoaderProps { - environments: Environment[]; - environmentsError: string | null; - isEnvironmentsStatusesPending: boolean; - environmentsStatuses: EnvironmentStatus[]; - environmentsStatusesError: string | null; -} - -const WizardRouterLoader: FC = ({ - environments, - environmentsError, - isEnvironmentsStatusesPending, - environmentsStatuses, - environmentsStatusesError, -}) => { - if (environmentsError) { - return Unable to load environments; - } - - if (!environments.length) { - return ( -
- -
- ); - } - return ( - - ); -}; - -interface WizardRouterProps { - environments: Environment[]; - isEnvironmentsStatusesPending: boolean; - environmentsStatuses: EnvironmentStatus[]; - environmentsStatusesError: string | null; -} - -const WizardRouter: FC = ({ - environments, - isEnvironmentsStatusesPending, - environmentsStatuses, - environmentsStatusesError, -}) => { - const match = useRouteMatch(); - - return ( - - - - - - - - - ); -}; - -interface EnvironmentsRouterProps { - environments: Environment[]; - isEnvironmentsStatusesPending: boolean; - environmentsStatuses: EnvironmentStatus[]; - environmentsStatusesError: string | null; -} - -const EnvironmentsRouter: FC = ({ - environments, - isEnvironmentsStatusesPending, - environmentsStatuses, - environmentsStatusesError, -}) => { - const environmentNames = environments.map((environment) => environment.name); - const match = useRouteMatch(); - return ( - - - - - - - - - ); -}; - -export default connector(WizardRouterLoader); +import { Switch, Route, Redirect, useRouteMatch } from 'react-router-dom'; +import React, { FC } from 'react'; +import { ErrorBox, Spinner } from 'components'; +import EnvironmentRouter from './Environment'; +import EnvironmentsOverview from './Environments'; +import loadEnvironmentsStatus from './Shared/hocs/loadEnvironmentsStatus'; +import loadEnvironmentStatus from './Shared/hocs/loadEnvironmentStatus'; +import { Environment, EnvironmentStatus } from './types'; +import connector from './connectors'; +import './ConnectionWizard.css'; + +const EnvironmentsOverviewWithStatus = loadEnvironmentsStatus(EnvironmentsOverview); +const EnvironmentRouterWithStatus = loadEnvironmentStatus(EnvironmentRouter); + +interface WizardRouterLoaderProps { + environments: Environment[]; + environmentsError: string | null; + isEnvironmentsStatusesPending: boolean; + environmentsStatuses: EnvironmentStatus[]; + environmentsStatusesError: string | null; +} + +const WizardRouterLoader: FC = ({ + environments, + environmentsError, + isEnvironmentsStatusesPending, + environmentsStatuses, + environmentsStatusesError, +}) => { + if (environmentsError) { + return Unable to load environments; + } + + if (!environments.length) { + return ( +
+ +
+ ); + } + return ( + + ); +}; + +interface WizardRouterProps { + environments: Environment[]; + isEnvironmentsStatusesPending: boolean; + environmentsStatuses: EnvironmentStatus[]; + environmentsStatusesError: string | null; +} + +const WizardRouter: FC = ({ + environments, + isEnvironmentsStatusesPending, + environmentsStatuses, + environmentsStatusesError, +}) => { + const match = useRouteMatch(); + + return ( + + + + + + + + + ); +}; + +interface EnvironmentsRouterProps { + environments: Environment[]; + isEnvironmentsStatusesPending: boolean; + environmentsStatuses: EnvironmentStatus[]; + environmentsStatusesError: string | null; +} + +const EnvironmentsRouter: FC = ({ + environments, + isEnvironmentsStatusesPending, + environmentsStatuses, + environmentsStatusesError, +}) => { + const environmentNames = environments.map((environment) => environment.name); + const match = useRouteMatch(); + return ( + + + + + + + + + ); +}; + +export default connector(WizardRouterLoader); diff --git a/src/App/ConnectionWizard/Environment/BusinessSetup/BusinessSetup.tsx b/src/App/ConnectionWizard/Environment/BusinessSetup/BusinessSetup.tsx index 235d070..b70f9c3 100644 --- a/src/App/ConnectionWizard/Environment/BusinessSetup/BusinessSetup.tsx +++ b/src/App/ConnectionWizard/Environment/BusinessSetup/BusinessSetup.tsx @@ -1,80 +1,80 @@ -import { Switch, Route, Redirect, useParams, useHistory, useRouteMatch } from 'react-router-dom'; -import React, { FC } from 'react'; -import { ProgressTabs, ProgressTab } from 'components'; -import { EnvironmentStep, EnvironmentStepIdentifiers } from '../../types'; -import * as helpers from '../../helpers'; -import DfspConfig from './DfspConfig'; - -const businessSetupSteps: string[] = ['idGeneration']; - -interface BusinessSetupRouterProps { - steps: EnvironmentStep[]; - isEnvironmentsStatusesPending: boolean; -} - -const BusinessSetupRouter: FC = ({ - steps, - isEnvironmentsStatusesPending, -}) => { - const match = useRouteMatch(); - return ( - - - - - - - - - ); -}; - -interface BusinessSetupParams { - step: string; -} - -interface BusinessSetupTabsProps { - steps: EnvironmentStep[]; - isEnvironmentsStatusesPending: boolean; -} - -const BusinessSetup: FC = ({ steps, isEnvironmentsStatusesPending }) => { - const params = useParams(); - const history = useHistory(); - - const stepTabIndex = businessSetupSteps.indexOf(params.step); - - function onBusinessSetupTabClick(index: number) { - history.push(businessSetupSteps[index]); - } - - const idGeneration = helpers.getStepStatus( - steps, - EnvironmentStepIdentifiers.IdGeneration, - isEnvironmentsStatusesPending - ); - - return ( - <> - - - - - <> - - - ); -}; - -export default BusinessSetupRouter; +import { Switch, Route, Redirect, useParams, useHistory, useRouteMatch } from 'react-router-dom'; +import React, { FC } from 'react'; +import { ProgressTabs, ProgressTab } from 'components'; +import { EnvironmentStep, EnvironmentStepIdentifiers } from '../../types'; +import * as helpers from '../../helpers'; +import DfspConfig from './DfspConfig'; + +const businessSetupSteps: string[] = ['idGeneration']; + +interface BusinessSetupRouterProps { + steps: EnvironmentStep[]; + isEnvironmentsStatusesPending: boolean; +} + +const BusinessSetupRouter: FC = ({ + steps, + isEnvironmentsStatusesPending, +}) => { + const match = useRouteMatch(); + return ( + + + + + + + + + ); +}; + +interface BusinessSetupParams { + step: string; +} + +interface BusinessSetupTabsProps { + steps: EnvironmentStep[]; + isEnvironmentsStatusesPending: boolean; +} + +const BusinessSetup: FC = ({ steps, isEnvironmentsStatusesPending }) => { + const params = useParams(); + const history = useHistory(); + + const stepTabIndex = businessSetupSteps.indexOf(params.step); + + function onBusinessSetupTabClick(index: number) { + history.push(businessSetupSteps[index]); + } + + const idGeneration = helpers.getStepStatus( + steps, + EnvironmentStepIdentifiers.IdGeneration, + isEnvironmentsStatusesPending + ); + + return ( + <> + + + + + <> + + + ); +}; + +export default BusinessSetupRouter; diff --git a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.css b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.css index d1f3e58..6e5070b 100644 --- a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.css +++ b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.css @@ -1,9 +1,9 @@ -.basic-dfsp-config__container { - margin: 30px; - width: 50%; -} - -.basic-dfsp-config__fields { - margin-top: 20px; - width: 400px; -} +.basic-dfsp-config__container { + margin: 30px; + width: 50%; +} + +.basic-dfsp-config__fields { + margin-top: 20px; + width: 400px; +} diff --git a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.tsx b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.tsx index bad0374..8a61a35 100644 --- a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.tsx +++ b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/DfspConfig.tsx @@ -1,72 +1,72 @@ -import React, { FC } from 'react'; -import { FormInput, Pill, ErrorBox } from 'components'; -import { connect } from 'react-redux'; -import { State } from 'store/types'; -import { ErrorMessage, ValidationResults } from 'App/types'; -import { DFSP } from 'App/ConnectionWizard/Environment/Main/types'; -import { getIsDfspReadPending } from 'App/ConnectionWizard/selectors'; -import * as selectors from './selectors'; -import './DfspConfig.css'; - -interface DfspConfigProps { - dfspConfig?: DFSP; - dfspConfigError: ErrorMessage; - dfspConfigValidationResult: ValidationResults; - isDfspReadPending: boolean; -} - -const stateProps = (state: State) => ({ - dfspConfig: selectors.getDfspConfig(state), - dfspConfigError: selectors.getDfspConfigError(state), - dfspConfigValidationResult: selectors.DfspModelValidationResult(state), - isDfspReadPending: getIsDfspReadPending(state), -}); - -const DfspConfig: FC = ({ - dfspConfig, - dfspConfigError, - dfspConfigValidationResult, - isDfspReadPending, -}) => { - if (dfspConfigError) { - return DfspConfig ID Generator: Unable to load data; - } - - return ( -
- - -
- -
- -
- -
-
- ); -}; - -export default connect(stateProps)(DfspConfig); +import React, { FC } from 'react'; +import { FormInput, Pill, ErrorBox } from 'components'; +import { connect } from 'react-redux'; +import { State } from 'store/types'; +import { ErrorMessage, ValidationResults } from 'App/types'; +import { DFSP } from 'App/ConnectionWizard/Environment/Main/types'; +import { getIsDfspReadPending } from 'App/ConnectionWizard/selectors'; +import * as selectors from './selectors'; +import './DfspConfig.css'; + +interface DfspConfigProps { + dfspConfig?: DFSP; + dfspConfigError: ErrorMessage; + dfspConfigValidationResult: ValidationResults; + isDfspReadPending: boolean; +} + +const stateProps = (state: State) => ({ + dfspConfig: selectors.getDfspConfig(state), + dfspConfigError: selectors.getDfspConfigError(state), + dfspConfigValidationResult: selectors.DfspModelValidationResult(state), + isDfspReadPending: getIsDfspReadPending(state), +}); + +const DfspConfig: FC = ({ + dfspConfig, + dfspConfigError, + dfspConfigValidationResult, + isDfspReadPending, +}) => { + if (dfspConfigError) { + return DfspConfig ID Generator: Unable to load data; + } + + return ( +
+ + +
+ +
+ +
+ +
+
+ ); +}; + +export default connect(stateProps)(DfspConfig); diff --git a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/index.ts b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/index.ts index 2106b75..2ee2269 100644 --- a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/index.ts +++ b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/index.ts @@ -1,5 +1,5 @@ -import DfspConfig from './DfspConfig'; -import * as selectors from './selectors'; - -export default DfspConfig; -export { selectors }; +import DfspConfig from './DfspConfig'; +import * as selectors from './selectors'; + +export default DfspConfig; +export { selectors }; diff --git a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/selectors.ts b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/selectors.ts index ef213fe..ddd61a8 100644 --- a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/selectors.ts +++ b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/selectors.ts @@ -1,18 +1,18 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { ValidationResults } from 'App/types'; -import { DFSP } from 'App/ConnectionWizard/Environment/Main/types'; - -import { toValidationResult } from '@modusbox/modusbox-ui-components/dist/redux-validation'; -import { getDfspConfigValidation } from './validators'; - -export const getDfspConfig = (state: State) => state.wizard.environment.main.dfsp; -export const getDfspConfigError = (state: State) => state.wizard.environment.main.dfspError; - -export const DfspModelValidationResult = createSelector< - State, - DFSP | undefined, - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ - any, - ValidationResults ->(getDfspConfig, getDfspConfigValidation, toValidationResult); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { ValidationResults } from 'App/types'; +import { DFSP } from 'App/ConnectionWizard/Environment/Main/types'; + +import { toValidationResult } from '@modusbox/modusbox-ui-components/dist/redux-validation'; +import { getDfspConfigValidation } from './validators'; + +export const getDfspConfig = (state: State) => state.wizard.environment.main.dfsp; +export const getDfspConfigError = (state: State) => state.wizard.environment.main.dfspError; + +export const DfspModelValidationResult = createSelector< + State, + DFSP | undefined, + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + any, + ValidationResults +>(getDfspConfig, getDfspConfigValidation, toValidationResult); diff --git a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/validators.ts b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/validators.ts index 3f26be5..3b20655 100644 --- a/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/validators.ts +++ b/src/App/ConnectionWizard/Environment/BusinessSetup/DfspConfig/validators.ts @@ -1,8 +1,8 @@ -import { createValidation, vd } from '@modusbox/modusbox-ui-components/dist/redux-validation'; - -const getDfspConfigValidation = () => ({ - id: createValidation([vd.isRequired]), - name: createValidation([vd.isRequired]), -}); - -export { getDfspConfigValidation }; +import { createValidation, vd } from '@modusbox/modusbox-ui-components/dist/redux-validation'; + +const getDfspConfigValidation = () => ({ + id: createValidation([vd.isRequired]), + name: createValidation([vd.isRequired]), +}); + +export { getDfspConfigValidation }; diff --git a/src/App/ConnectionWizard/Environment/BusinessSetup/index.tsx b/src/App/ConnectionWizard/Environment/BusinessSetup/index.tsx index 743f1d9..9b5d09b 100644 --- a/src/App/ConnectionWizard/Environment/BusinessSetup/index.tsx +++ b/src/App/ConnectionWizard/Environment/BusinessSetup/index.tsx @@ -1,3 +1,3 @@ -import BusinessSetup from './BusinessSetup'; - -export default BusinessSetup; +import BusinessSetup from './BusinessSetup'; + +export default BusinessSetup; diff --git a/src/App/ConnectionWizard/Environment/Main/actions.ts b/src/App/ConnectionWizard/Environment/Main/actions.ts index 76f6255..a510f2e 100644 --- a/src/App/ConnectionWizard/Environment/Main/actions.ts +++ b/src/App/ConnectionWizard/Environment/Main/actions.ts @@ -1,63 +1,63 @@ -import { ErrorMessage } from 'App/types'; -import { - REQUEST_ENVIRONMENT_DATA, - RequestEnvironmentDataAction, - REQUEST_DFSP, - SET_DFSP, - SET_DFSP_ERROR, - REQUEST_DFSPS, - SET_DFSPS, - SET_DFSPS_ERROR, - RequestDfspAction, - SetDfspAction, - SetDfspErrorAction, - RequestDfspsAction, - SetDfspsAction, - SetDfspsErrorAction, - DFSP, -} from './types'; - -export function requestEnvironmentData(): RequestEnvironmentDataAction { - return { - type: REQUEST_ENVIRONMENT_DATA, - }; -} - -export function requestDfsp(): RequestDfspAction { - return { - type: REQUEST_DFSP, - }; -} - -export function setDfsp({ data }: { data: DFSP }): SetDfspAction { - return { - type: SET_DFSP, - data, - }; -} -export function setDfspError({ error }: { error: ErrorMessage }): SetDfspErrorAction { - return { - type: SET_DFSP_ERROR, - error, - }; -} - -export function requestDfsps(): RequestDfspsAction { - return { - type: REQUEST_DFSPS, - }; -} - -export function setDfsps({ data }: { data: DFSP[] }): SetDfspsAction { - return { - type: SET_DFSPS, - data, - }; -} - -export function setDfspsError({ error }: { error: ErrorMessage }): SetDfspsErrorAction { - return { - type: SET_DFSPS_ERROR, - error, - }; -} +import { ErrorMessage } from 'App/types'; +import { + REQUEST_ENVIRONMENT_DATA, + RequestEnvironmentDataAction, + REQUEST_DFSP, + SET_DFSP, + SET_DFSP_ERROR, + REQUEST_DFSPS, + SET_DFSPS, + SET_DFSPS_ERROR, + RequestDfspAction, + SetDfspAction, + SetDfspErrorAction, + RequestDfspsAction, + SetDfspsAction, + SetDfspsErrorAction, + DFSP, +} from './types'; + +export function requestEnvironmentData(): RequestEnvironmentDataAction { + return { + type: REQUEST_ENVIRONMENT_DATA, + }; +} + +export function requestDfsp(): RequestDfspAction { + return { + type: REQUEST_DFSP, + }; +} + +export function setDfsp({ data }: { data: DFSP }): SetDfspAction { + return { + type: SET_DFSP, + data, + }; +} +export function setDfspError({ error }: { error: ErrorMessage }): SetDfspErrorAction { + return { + type: SET_DFSP_ERROR, + error, + }; +} + +export function requestDfsps(): RequestDfspsAction { + return { + type: REQUEST_DFSPS, + }; +} + +export function setDfsps({ data }: { data: DFSP[] }): SetDfspsAction { + return { + type: SET_DFSPS, + data, + }; +} + +export function setDfspsError({ error }: { error: ErrorMessage }): SetDfspsErrorAction { + return { + type: SET_DFSPS_ERROR, + error, + }; +} diff --git a/src/App/ConnectionWizard/Environment/Main/index.ts b/src/App/ConnectionWizard/Environment/Main/index.ts index 26a3a1e..8692f04 100644 --- a/src/App/ConnectionWizard/Environment/Main/index.ts +++ b/src/App/ConnectionWizard/Environment/Main/index.ts @@ -1,5 +1,5 @@ -import * as actions from './actions'; -import reducer from './reducers'; -import * as types from './types'; - -export { actions, reducer, types }; +import * as actions from './actions'; +import reducer from './reducers'; +import * as types from './types'; + +export { actions, reducer, types }; diff --git a/src/App/ConnectionWizard/Environment/Main/reducers.ts b/src/App/ConnectionWizard/Environment/Main/reducers.ts index ea5b939..46cdad6 100644 --- a/src/App/ConnectionWizard/Environment/Main/reducers.ts +++ b/src/App/ConnectionWizard/Environment/Main/reducers.ts @@ -1,80 +1,80 @@ -import { - REQUEST_ENVIRONMENT_DATA, - REQUEST_DFSP, - SET_DFSP, - SET_DFSP_ERROR, - REQUEST_DFSPS, - SET_DFSPS, - SET_DFSPS_ERROR, - MainActionTypes, - MainState, -} from './types'; - -const initialState = { - isDfspPending: false, - dfsp: undefined, - dfspError: null, - isDfspsPending: false, - dfsps: [], - dfspsError: null, -}; - -function reducer(state = initialState, action: MainActionTypes): MainState { - switch (action.type) { - case REQUEST_ENVIRONMENT_DATA: { - return initialState; - } - case REQUEST_DFSP: { - return { - ...state, - isDfspPending: true, - dfsp: initialState.dfsp, - dfspError: initialState.dfspError, - }; - } - case SET_DFSP: { - return { - ...state, - isDfspPending: false, - dfsp: action.data, - dfspError: initialState.dfspError, - }; - } - case SET_DFSP_ERROR: { - return { - ...state, - isDfspPending: false, - dfsp: initialState.dfsp, - dfspError: action.error, - }; - } - case REQUEST_DFSPS: { - return { - ...state, - isDfspsPending: true, - dfsps: initialState.dfsps, - dfspsError: initialState.dfspsError, - }; - } - case SET_DFSPS: { - return { - ...state, - isDfspsPending: false, - dfsps: action.data, - dfspsError: initialState.dfspsError, - }; - } - case SET_DFSPS_ERROR: { - return { - ...state, - isDfspsPending: false, - dfsps: initialState.dfsps, - dfspsError: action.error, - }; - } - default: - return state; - } -} - -export default reducer; +import { + REQUEST_ENVIRONMENT_DATA, + REQUEST_DFSP, + SET_DFSP, + SET_DFSP_ERROR, + REQUEST_DFSPS, + SET_DFSPS, + SET_DFSPS_ERROR, + MainActionTypes, + MainState, +} from './types'; + +const initialState = { + isDfspPending: false, + dfsp: undefined, + dfspError: null, + isDfspsPending: false, + dfsps: [], + dfspsError: null, +}; + +function reducer(state = initialState, action: MainActionTypes): MainState { + switch (action.type) { + case REQUEST_ENVIRONMENT_DATA: { + return initialState; + } + case REQUEST_DFSP: { + return { + ...state, + isDfspPending: true, + dfsp: initialState.dfsp, + dfspError: initialState.dfspError, + }; + } + case SET_DFSP: { + return { + ...state, + isDfspPending: false, + dfsp: action.data, + dfspError: initialState.dfspError, + }; + } + case SET_DFSP_ERROR: { + return { + ...state, + isDfspPending: false, + dfsp: initialState.dfsp, + dfspError: action.error, + }; + } + case REQUEST_DFSPS: { + return { + ...state, + isDfspsPending: true, + dfsps: initialState.dfsps, + dfspsError: initialState.dfspsError, + }; + } + case SET_DFSPS: { + return { + ...state, + isDfspsPending: false, + dfsps: action.data, + dfspsError: initialState.dfspsError, + }; + } + case SET_DFSPS_ERROR: { + return { + ...state, + isDfspsPending: false, + dfsps: initialState.dfsps, + dfspsError: action.error, + }; + } + default: + return state; + } +} + +export default reducer; diff --git a/src/App/ConnectionWizard/Environment/Main/sagas.ts b/src/App/ConnectionWizard/Environment/Main/sagas.ts index f47691f..7d9e63c 100644 --- a/src/App/ConnectionWizard/Environment/Main/sagas.ts +++ b/src/App/ConnectionWizard/Environment/Main/sagas.ts @@ -1,93 +1,93 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import { Action } from 'redux'; -import apis from 'utils/apis'; -import { is200 } from 'utils/http'; -import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { resetDFPCA } from '../TechnicalSetup/DFSPCertificateAuthority/actions'; -import { requestEgressEndpoints } from '../TechnicalSetup/Endpoints/Egress/actions'; -import { requestIngressEndpoints } from '../TechnicalSetup/Endpoints/Ingress/actions'; -import { resetHubEndpoints } from '../TechnicalSetup/Endpoints/Hub/actions'; -import { resetDfspJWS } from '../TechnicalSetup/JWSCertificates/DFSPJWS/actions'; -import { resetOtherDfspsJWS } from '../TechnicalSetup/JWSCertificates/OtherDFSPsJWS/actions'; -import { resetDfspCsr } from '../TechnicalSetup/TLS/TLSClient/CSR/actions'; -import { resetDfspHubCsrs } from '../TechnicalSetup/TLS/TLSClient/HubCSRs/actions'; -import { resetDfspSentCsrs } from '../TechnicalSetup/TLS/TLSClient/SentCSRs/actions'; -import { resetDfspSC } from '../TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/actions'; -import { resetDfspHubSC } from '../TechnicalSetup/TLS/TLSServerCertificates/HubSC/actions'; - -import { - REQUEST_ENVIRONMENT_DATA, - REQUEST_DFSP, - REQUEST_DFSPS, - RequestDfspAction, - RequestDfspsAction, -} from './types'; -import { setDfsp, setDfspError, setDfsps, setDfspsError } from './actions'; - -function* fetchDfsp(action: RequestDfspAction) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.dfsp.read, { environmentId }); - - if (is200(response.status)) { - yield put(setDfsp({ data: response.data })); - } else { - yield put(setDfspError({ error: 'Error Fetching DFSP' })); - } - } catch (e) { - yield put(setDfspError({ error: e.message })); - } -} - -export function* requestDfspSaga() { - yield takeLatest([REQUEST_DFSP], fetchDfsp); -} - -function* fetchDfsps(action: RequestDfspsAction) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.dfsps.read, { environmentId }); - - if (is200(response.status)) { - yield put(setDfsps({ data: response.data })); - } else { - yield put(setDfspsError({ error: 'Error Fetching DFSPs' })); - } - } catch (e) { - yield put(setDfspsError({ error: e.message })); - } -} - -export function* requestDfspsSaga() { - yield takeLatest([REQUEST_DFSPS], fetchDfsps); -} - -function* fetchEnvironmentData(action: Action) { - yield put(resetDFPCA()); - yield put(requestEgressEndpoints()); - yield put(requestIngressEndpoints()); - yield put(resetHubEndpoints()); - yield put(resetDfspJWS()); - yield put(resetOtherDfspsJWS()); - yield put(resetDfspCsr()); - yield put(resetDfspHubCsrs()); - yield put(resetDfspSentCsrs()); - yield put(resetDfspSC()); - yield put(resetDfspHubSC()); - /* eslint-disable */ - const environmentName = yield select(getEnvironmentName); - const environmentId = yield select(getEnvironmentId); - /* eslint-enable */ - - yield all([call(fetchDfsp, action), call(fetchDfsps, action)]); -} - -export function* requestEnvironmentSaga() { - yield takeLatest([REQUEST_ENVIRONMENT_DATA], fetchEnvironmentData); -} - -export default function* rootSaga() { - yield all([requestEnvironmentSaga()]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import { Action } from 'redux'; +import apis from 'utils/apis'; +import { is200 } from 'utils/http'; +import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { resetDFPCA } from '../TechnicalSetup/DFSPCertificateAuthority/actions'; +import { requestEgressEndpoints } from '../TechnicalSetup/Endpoints/Egress/actions'; +import { requestIngressEndpoints } from '../TechnicalSetup/Endpoints/Ingress/actions'; +import { resetHubEndpoints } from '../TechnicalSetup/Endpoints/Hub/actions'; +import { resetDfspJWS } from '../TechnicalSetup/JWSCertificates/DFSPJWS/actions'; +import { resetOtherDfspsJWS } from '../TechnicalSetup/JWSCertificates/OtherDFSPsJWS/actions'; +import { resetDfspCsr } from '../TechnicalSetup/TLS/TLSClient/CSR/actions'; +import { resetDfspHubCsrs } from '../TechnicalSetup/TLS/TLSClient/HubCSRs/actions'; +import { resetDfspSentCsrs } from '../TechnicalSetup/TLS/TLSClient/SentCSRs/actions'; +import { resetDfspSC } from '../TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/actions'; +import { resetDfspHubSC } from '../TechnicalSetup/TLS/TLSServerCertificates/HubSC/actions'; + +import { + REQUEST_ENVIRONMENT_DATA, + REQUEST_DFSP, + REQUEST_DFSPS, + RequestDfspAction, + RequestDfspsAction, +} from './types'; +import { setDfsp, setDfspError, setDfsps, setDfspsError } from './actions'; + +function* fetchDfsp(action: RequestDfspAction) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.dfsp.read, { environmentId }); + + if (is200(response.status)) { + yield put(setDfsp({ data: response.data })); + } else { + yield put(setDfspError({ error: 'Error Fetching DFSP' })); + } + } catch (e) { + yield put(setDfspError({ error: e.message })); + } +} + +export function* requestDfspSaga() { + yield takeLatest([REQUEST_DFSP], fetchDfsp); +} + +function* fetchDfsps(action: RequestDfspsAction) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.dfsps.read, { environmentId }); + + if (is200(response.status)) { + yield put(setDfsps({ data: response.data })); + } else { + yield put(setDfspsError({ error: 'Error Fetching DFSPs' })); + } + } catch (e) { + yield put(setDfspsError({ error: e.message })); + } +} + +export function* requestDfspsSaga() { + yield takeLatest([REQUEST_DFSPS], fetchDfsps); +} + +function* fetchEnvironmentData(action: Action) { + yield put(resetDFPCA()); + yield put(requestEgressEndpoints()); + yield put(requestIngressEndpoints()); + yield put(resetHubEndpoints()); + yield put(resetDfspJWS()); + yield put(resetOtherDfspsJWS()); + yield put(resetDfspCsr()); + yield put(resetDfspHubCsrs()); + yield put(resetDfspSentCsrs()); + yield put(resetDfspSC()); + yield put(resetDfspHubSC()); + /* eslint-disable */ + const environmentName = yield select(getEnvironmentName); + const environmentId = yield select(getEnvironmentId); + /* eslint-enable */ + + yield all([call(fetchDfsp, action), call(fetchDfsps, action)]); +} + +export function* requestEnvironmentSaga() { + yield takeLatest([REQUEST_ENVIRONMENT_DATA], fetchEnvironmentData); +} + +export default function* rootSaga() { + yield all([requestEnvironmentSaga()]); +} diff --git a/src/App/ConnectionWizard/Environment/Main/types.ts b/src/App/ConnectionWizard/Environment/Main/types.ts index ee23ee6..6fa9546 100644 --- a/src/App/ConnectionWizard/Environment/Main/types.ts +++ b/src/App/ConnectionWizard/Environment/Main/types.ts @@ -1,65 +1,65 @@ -import { ErrorMessage } from 'App/types'; - -export const REQUEST_ENVIRONMENT_DATA = 'Environment / Request Environment Data'; -export const REQUEST_DFSP = 'Environment / Request DFSP'; -export const SET_DFSP = 'Environment / Set DFSP'; -export const SET_DFSP_ERROR = 'Environment / Set DFSP Error'; -export const REQUEST_DFSPS = 'Environment / Request DFSPs'; -export const SET_DFSPS = 'Environment / Set DFSPs'; -export const SET_DFSPS_ERROR = 'Environment / Set DFSPs Error'; - -export interface RequestEnvironmentDataAction { - type: typeof REQUEST_ENVIRONMENT_DATA; -} - -export interface RequestDfspAction { - type: typeof REQUEST_DFSP; -} - -export interface SetDfspAction { - type: typeof SET_DFSP; - data: DFSP; -} - -export interface SetDfspErrorAction { - type: typeof SET_DFSP_ERROR; - error: ErrorMessage; -} - -export interface RequestDfspsAction { - type: typeof REQUEST_DFSPS; -} - -export interface SetDfspsAction { - type: typeof SET_DFSPS; - data: DFSP[]; -} - -export interface SetDfspsErrorAction { - type: typeof SET_DFSPS_ERROR; - error: ErrorMessage; -} - -export interface DFSP { - id: string; - name: string; - monetaryZoneId: string; -} - -export type MainActionTypes = - | RequestEnvironmentDataAction - | RequestDfspAction - | SetDfspAction - | SetDfspErrorAction - | RequestDfspsAction - | SetDfspsAction - | SetDfspsErrorAction; - -export interface MainState { - isDfspsPending: boolean; - dfsps: DFSP[]; - dfspError: ErrorMessage; - isDfspPending: boolean; - dfsp?: DFSP; - dfspsError: ErrorMessage; -} +import { ErrorMessage } from 'App/types'; + +export const REQUEST_ENVIRONMENT_DATA = 'Environment / Request Environment Data'; +export const REQUEST_DFSP = 'Environment / Request DFSP'; +export const SET_DFSP = 'Environment / Set DFSP'; +export const SET_DFSP_ERROR = 'Environment / Set DFSP Error'; +export const REQUEST_DFSPS = 'Environment / Request DFSPs'; +export const SET_DFSPS = 'Environment / Set DFSPs'; +export const SET_DFSPS_ERROR = 'Environment / Set DFSPs Error'; + +export interface RequestEnvironmentDataAction { + type: typeof REQUEST_ENVIRONMENT_DATA; +} + +export interface RequestDfspAction { + type: typeof REQUEST_DFSP; +} + +export interface SetDfspAction { + type: typeof SET_DFSP; + data: DFSP; +} + +export interface SetDfspErrorAction { + type: typeof SET_DFSP_ERROR; + error: ErrorMessage; +} + +export interface RequestDfspsAction { + type: typeof REQUEST_DFSPS; +} + +export interface SetDfspsAction { + type: typeof SET_DFSPS; + data: DFSP[]; +} + +export interface SetDfspsErrorAction { + type: typeof SET_DFSPS_ERROR; + error: ErrorMessage; +} + +export interface DFSP { + id: string; + name: string; + monetaryZoneId: string; +} + +export type MainActionTypes = + | RequestEnvironmentDataAction + | RequestDfspAction + | SetDfspAction + | SetDfspErrorAction + | RequestDfspsAction + | SetDfspsAction + | SetDfspsErrorAction; + +export interface MainState { + isDfspsPending: boolean; + dfsps: DFSP[]; + dfspError: ErrorMessage; + isDfspPending: boolean; + dfsp?: DFSP; + dfspsError: ErrorMessage; +} diff --git a/src/App/ConnectionWizard/Environment/Router.tsx b/src/App/ConnectionWizard/Environment/Router.tsx index 2f731cd..318c5ec 100644 --- a/src/App/ConnectionWizard/Environment/Router.tsx +++ b/src/App/ConnectionWizard/Environment/Router.tsx @@ -1,162 +1,162 @@ -import { Switch, Route, Redirect, useParams, useHistory, useRouteMatch } from 'react-router-dom'; -import React, { FC } from 'react'; -import { DataLabel, ProgressTabs, ProgressTab } from 'components'; -import { Environment, EnvironmentStatus, EnvironmentPhases } from '../types'; -import * as helpers from '../helpers'; -import loadEnvironment from './hocs/loadEnvironment'; -import BusinessSetup from './BusinessSetup'; -import TechnicalSetup from './TechnicalSetup'; - -const phases: string[] = helpers.environmentPhases.map( - (environmentPhase) => environmentPhase.param -); - -interface EnvironmentRouterProps { - environments: Environment[]; - isEnvironmentsStatusesPending: boolean; - environmentsStatuses: EnvironmentStatus[]; - environmentsStatusesError: string | null; -} - -interface EnvironmentRouterParams { - environment: string; -} - -const EnvironmentRouter: FC = ({ - environments, - isEnvironmentsStatusesPending, - environmentsStatuses, - environmentsStatusesError, -}) => { - const params = useParams(); - const match = useRouteMatch(); - const history = useHistory(); - const onPhaseClick = (url: string) => history.push(`${match.url}/${url}`); - - return ( - - - - - - - - - ); -}; - -interface EnvironmentPhasesTabsProps { - environmentName: string; - environments: Environment[]; - isEnvironmentsStatusesPending: boolean; - environmentsStatuses: EnvironmentStatus[]; - environmentsStatusesError: string | null; - onPhaseClick: (url: string) => void; -} - -interface PhaseParams { - phase: string; -} - -const EnvironmentPhasesTabs: FC = ({ - environmentName, - environments, - isEnvironmentsStatusesPending, - environmentsStatuses, - environmentsStatusesError, - onPhaseClick, -}) => { - const params = useParams(); - - function onPhaseTabClick(index: number) { - onPhaseClick(phases[index]); - } - - const phaseTabIndex = phases.indexOf(params.phase); - const currentEnvironment = environments.find( - (environment) => environment.name === environmentName - ); - - const currentEnvironmentPhases = helpers.getEnvironmentPhases( - environmentsStatuses, - currentEnvironment as Environment, - isEnvironmentsStatusesPending - ); - const businessSetupConfig = helpers.getPhaseConfig(EnvironmentPhases.BusinessSetup); - const technicalSetupConfig = helpers.getPhaseConfig(EnvironmentPhases.TechnicalSetup); - - const businessSetup = helpers.getPhaseStatus( - currentEnvironmentPhases, - EnvironmentPhases.BusinessSetup, - isEnvironmentsStatusesPending - ); - - const businessSetupSteps = helpers.getPhaseSteps( - currentEnvironmentPhases, - EnvironmentPhases.BusinessSetup, - isEnvironmentsStatusesPending - ); - - const technicalSetup = helpers.getPhaseStatus( - currentEnvironmentPhases, - EnvironmentPhases.TechnicalSetup, - isEnvironmentsStatusesPending - ); - - const technicalSetupSteps = helpers.getPhaseSteps( - currentEnvironmentPhases, - EnvironmentPhases.TechnicalSetup, - isEnvironmentsStatusesPending - ); - - return ( -
- - - - - - - - - -
- ); -}; - -export default loadEnvironment(EnvironmentRouter); +import { Switch, Route, Redirect, useParams, useHistory, useRouteMatch } from 'react-router-dom'; +import React, { FC } from 'react'; +import { DataLabel, ProgressTabs, ProgressTab } from 'components'; +import { Environment, EnvironmentStatus, EnvironmentPhases } from '../types'; +import * as helpers from '../helpers'; +import loadEnvironment from './hocs/loadEnvironment'; +import BusinessSetup from './BusinessSetup'; +import TechnicalSetup from './TechnicalSetup'; + +const phases: string[] = helpers.environmentPhases.map( + (environmentPhase) => environmentPhase.param +); + +interface EnvironmentRouterProps { + environments: Environment[]; + isEnvironmentsStatusesPending: boolean; + environmentsStatuses: EnvironmentStatus[]; + environmentsStatusesError: string | null; +} + +interface EnvironmentRouterParams { + environment: string; +} + +const EnvironmentRouter: FC = ({ + environments, + isEnvironmentsStatusesPending, + environmentsStatuses, + environmentsStatusesError, +}) => { + const params = useParams(); + const match = useRouteMatch(); + const history = useHistory(); + const onPhaseClick = (url: string) => history.push(`${match.url}/${url}`); + + return ( + + + + + + + + + ); +}; + +interface EnvironmentPhasesTabsProps { + environmentName: string; + environments: Environment[]; + isEnvironmentsStatusesPending: boolean; + environmentsStatuses: EnvironmentStatus[]; + environmentsStatusesError: string | null; + onPhaseClick: (url: string) => void; +} + +interface PhaseParams { + phase: string; +} + +const EnvironmentPhasesTabs: FC = ({ + environmentName, + environments, + isEnvironmentsStatusesPending, + environmentsStatuses, + environmentsStatusesError, + onPhaseClick, +}) => { + const params = useParams(); + + function onPhaseTabClick(index: number) { + onPhaseClick(phases[index]); + } + + const phaseTabIndex = phases.indexOf(params.phase); + const currentEnvironment = environments.find( + (environment) => environment.name === environmentName + ); + + const currentEnvironmentPhases = helpers.getEnvironmentPhases( + environmentsStatuses, + currentEnvironment as Environment, + isEnvironmentsStatusesPending + ); + const businessSetupConfig = helpers.getPhaseConfig(EnvironmentPhases.BusinessSetup); + const technicalSetupConfig = helpers.getPhaseConfig(EnvironmentPhases.TechnicalSetup); + + const businessSetup = helpers.getPhaseStatus( + currentEnvironmentPhases, + EnvironmentPhases.BusinessSetup, + isEnvironmentsStatusesPending + ); + + const businessSetupSteps = helpers.getPhaseSteps( + currentEnvironmentPhases, + EnvironmentPhases.BusinessSetup, + isEnvironmentsStatusesPending + ); + + const technicalSetup = helpers.getPhaseStatus( + currentEnvironmentPhases, + EnvironmentPhases.TechnicalSetup, + isEnvironmentsStatusesPending + ); + + const technicalSetupSteps = helpers.getPhaseSteps( + currentEnvironmentPhases, + EnvironmentPhases.TechnicalSetup, + isEnvironmentsStatusesPending + ); + + return ( +
+ + + + + + + + + +
+ ); +}; + +export default loadEnvironment(EnvironmentRouter); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.css index 59cc4b8..dfb7c5f 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.css @@ -1,47 +1,47 @@ -.dfsp-ca { - margin-top: 10px; -} - -.dfsp-ca__info-message { - display: inline-flex; - flex-direction: row; - align-items: center; - margin: 10px 0px; - background: #f8f8f8; - padding: 5px; - border-radius: 5px; -} - -.dfsp-ca__info-message__text { - margin-left: 5px; - font-size: 12px; - color: #333; -} - -.dfsp-ca__certificate-validation { - width: 400px; - margin: 10px 0px; -} - -.dfsp-ca__root-certificate { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; - margin-bottom: 20px; -} - -.dfsp-ca__intermediate-chain { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; - margin-bottom: 20px; -} - -.dfsp-ca__hub-certificate { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; -} +.dfsp-ca { + margin-top: 10px; +} + +.dfsp-ca__info-message { + display: inline-flex; + flex-direction: row; + align-items: center; + margin: 10px 0px; + background: #f8f8f8; + padding: 5px; + border-radius: 5px; +} + +.dfsp-ca__info-message__text { + margin-left: 5px; + font-size: 12px; + color: #333; +} + +.dfsp-ca__certificate-validation { + width: 400px; + margin: 10px 0px; +} + +.dfsp-ca__root-certificate { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; + margin-bottom: 20px; +} + +.dfsp-ca__intermediate-chain { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; + margin-bottom: 20px; +} + +.dfsp-ca__hub-certificate { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.tsx index 9bf6b96..8c77a67 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/DFSPCertificateAuthority.tsx @@ -1,280 +1,280 @@ -import React, { FC } from 'react'; -import { - CertificateModal, - CertificateValidation, - FileControls, - FormInput, - MessageBox, -} from 'components'; -import { State, Dispatch } from 'store/types'; -import { connect } from 'react-redux'; -import './DFSPCertificateAuthority.css'; -import { withMount } from 'utils/hocs'; -import { getDfspName } from 'App/ConnectionWizard/selectors'; -import { AnyAction } from 'redux'; -import { CertificateValidationResults } from 'App/types'; - -import { - DFSPCertificateAuthorityPayload, - ChangeAndSubmitDFSPCARootCertificateAction, - ShowDFSPCARootCertificateModalAction, - HideDFSPCARootCertificateModalAction, - ChangeAndSubmitDFSPCARootIntermediateChainAction, - ShowDFSPCAIntermediateChainModalAction, - HideDFSPCAIntermediateChainModalAction, - AutoGenerateDFSPCACertificateAction, - RequestDFSPCAHubCertificateModalAction, - ShowDFSPCAHubCertificateModalAction, - HideDFSPCAHubCertificateModalAction, -} from './types'; - -import { - changeAndSubmitDFSPCARootCertificate, - changeAndSubmitDFSPCARootIntermediateChain, - downloadDfspCaRootCertificate, - downloadDfspCaIntermediateChain, - hideDFSPCARootCertificateModal, - hideDFSPCAIntermediateChainModal, - showDFSPCARootCertificateModal, - showDFSPCAIntermediateChainModal, - autoGenerateDFSPCACertificate, - showDFSPCAHubCertificateModal, - downloadDfspCaHubCertificate, - hideDFSPCAHubCertificateModal, - requestDFSPCAHubCertificate, - requestDFPCA, -} from './actions'; - -import * as selectors from './selectors'; - -export interface DFSPCertificateAuthorityProps { - dfspName?: string; - error?: string; - isDfspCaPending: boolean; - rootCertificate?: string; - isRootCertificateModalVisible: boolean; - onRootCertificateChange: ( - cert: DFSPCertificateAuthorityPayload - ) => ChangeAndSubmitDFSPCARootCertificateAction; - onRootCertificateViewClick: () => ShowDFSPCARootCertificateModalAction; - onRootCertificateDownloadClick: () => AnyAction; - onRootCertificateModalCloseClick: () => HideDFSPCARootCertificateModalAction; - intermediateChain?: string; - isIntermediateChainModalVisible: boolean; - onIntermediateChainChange: ( - cert: DFSPCertificateAuthorityPayload - ) => ChangeAndSubmitDFSPCARootIntermediateChainAction; - onIntermediateChainViewClick: () => ShowDFSPCAIntermediateChainModalAction; - onIntermediateChainDownloadClick: () => AnyAction; - onIntermediateChainModalCloseClick: () => HideDFSPCAIntermediateChainModalAction; - validations: CertificateValidationResults[]; - validationState?: string; - isAutoGenerateCAEnabled: boolean; - isAutoGeneratePending: boolean; - onAutoGenerateCAClick: ( - cert: DFSPCertificateAuthorityPayload - ) => AutoGenerateDFSPCACertificateAction; - hubCertificate?: string; - isHubCertificateModalVisible: boolean; - isHubCertificatePending: boolean; - onHubCertificateChange: () => RequestDFSPCAHubCertificateModalAction; - onHubCertificateViewClick: () => ShowDFSPCAHubCertificateModalAction; - onHubCertificateDownloadClick: () => AnyAction; - onHubCertificateModalCloseClick: () => HideDFSPCAHubCertificateModalAction; -} - -const stateProps = (state: State) => ({ - dfspName: getDfspName(state), - error: selectors.getDfspCaError(state), - rootCertificate: selectors.getDfspCaRootCertificate(state), - intermediateChain: selectors.getDfspCaIntermediateChain(state), - validations: selectors.getDfspCaValidations(state), - validationState: selectors.getDfspCaValidationState(state), - isRootCertificateModalVisible: selectors.getIsDfspCaRootCertificateModalVisible(state), - isIntermediateChainModalVisible: selectors.getIsDfspCaIntermediateChainModalVisible(state), - isDfspCaPending: selectors.getIsDfspCaPending(state), - isAutoGenerateCAEnabled: selectors.getIsAutoGenerateCAEnabled(state), - isAutoGeneratePending: selectors.getisAutoGeneratePending(state), - isHubCertificateModalVisible: selectors.getIsDfspCaHubCertificateModalVisible(state), - hubCertificate: selectors.getDfspCaHubCertificate(state), - isHubCertificatePending: selectors.getisDfspCaHubCertificatePending(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(requestDFPCA()), - onRootCertificateChange: (certificate: string) => - dispatch(changeAndSubmitDFSPCARootCertificate({ certificate })), - onRootCertificateViewClick: () => dispatch(showDFSPCARootCertificateModal()), - onRootCertificateDownloadClick: () => dispatch(downloadDfspCaRootCertificate()), - onRootCertificateModalCloseClick: () => dispatch(hideDFSPCARootCertificateModal()), - onIntermediateChainChange: (certificate: string) => - dispatch(changeAndSubmitDFSPCARootIntermediateChain({ certificate })), - onIntermediateChainDownloadClick: () => dispatch(downloadDfspCaIntermediateChain()), - onIntermediateChainViewClick: () => dispatch(showDFSPCAIntermediateChainModal()), - onIntermediateChainModalCloseClick: () => dispatch(hideDFSPCAIntermediateChainModal()), - onAutoGenerateCAClick: (certificate: string) => - dispatch(autoGenerateDFSPCACertificate({ certificate })), - onHubCertificateChange: () => dispatch(requestDFSPCAHubCertificate()), - onHubCertificateViewClick: () => dispatch(showDFSPCAHubCertificateModal()), - onHubCertificateDownloadClick: () => dispatch(downloadDfspCaHubCertificate()), - onHubCertificateModalCloseClick: () => dispatch(hideDFSPCAHubCertificateModal()), -}); - -const DFSPCertificateAuthority: FC = ({ - dfspName, - error, - rootCertificate, - intermediateChain, - validations, - validationState, - isRootCertificateModalVisible, - isIntermediateChainModalVisible, - isDfspCaPending, - onRootCertificateChange, - onRootCertificateViewClick, - onRootCertificateDownloadClick, - onRootCertificateModalCloseClick, - onIntermediateChainChange, - onIntermediateChainViewClick, - onIntermediateChainDownloadClick, - onIntermediateChainModalCloseClick, - isAutoGenerateCAEnabled, - onAutoGenerateCAClick, - isAutoGeneratePending, - hubCertificate, - isHubCertificateModalVisible, - isHubCertificatePending, - onHubCertificateChange, - onHubCertificateViewClick, - onHubCertificateDownloadClick, - onHubCertificateModalCloseClick, -}) => { - if (error) { - return ( - - ); - } - - return ( -
- {/* To be enabled later */} - - {/*
- ); -}; - -const MountedDFSPCertificateAuthority = withMount(DFSPCertificateAuthority, 'onMount'); - -export default connect(stateProps, actionProps)(MountedDFSPCertificateAuthority); +import React, { FC } from 'react'; +import { + CertificateModal, + CertificateValidation, + FileControls, + FormInput, + MessageBox, +} from 'components'; +import { State, Dispatch } from 'store/types'; +import { connect } from 'react-redux'; +import './DFSPCertificateAuthority.css'; +import { withMount } from 'utils/hocs'; +import { getDfspName } from 'App/ConnectionWizard/selectors'; +import { AnyAction } from 'redux'; +import { CertificateValidationResults } from 'App/types'; + +import { + DFSPCertificateAuthorityPayload, + ChangeAndSubmitDFSPCARootCertificateAction, + ShowDFSPCARootCertificateModalAction, + HideDFSPCARootCertificateModalAction, + ChangeAndSubmitDFSPCARootIntermediateChainAction, + ShowDFSPCAIntermediateChainModalAction, + HideDFSPCAIntermediateChainModalAction, + AutoGenerateDFSPCACertificateAction, + RequestDFSPCAHubCertificateModalAction, + ShowDFSPCAHubCertificateModalAction, + HideDFSPCAHubCertificateModalAction, +} from './types'; + +import { + changeAndSubmitDFSPCARootCertificate, + changeAndSubmitDFSPCARootIntermediateChain, + downloadDfspCaRootCertificate, + downloadDfspCaIntermediateChain, + hideDFSPCARootCertificateModal, + hideDFSPCAIntermediateChainModal, + showDFSPCARootCertificateModal, + showDFSPCAIntermediateChainModal, + autoGenerateDFSPCACertificate, + showDFSPCAHubCertificateModal, + downloadDfspCaHubCertificate, + hideDFSPCAHubCertificateModal, + requestDFSPCAHubCertificate, + requestDFPCA, +} from './actions'; + +import * as selectors from './selectors'; + +export interface DFSPCertificateAuthorityProps { + dfspName?: string; + error?: string; + isDfspCaPending: boolean; + rootCertificate?: string; + isRootCertificateModalVisible: boolean; + onRootCertificateChange: ( + cert: DFSPCertificateAuthorityPayload + ) => ChangeAndSubmitDFSPCARootCertificateAction; + onRootCertificateViewClick: () => ShowDFSPCARootCertificateModalAction; + onRootCertificateDownloadClick: () => AnyAction; + onRootCertificateModalCloseClick: () => HideDFSPCARootCertificateModalAction; + intermediateChain?: string; + isIntermediateChainModalVisible: boolean; + onIntermediateChainChange: ( + cert: DFSPCertificateAuthorityPayload + ) => ChangeAndSubmitDFSPCARootIntermediateChainAction; + onIntermediateChainViewClick: () => ShowDFSPCAIntermediateChainModalAction; + onIntermediateChainDownloadClick: () => AnyAction; + onIntermediateChainModalCloseClick: () => HideDFSPCAIntermediateChainModalAction; + validations: CertificateValidationResults[]; + validationState?: string; + isAutoGenerateCAEnabled: boolean; + isAutoGeneratePending: boolean; + onAutoGenerateCAClick: ( + cert: DFSPCertificateAuthorityPayload + ) => AutoGenerateDFSPCACertificateAction; + hubCertificate?: string; + isHubCertificateModalVisible: boolean; + isHubCertificatePending: boolean; + onHubCertificateChange: () => RequestDFSPCAHubCertificateModalAction; + onHubCertificateViewClick: () => ShowDFSPCAHubCertificateModalAction; + onHubCertificateDownloadClick: () => AnyAction; + onHubCertificateModalCloseClick: () => HideDFSPCAHubCertificateModalAction; +} + +const stateProps = (state: State) => ({ + dfspName: getDfspName(state), + error: selectors.getDfspCaError(state), + rootCertificate: selectors.getDfspCaRootCertificate(state), + intermediateChain: selectors.getDfspCaIntermediateChain(state), + validations: selectors.getDfspCaValidations(state), + validationState: selectors.getDfspCaValidationState(state), + isRootCertificateModalVisible: selectors.getIsDfspCaRootCertificateModalVisible(state), + isIntermediateChainModalVisible: selectors.getIsDfspCaIntermediateChainModalVisible(state), + isDfspCaPending: selectors.getIsDfspCaPending(state), + isAutoGenerateCAEnabled: selectors.getIsAutoGenerateCAEnabled(state), + isAutoGeneratePending: selectors.getisAutoGeneratePending(state), + isHubCertificateModalVisible: selectors.getIsDfspCaHubCertificateModalVisible(state), + hubCertificate: selectors.getDfspCaHubCertificate(state), + isHubCertificatePending: selectors.getisDfspCaHubCertificatePending(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(requestDFPCA()), + onRootCertificateChange: (certificate: string) => + dispatch(changeAndSubmitDFSPCARootCertificate({ certificate })), + onRootCertificateViewClick: () => dispatch(showDFSPCARootCertificateModal()), + onRootCertificateDownloadClick: () => dispatch(downloadDfspCaRootCertificate()), + onRootCertificateModalCloseClick: () => dispatch(hideDFSPCARootCertificateModal()), + onIntermediateChainChange: (certificate: string) => + dispatch(changeAndSubmitDFSPCARootIntermediateChain({ certificate })), + onIntermediateChainDownloadClick: () => dispatch(downloadDfspCaIntermediateChain()), + onIntermediateChainViewClick: () => dispatch(showDFSPCAIntermediateChainModal()), + onIntermediateChainModalCloseClick: () => dispatch(hideDFSPCAIntermediateChainModal()), + onAutoGenerateCAClick: (certificate: string) => + dispatch(autoGenerateDFSPCACertificate({ certificate })), + onHubCertificateChange: () => dispatch(requestDFSPCAHubCertificate()), + onHubCertificateViewClick: () => dispatch(showDFSPCAHubCertificateModal()), + onHubCertificateDownloadClick: () => dispatch(downloadDfspCaHubCertificate()), + onHubCertificateModalCloseClick: () => dispatch(hideDFSPCAHubCertificateModal()), +}); + +const DFSPCertificateAuthority: FC = ({ + dfspName, + error, + rootCertificate, + intermediateChain, + validations, + validationState, + isRootCertificateModalVisible, + isIntermediateChainModalVisible, + isDfspCaPending, + onRootCertificateChange, + onRootCertificateViewClick, + onRootCertificateDownloadClick, + onRootCertificateModalCloseClick, + onIntermediateChainChange, + onIntermediateChainViewClick, + onIntermediateChainDownloadClick, + onIntermediateChainModalCloseClick, + isAutoGenerateCAEnabled, + onAutoGenerateCAClick, + isAutoGeneratePending, + hubCertificate, + isHubCertificateModalVisible, + isHubCertificatePending, + onHubCertificateChange, + onHubCertificateViewClick, + onHubCertificateDownloadClick, + onHubCertificateModalCloseClick, +}) => { + if (error) { + return ( + + ); + } + + return ( +
+ {/* To be enabled later */} + + {/*
+ ); +}; + +const MountedDFSPCertificateAuthority = withMount(DFSPCertificateAuthority, 'onMount'); + +export default connect(stateProps, actionProps)(MountedDFSPCertificateAuthority); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/_mockData.js index ef0576f..5a0098f 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/_mockData.js @@ -1,20 +1,20 @@ -export const dfspCaHubCertMock = - '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhjxSZnE0qnsHhfTuvcqdFuhOWKU4Z0BqYBvQ3lBetoxi6PrABDJXWKTUgNX31EGDk-----END CERTIFICATE-----'; - -const Validation = { - validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', - performed: true, - result: 'VALID', - message: 'Validation Test Message', - messageTemplate: - 'Textual description of the validation result, using the JavaScript template literal format', - data: {}, - details: 'Test Details', -}; - -export const dfspCertificateMock = { - rootCertificate: 'Test Root Certificate', - intermediateChain: 'Test Root Certificate', - validations: [Validation], - validationState: 'VALID', -}; +export const dfspCaHubCertMock = + '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhjxSZnE0qnsHhfTuvcqdFuhOWKU4Z0BqYBvQ3lBetoxi6PrABDJXWKTUgNX31EGDk-----END CERTIFICATE-----'; + +const Validation = { + validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', + performed: true, + result: 'VALID', + message: 'Validation Test Message', + messageTemplate: + 'Textual description of the validation result, using the JavaScript template literal format', + data: {}, + details: 'Test Details', +}; + +export const dfspCertificateMock = { + rootCertificate: 'Test Root Certificate', + intermediateChain: 'Test Root Certificate', + validations: [Validation], + validationState: 'VALID', +}; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/actions.ts index 6fa5e5d..8653b83 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/actions.ts @@ -1,251 +1,251 @@ -import { CertificateValidationResults } from 'App/types'; -import { - RESET_DFSP_CA, - SET_DFSP_CA_ERROR, - ResetDFPCAAction, - SetDFSPCAErrorAction, - SET_DFSP_CA_ROOT_CERTIFICATE, - SET_DFSP_CA_INTERMEDIATE_CHAIN, - SET_DFSP_CA_VALIDATIONS, - SET_DFSP_CA_VALIDATION_STATE, - CHANGE_DFSP_CA_ROOT_CERTIFICATE, - CHANGE_DFSP_CA_INTERMEDIATE_CHAIN, - SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL, - HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL, - SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, - HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, - SetDFSPCARootCertificateAction, - SetDFSPCAIntermediateChainAction, - SetDFSPCAValidationsAction, - SetDFSPCAValidationsStateAction, - ChangeDFSPCARootCertificateAction, - ChangeDFSPCARootIntermediateChainAction, - ShowDFSPCARootCertificateModalAction, - HideDFSPCARootCertificateModalAction, - ShowDFSPCAIntermediateChainModalAction, - HideDFSPCAIntermediateChainModalAction, - DownloadDFSPCARootCertificateAction, - DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE, - DownloadDFSPCAIntermediateChainAction, - DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN, - ChangeAndSubmitDFSPCARootCertificateAction, - CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE, - ChangeAndSubmitDFSPCARootIntermediateChainAction, - CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN, - SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, - AutoGenerateDFSPCACertificateAction, - ShowDFSPCAHubCertificateModalAction, - SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL, - HideDFSPCAHubCertificateModalAction, - HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL, - DownloadDFSPCAHubCertificateAction, - DOWNLOAD_DFSP_CA_HUB_CERTIFICATE, - SET_DFSP_CA_HUB_CERTIFICATE, - SetDFSPCAHubCertificateAction, - SET_DFSP_CA_HUB_CERTIFICATE_ERROR, - SetDFSPCAHubCertificateErrorAction, - RequestDFSPCAHubCertificateModalAction, - REQUEST_DFSP_CA_HUB_CERTIFICATE, - RequestDFPCAAction, - REQUEST_DFSP_CA, -} from './types'; - -export function resetDFPCA(): ResetDFPCAAction { - return { - type: RESET_DFSP_CA, - }; -} - -export function setDFSPCAError({ error }: { error: string }): SetDFSPCAErrorAction { - return { - type: SET_DFSP_CA_ERROR, - error, - }; -} - -export function requestDFPCA(): RequestDFPCAAction { - return { - type: REQUEST_DFSP_CA, - }; -} - -export function setDFSPCARootCertificate({ - certificate, -}: { - certificate: string; -}): SetDFSPCARootCertificateAction { - return { - type: SET_DFSP_CA_ROOT_CERTIFICATE, - certificate, - }; -} - -export function setDFSPCAIntermediateChain({ - certificate, -}: { - certificate: string; -}): SetDFSPCAIntermediateChainAction { - return { - type: SET_DFSP_CA_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function setDFSPCAValidations({ - validations, -}: { - validations: CertificateValidationResults[]; -}): SetDFSPCAValidationsAction { - return { - type: SET_DFSP_CA_VALIDATIONS, - validations, - }; -} - -export function setDFSPCAValidationsState({ - validationState, -}: { - validationState: string | undefined; -}): SetDFSPCAValidationsStateAction { - return { - type: SET_DFSP_CA_VALIDATION_STATE, - validationState, - }; -} - -export function changeDFSPCARootCertificate({ - certificate, -}: { - certificate: string; -}): ChangeDFSPCARootCertificateAction { - return { - type: CHANGE_DFSP_CA_ROOT_CERTIFICATE, - certificate, - }; -} - -export function changeDFSPCARootIntermediateChain({ - certificate, -}: { - certificate: string; -}): ChangeDFSPCARootIntermediateChainAction { - return { - type: CHANGE_DFSP_CA_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function showDFSPCARootCertificateModal(): ShowDFSPCARootCertificateModalAction { - return { - type: SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL, - }; -} - -export function hideDFSPCARootCertificateModal(): HideDFSPCARootCertificateModalAction { - return { - type: HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL, - }; -} - -export function downloadDfspCaRootCertificate(): DownloadDFSPCARootCertificateAction { - return { - type: DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE, - }; -} - -export function showDFSPCAIntermediateChainModal(): ShowDFSPCAIntermediateChainModalAction { - return { - type: SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function hideDFSPCAIntermediateChainModal(): HideDFSPCAIntermediateChainModalAction { - return { - type: HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function downloadDfspCaIntermediateChain(): DownloadDFSPCAIntermediateChainAction { - return { - type: DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN, - }; -} - -export function changeAndSubmitDFSPCARootCertificate({ - certificate, -}: { - certificate: string; -}): ChangeAndSubmitDFSPCARootCertificateAction { - return { - type: CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE, - certificate, - }; -} - -export function changeAndSubmitDFSPCARootIntermediateChain({ - certificate, -}: { - certificate: string; -}): ChangeAndSubmitDFSPCARootIntermediateChainAction { - return { - type: CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function autoGenerateDFSPCACertificate({ - certificate, -}: { - certificate: string; -}): AutoGenerateDFSPCACertificateAction { - return { - type: SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, - certificate, - }; -} - -export function requestDFSPCAHubCertificate(): RequestDFSPCAHubCertificateModalAction { - return { - type: REQUEST_DFSP_CA_HUB_CERTIFICATE, - }; -} - -export function setDFSPCAHubCertificate({ - certificate, -}: { - certificate: string; -}): SetDFSPCAHubCertificateAction { - return { - type: SET_DFSP_CA_HUB_CERTIFICATE, - certificate, - }; -} - -export function setDFSPCAHubCertificateError({ - error, -}: { - error: string; -}): SetDFSPCAHubCertificateErrorAction { - return { - type: SET_DFSP_CA_HUB_CERTIFICATE_ERROR, - error, - }; -} - -export function showDFSPCAHubCertificateModal(): ShowDFSPCAHubCertificateModalAction { - return { - type: SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL, - }; -} - -export function hideDFSPCAHubCertificateModal(): HideDFSPCAHubCertificateModalAction { - return { - type: HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL, - }; -} - -export function downloadDfspCaHubCertificate(): DownloadDFSPCAHubCertificateAction { - return { - type: DOWNLOAD_DFSP_CA_HUB_CERTIFICATE, - }; -} +import { CertificateValidationResults } from 'App/types'; +import { + RESET_DFSP_CA, + SET_DFSP_CA_ERROR, + ResetDFPCAAction, + SetDFSPCAErrorAction, + SET_DFSP_CA_ROOT_CERTIFICATE, + SET_DFSP_CA_INTERMEDIATE_CHAIN, + SET_DFSP_CA_VALIDATIONS, + SET_DFSP_CA_VALIDATION_STATE, + CHANGE_DFSP_CA_ROOT_CERTIFICATE, + CHANGE_DFSP_CA_INTERMEDIATE_CHAIN, + SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL, + HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL, + SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, + HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, + SetDFSPCARootCertificateAction, + SetDFSPCAIntermediateChainAction, + SetDFSPCAValidationsAction, + SetDFSPCAValidationsStateAction, + ChangeDFSPCARootCertificateAction, + ChangeDFSPCARootIntermediateChainAction, + ShowDFSPCARootCertificateModalAction, + HideDFSPCARootCertificateModalAction, + ShowDFSPCAIntermediateChainModalAction, + HideDFSPCAIntermediateChainModalAction, + DownloadDFSPCARootCertificateAction, + DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE, + DownloadDFSPCAIntermediateChainAction, + DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN, + ChangeAndSubmitDFSPCARootCertificateAction, + CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE, + ChangeAndSubmitDFSPCARootIntermediateChainAction, + CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN, + SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, + AutoGenerateDFSPCACertificateAction, + ShowDFSPCAHubCertificateModalAction, + SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL, + HideDFSPCAHubCertificateModalAction, + HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL, + DownloadDFSPCAHubCertificateAction, + DOWNLOAD_DFSP_CA_HUB_CERTIFICATE, + SET_DFSP_CA_HUB_CERTIFICATE, + SetDFSPCAHubCertificateAction, + SET_DFSP_CA_HUB_CERTIFICATE_ERROR, + SetDFSPCAHubCertificateErrorAction, + RequestDFSPCAHubCertificateModalAction, + REQUEST_DFSP_CA_HUB_CERTIFICATE, + RequestDFPCAAction, + REQUEST_DFSP_CA, +} from './types'; + +export function resetDFPCA(): ResetDFPCAAction { + return { + type: RESET_DFSP_CA, + }; +} + +export function setDFSPCAError({ error }: { error: string }): SetDFSPCAErrorAction { + return { + type: SET_DFSP_CA_ERROR, + error, + }; +} + +export function requestDFPCA(): RequestDFPCAAction { + return { + type: REQUEST_DFSP_CA, + }; +} + +export function setDFSPCARootCertificate({ + certificate, +}: { + certificate: string; +}): SetDFSPCARootCertificateAction { + return { + type: SET_DFSP_CA_ROOT_CERTIFICATE, + certificate, + }; +} + +export function setDFSPCAIntermediateChain({ + certificate, +}: { + certificate: string; +}): SetDFSPCAIntermediateChainAction { + return { + type: SET_DFSP_CA_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function setDFSPCAValidations({ + validations, +}: { + validations: CertificateValidationResults[]; +}): SetDFSPCAValidationsAction { + return { + type: SET_DFSP_CA_VALIDATIONS, + validations, + }; +} + +export function setDFSPCAValidationsState({ + validationState, +}: { + validationState: string | undefined; +}): SetDFSPCAValidationsStateAction { + return { + type: SET_DFSP_CA_VALIDATION_STATE, + validationState, + }; +} + +export function changeDFSPCARootCertificate({ + certificate, +}: { + certificate: string; +}): ChangeDFSPCARootCertificateAction { + return { + type: CHANGE_DFSP_CA_ROOT_CERTIFICATE, + certificate, + }; +} + +export function changeDFSPCARootIntermediateChain({ + certificate, +}: { + certificate: string; +}): ChangeDFSPCARootIntermediateChainAction { + return { + type: CHANGE_DFSP_CA_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function showDFSPCARootCertificateModal(): ShowDFSPCARootCertificateModalAction { + return { + type: SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL, + }; +} + +export function hideDFSPCARootCertificateModal(): HideDFSPCARootCertificateModalAction { + return { + type: HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL, + }; +} + +export function downloadDfspCaRootCertificate(): DownloadDFSPCARootCertificateAction { + return { + type: DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE, + }; +} + +export function showDFSPCAIntermediateChainModal(): ShowDFSPCAIntermediateChainModalAction { + return { + type: SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function hideDFSPCAIntermediateChainModal(): HideDFSPCAIntermediateChainModalAction { + return { + type: HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function downloadDfspCaIntermediateChain(): DownloadDFSPCAIntermediateChainAction { + return { + type: DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN, + }; +} + +export function changeAndSubmitDFSPCARootCertificate({ + certificate, +}: { + certificate: string; +}): ChangeAndSubmitDFSPCARootCertificateAction { + return { + type: CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE, + certificate, + }; +} + +export function changeAndSubmitDFSPCARootIntermediateChain({ + certificate, +}: { + certificate: string; +}): ChangeAndSubmitDFSPCARootIntermediateChainAction { + return { + type: CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function autoGenerateDFSPCACertificate({ + certificate, +}: { + certificate: string; +}): AutoGenerateDFSPCACertificateAction { + return { + type: SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, + certificate, + }; +} + +export function requestDFSPCAHubCertificate(): RequestDFSPCAHubCertificateModalAction { + return { + type: REQUEST_DFSP_CA_HUB_CERTIFICATE, + }; +} + +export function setDFSPCAHubCertificate({ + certificate, +}: { + certificate: string; +}): SetDFSPCAHubCertificateAction { + return { + type: SET_DFSP_CA_HUB_CERTIFICATE, + certificate, + }; +} + +export function setDFSPCAHubCertificateError({ + error, +}: { + error: string; +}): SetDFSPCAHubCertificateErrorAction { + return { + type: SET_DFSP_CA_HUB_CERTIFICATE_ERROR, + error, + }; +} + +export function showDFSPCAHubCertificateModal(): ShowDFSPCAHubCertificateModalAction { + return { + type: SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL, + }; +} + +export function hideDFSPCAHubCertificateModal(): HideDFSPCAHubCertificateModalAction { + return { + type: HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL, + }; +} + +export function downloadDfspCaHubCertificate(): DownloadDFSPCAHubCertificateAction { + return { + type: DOWNLOAD_DFSP_CA_HUB_CERTIFICATE, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/index.ts index 1a14f78..070911d 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/index.ts @@ -1,8 +1,8 @@ -import DFSPCertificateAuthority from './DFSPCertificateAuthority'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; - -export default DFSPCertificateAuthority; -export { actions, reducer, selectors, types }; +import DFSPCertificateAuthority from './DFSPCertificateAuthority'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; + +export default DFSPCertificateAuthority; +export { actions, reducer, selectors, types }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/reducers.ts index dd646db..64bfd94 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/reducers.ts @@ -1,147 +1,147 @@ -import { - RESET_DFSP_CA, - SET_DFSP_CA_ERROR, - SET_DFSP_CA_ROOT_CERTIFICATE, - SET_DFSP_CA_INTERMEDIATE_CHAIN, - SET_DFSP_CA_VALIDATIONS, - SET_DFSP_CA_VALIDATION_STATE, - CHANGE_DFSP_CA_ROOT_CERTIFICATE, - CHANGE_DFSP_CA_INTERMEDIATE_CHAIN, - SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL, - HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL, - SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, - HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, - DFSPCertificateAuthorityState, - DFSPCertificateAuthorityActionTypes, - SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, - SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL, - HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL, - SET_DFSP_CA_HUB_CERTIFICATE, -} from './types'; - -export const initialState: DFSPCertificateAuthorityState = { - dfspName: undefined, - dfspCaError: undefined, - dfspCaRootCert: undefined, - dfspCaIntermediateChain: undefined, - dfspCaHubCert: undefined, - dfspCaValidations: [], - dfspCaValidationState: undefined, - isDfspCaRootCertificateModalVisible: false, - isDfspCaIntermediateChainModalVisible: false, - isDfspCaHubCertificateModalVisible: false, -}; - -export default function DFSPCertificateAuthorityReducer( - state = initialState, - action: DFSPCertificateAuthorityActionTypes -) { - switch (action.type) { - case RESET_DFSP_CA: - return initialState; - - case SET_DFSP_CA_ERROR: { - return { - ...state, - dfspCaError: action.error, - }; - } - - case SET_DFSP_CA_ROOT_CERTIFICATE: - return { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - ...state, - dfspCaRootCert: action.certificate || null, - }; - - case SET_DFSP_CA_INTERMEDIATE_CHAIN: - return { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - ...state, - dfspCaIntermediateChain: action.certificate || null, - }; - - case SET_DFSP_CA_VALIDATIONS: - return { - ...state, - dfspCaValidations: action.validations, - }; - - case SET_DFSP_CA_VALIDATION_STATE: - return { - ...state, - dfspCaValidationState: action.validationState, - }; - - case CHANGE_DFSP_CA_ROOT_CERTIFICATE: - return { - ...state, - dfspCaRootCert: action.certificate, - dfspCaValidations: initialState.dfspCaValidations, - dfspCaValidationState: initialState.dfspCaValidationState, - }; - - case CHANGE_DFSP_CA_INTERMEDIATE_CHAIN: - return { - ...state, - dfspCaIntermediateChain: action.certificate, - dfspCaValidations: initialState.dfspCaValidations, - dfspCaValidationState: initialState.dfspCaValidationState, - }; - - case SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL: - return { - ...state, - isDfspCaRootCertificateModalVisible: true, - }; - - case HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL: - return { - ...state, - isDfspCaRootCertificateModalVisible: false, - }; - - case SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL: - return { - ...state, - isDfspCaIntermediateChainModalVisible: true, - }; - - case HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL: - return { - ...state, - isDfspCaIntermediateChainModalVisible: false, - }; - - case SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE: - return { - ...state, - autoGenerateDFSPCACertificate: action.certificate, - }; - - case SET_DFSP_CA_HUB_CERTIFICATE: - return { - ...state, - dfspCaHubCert: action.certificate || null, - }; - - case SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL: - return { - ...state, - isDfspCaHubCertificateModalVisible: true, - }; - - case HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL: - return { - ...state, - isDfspCaHubCertificateModalVisible: false, - }; - - default: - return state; - } -} +import { + RESET_DFSP_CA, + SET_DFSP_CA_ERROR, + SET_DFSP_CA_ROOT_CERTIFICATE, + SET_DFSP_CA_INTERMEDIATE_CHAIN, + SET_DFSP_CA_VALIDATIONS, + SET_DFSP_CA_VALIDATION_STATE, + CHANGE_DFSP_CA_ROOT_CERTIFICATE, + CHANGE_DFSP_CA_INTERMEDIATE_CHAIN, + SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL, + HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL, + SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, + HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL, + DFSPCertificateAuthorityState, + DFSPCertificateAuthorityActionTypes, + SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, + SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL, + HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL, + SET_DFSP_CA_HUB_CERTIFICATE, +} from './types'; + +export const initialState: DFSPCertificateAuthorityState = { + dfspName: undefined, + dfspCaError: undefined, + dfspCaRootCert: undefined, + dfspCaIntermediateChain: undefined, + dfspCaHubCert: undefined, + dfspCaValidations: [], + dfspCaValidationState: undefined, + isDfspCaRootCertificateModalVisible: false, + isDfspCaIntermediateChainModalVisible: false, + isDfspCaHubCertificateModalVisible: false, +}; + +export default function DFSPCertificateAuthorityReducer( + state = initialState, + action: DFSPCertificateAuthorityActionTypes +) { + switch (action.type) { + case RESET_DFSP_CA: + return initialState; + + case SET_DFSP_CA_ERROR: { + return { + ...state, + dfspCaError: action.error, + }; + } + + case SET_DFSP_CA_ROOT_CERTIFICATE: + return { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + ...state, + dfspCaRootCert: action.certificate || null, + }; + + case SET_DFSP_CA_INTERMEDIATE_CHAIN: + return { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + ...state, + dfspCaIntermediateChain: action.certificate || null, + }; + + case SET_DFSP_CA_VALIDATIONS: + return { + ...state, + dfspCaValidations: action.validations, + }; + + case SET_DFSP_CA_VALIDATION_STATE: + return { + ...state, + dfspCaValidationState: action.validationState, + }; + + case CHANGE_DFSP_CA_ROOT_CERTIFICATE: + return { + ...state, + dfspCaRootCert: action.certificate, + dfspCaValidations: initialState.dfspCaValidations, + dfspCaValidationState: initialState.dfspCaValidationState, + }; + + case CHANGE_DFSP_CA_INTERMEDIATE_CHAIN: + return { + ...state, + dfspCaIntermediateChain: action.certificate, + dfspCaValidations: initialState.dfspCaValidations, + dfspCaValidationState: initialState.dfspCaValidationState, + }; + + case SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL: + return { + ...state, + isDfspCaRootCertificateModalVisible: true, + }; + + case HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL: + return { + ...state, + isDfspCaRootCertificateModalVisible: false, + }; + + case SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL: + return { + ...state, + isDfspCaIntermediateChainModalVisible: true, + }; + + case HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL: + return { + ...state, + isDfspCaIntermediateChainModalVisible: false, + }; + + case SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE: + return { + ...state, + autoGenerateDFSPCACertificate: action.certificate, + }; + + case SET_DFSP_CA_HUB_CERTIFICATE: + return { + ...state, + dfspCaHubCert: action.certificate || null, + }; + + case SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL: + return { + ...state, + isDfspCaHubCertificateModalVisible: true, + }; + + case HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL: + return { + ...state, + isDfspCaHubCertificateModalVisible: false, + }; + + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/sagas.ts index c2ecef0..54efd93 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/sagas.ts @@ -1,242 +1,242 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import { is20x } from 'utils/http'; -import { downloadFile } from 'utils/html'; -import apis from 'utils/apis'; -import { showToast, showErrorModal } from 'App/actions'; -import { getDfspName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { - SUBMIT_DFSP_CA, - DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE, - DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN, - CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN, - CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE, - SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, - REQUEST_DFSP_CA, - DOWNLOAD_DFSP_CA_HUB_CERTIFICATE, - ChangeDFSPCARootCertificateAction, - ChangeDFSPCARootIntermediateChainAction, -} from './types'; -import { - getDfspCaRootCertificate, - getDfspCaIntermediateChain, - getDfspCaHubCertificate, -} from './selectors'; -import { - setDFSPCARootCertificate, - setDFSPCAIntermediateChain, - setDFSPCAValidations, - setDFSPCAValidationsState, - changeDFSPCARootCertificate, - changeDFSPCARootIntermediateChain, - setDFSPCAHubCertificate, - setDFSPCAHubCertificateError, -} from './actions'; - -function* fetchDFSPCertificate() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - - const rootCertificate = getDfspCaRootCertificate(state) || ''; - const intermediateChain = getDfspCaIntermediateChain(state) || ''; - - const body = { - rootCertificate, - intermediateChain, - }; - - const response = yield call(apis.dfspCA.read, { environmentId, body }); - - if (is20x(response.status)) { - yield put(setDFSPCARootCertificate({ certificate: response.data.rootCertificate })); - yield put(setDFSPCAIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDFSPCAValidations({ validations: response.data.validations })); - yield put(setDFSPCAValidationsState({ validationState: response.data.validationState })); - } else { - yield put(showErrorModal('Error Loading DFSP CA')); - } - } catch (e) { - put(showErrorModal(e.message)); - // yield put(setDFSPCAError({ error: e.message })); - } -} - -function* submitDFSPCA( - action: ChangeDFSPCARootCertificateAction | ChangeDFSPCARootIntermediateChainAction -) { - try { - const state = yield select(); - - const rootCertificate = getDfspCaRootCertificate(state) || ''; - const intermediateChain = getDfspCaIntermediateChain(state) || ''; - - const environmentId = getEnvironmentId(state); - - const body = { - rootCertificate, - intermediateChain, - }; - - const response = yield call(apis.dfspCA.create, { environmentId, body }); - - if (is20x(response.status)) { - yield put(showToast()); - yield put(setDFSPCARootCertificate({ certificate: response.data.rootCertificate })); - yield put(setDFSPCAIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDFSPCAValidations({ validations: response.data.validations })); - yield put(setDFSPCAValidationsState({ validationState: response.data.validationState })); - } else { - yield put(showErrorModal('Error Submitting DFSP CA')); - } - } catch (e) { - yield put(showErrorModal(e.message)); - // yield put(setDFSPCAError({ error: e.message })); - } -} - -export function* submitDFSPCASaga() { - yield takeLatest([SUBMIT_DFSP_CA], submitDFSPCA); -} - -export function* changeDfspCaRootCertificateAndSubmit(action: ChangeDFSPCARootCertificateAction) { - try { - yield put(changeDFSPCARootCertificate({ certificate: action.certificate })); - yield call(submitDFSPCA, action); - } catch (e) { - put(showErrorModal(e.message)); - } -} - -export function* changeDfspCaRootCertificateAndSubmitSaga() { - yield takeLatest( - [CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE], - changeDfspCaRootCertificateAndSubmit - ); -} - -export function* changeDfspCaIntermediateChainAndSubmit( - action: ChangeDFSPCARootIntermediateChainAction -) { - try { - yield put(changeDFSPCARootIntermediateChain({ certificate: action.certificate })); - yield call(submitDFSPCA, action); - } catch (e) { - put(showErrorModal(e.message)); - } -} - -export function* changeDfspCaIntermediateChainAndSubmitSaga() { - yield takeLatest( - [CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN], - changeDfspCaIntermediateChainAndSubmit - ); -} - -export function* downloadDfspCaRootCertificate() { - try { - const state = yield select(); - - const dfspName = getDfspName(state); - const rootCertificate = getDfspCaRootCertificate(state) || ''; - downloadFile(rootCertificate, `${dfspName}-root.pem`); - } catch (e) { - put(showErrorModal(e.message)); - } -} - -export function* downloadDfspCaRootCertificateSaga() { - yield takeLatest([DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE], downloadDfspCaRootCertificate); -} - -export function* downloadDfspCaIntermediateChain() { - try { - const state = yield select(); - - const dfspName = getDfspName(state); - const intermediateChain = getDfspCaIntermediateChain(state) || ''; - downloadFile(intermediateChain, `${dfspName}-intermediates.pem`); - } catch (e) { - put(showErrorModal(e.message)); - } -} - -export function* downloadDfspCaIntermediateChainSaga() { - yield takeLatest([DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN], downloadDfspCaIntermediateChain); -} - -export function* autoGenerateDFSPCACertificate() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - - const response = yield call(apis.dfspAutoCA.create, { environmentId }); - - if (is20x(response.status)) { - yield put(showToast()); - } else { - yield put(showErrorModal('Error Auto Generating DFSP CA')); - } - } catch (e) { - put(showErrorModal(e.message)); - } -} - -export function* autoGenerateDFSPCACertificateSaga() { - yield takeLatest([SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE], autoGenerateDFSPCACertificate); -} - -export function* fetchHubCertificate() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - - const response = yield call(apis.dfspHubCA.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setDFSPCAHubCertificate({ certificate: response.data })); - } else { - yield put(setDFSPCAHubCertificateError({ error: 'Error retrieving Hub Certificate' })); - } - } catch (e) { - yield put(setDFSPCAHubCertificateError({ error: e.message })); - } -} - -export function* downloadHubCertificate() { - try { - const state = yield select(); - - const dfspName = getDfspName(state); - const hubCertificate = getDfspCaHubCertificate(state) || ''; - downloadFile(hubCertificate, `${dfspName}-hub.pem`); - } catch (e) { - put(showErrorModal(e.message)); - } -} - -export function* downloadHubCertificateSaga() { - yield takeLatest([DOWNLOAD_DFSP_CA_HUB_CERTIFICATE], downloadHubCertificate); -} - -export function* fetchDataDFSPCA() { - try { - yield all([call(fetchDFSPCertificate), call(fetchHubCertificate)]); - } catch (e) { - put(showErrorModal(e.message)); - } -} - -export function* requestDataDFSPCASaga() { - yield takeLatest(REQUEST_DFSP_CA, fetchDataDFSPCA); -} - -export default function* rootSaga() { - yield all([ - changeDfspCaRootCertificateAndSubmitSaga(), - changeDfspCaIntermediateChainAndSubmitSaga(), - downloadDfspCaRootCertificateSaga(), - downloadDfspCaIntermediateChainSaga(), - downloadHubCertificateSaga(), - requestDataDFSPCASaga(), - ]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import { is20x } from 'utils/http'; +import { downloadFile } from 'utils/html'; +import apis from 'utils/apis'; +import { showToast, showErrorModal } from 'App/actions'; +import { getDfspName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { + SUBMIT_DFSP_CA, + DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE, + DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN, + CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN, + CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE, + SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE, + REQUEST_DFSP_CA, + DOWNLOAD_DFSP_CA_HUB_CERTIFICATE, + ChangeDFSPCARootCertificateAction, + ChangeDFSPCARootIntermediateChainAction, +} from './types'; +import { + getDfspCaRootCertificate, + getDfspCaIntermediateChain, + getDfspCaHubCertificate, +} from './selectors'; +import { + setDFSPCARootCertificate, + setDFSPCAIntermediateChain, + setDFSPCAValidations, + setDFSPCAValidationsState, + changeDFSPCARootCertificate, + changeDFSPCARootIntermediateChain, + setDFSPCAHubCertificate, + setDFSPCAHubCertificateError, +} from './actions'; + +function* fetchDFSPCertificate() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + + const rootCertificate = getDfspCaRootCertificate(state) || ''; + const intermediateChain = getDfspCaIntermediateChain(state) || ''; + + const body = { + rootCertificate, + intermediateChain, + }; + + const response = yield call(apis.dfspCA.read, { environmentId, body }); + + if (is20x(response.status)) { + yield put(setDFSPCARootCertificate({ certificate: response.data.rootCertificate })); + yield put(setDFSPCAIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDFSPCAValidations({ validations: response.data.validations })); + yield put(setDFSPCAValidationsState({ validationState: response.data.validationState })); + } else { + yield put(showErrorModal('Error Loading DFSP CA')); + } + } catch (e) { + put(showErrorModal(e.message)); + // yield put(setDFSPCAError({ error: e.message })); + } +} + +function* submitDFSPCA( + action: ChangeDFSPCARootCertificateAction | ChangeDFSPCARootIntermediateChainAction +) { + try { + const state = yield select(); + + const rootCertificate = getDfspCaRootCertificate(state) || ''; + const intermediateChain = getDfspCaIntermediateChain(state) || ''; + + const environmentId = getEnvironmentId(state); + + const body = { + rootCertificate, + intermediateChain, + }; + + const response = yield call(apis.dfspCA.create, { environmentId, body }); + + if (is20x(response.status)) { + yield put(showToast()); + yield put(setDFSPCARootCertificate({ certificate: response.data.rootCertificate })); + yield put(setDFSPCAIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDFSPCAValidations({ validations: response.data.validations })); + yield put(setDFSPCAValidationsState({ validationState: response.data.validationState })); + } else { + yield put(showErrorModal('Error Submitting DFSP CA')); + } + } catch (e) { + yield put(showErrorModal(e.message)); + // yield put(setDFSPCAError({ error: e.message })); + } +} + +export function* submitDFSPCASaga() { + yield takeLatest([SUBMIT_DFSP_CA], submitDFSPCA); +} + +export function* changeDfspCaRootCertificateAndSubmit(action: ChangeDFSPCARootCertificateAction) { + try { + yield put(changeDFSPCARootCertificate({ certificate: action.certificate })); + yield call(submitDFSPCA, action); + } catch (e) { + put(showErrorModal(e.message)); + } +} + +export function* changeDfspCaRootCertificateAndSubmitSaga() { + yield takeLatest( + [CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE], + changeDfspCaRootCertificateAndSubmit + ); +} + +export function* changeDfspCaIntermediateChainAndSubmit( + action: ChangeDFSPCARootIntermediateChainAction +) { + try { + yield put(changeDFSPCARootIntermediateChain({ certificate: action.certificate })); + yield call(submitDFSPCA, action); + } catch (e) { + put(showErrorModal(e.message)); + } +} + +export function* changeDfspCaIntermediateChainAndSubmitSaga() { + yield takeLatest( + [CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN], + changeDfspCaIntermediateChainAndSubmit + ); +} + +export function* downloadDfspCaRootCertificate() { + try { + const state = yield select(); + + const dfspName = getDfspName(state); + const rootCertificate = getDfspCaRootCertificate(state) || ''; + downloadFile(rootCertificate, `${dfspName}-root.pem`); + } catch (e) { + put(showErrorModal(e.message)); + } +} + +export function* downloadDfspCaRootCertificateSaga() { + yield takeLatest([DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE], downloadDfspCaRootCertificate); +} + +export function* downloadDfspCaIntermediateChain() { + try { + const state = yield select(); + + const dfspName = getDfspName(state); + const intermediateChain = getDfspCaIntermediateChain(state) || ''; + downloadFile(intermediateChain, `${dfspName}-intermediates.pem`); + } catch (e) { + put(showErrorModal(e.message)); + } +} + +export function* downloadDfspCaIntermediateChainSaga() { + yield takeLatest([DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN], downloadDfspCaIntermediateChain); +} + +export function* autoGenerateDFSPCACertificate() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + + const response = yield call(apis.dfspAutoCA.create, { environmentId }); + + if (is20x(response.status)) { + yield put(showToast()); + } else { + yield put(showErrorModal('Error Auto Generating DFSP CA')); + } + } catch (e) { + put(showErrorModal(e.message)); + } +} + +export function* autoGenerateDFSPCACertificateSaga() { + yield takeLatest([SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE], autoGenerateDFSPCACertificate); +} + +export function* fetchHubCertificate() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + + const response = yield call(apis.dfspHubCA.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setDFSPCAHubCertificate({ certificate: response.data })); + } else { + yield put(setDFSPCAHubCertificateError({ error: 'Error retrieving Hub Certificate' })); + } + } catch (e) { + yield put(setDFSPCAHubCertificateError({ error: e.message })); + } +} + +export function* downloadHubCertificate() { + try { + const state = yield select(); + + const dfspName = getDfspName(state); + const hubCertificate = getDfspCaHubCertificate(state) || ''; + downloadFile(hubCertificate, `${dfspName}-hub.pem`); + } catch (e) { + put(showErrorModal(e.message)); + } +} + +export function* downloadHubCertificateSaga() { + yield takeLatest([DOWNLOAD_DFSP_CA_HUB_CERTIFICATE], downloadHubCertificate); +} + +export function* fetchDataDFSPCA() { + try { + yield all([call(fetchDFSPCertificate), call(fetchHubCertificate)]); + } catch (e) { + put(showErrorModal(e.message)); + } +} + +export function* requestDataDFSPCASaga() { + yield takeLatest(REQUEST_DFSP_CA, fetchDataDFSPCA); +} + +export default function* rootSaga() { + yield all([ + changeDfspCaRootCertificateAndSubmitSaga(), + changeDfspCaIntermediateChainAndSubmitSaga(), + downloadDfspCaRootCertificateSaga(), + downloadDfspCaIntermediateChainSaga(), + downloadHubCertificateSaga(), + requestDataDFSPCASaga(), + ]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/selectors.ts index fad5320..72be33c 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/selectors.ts @@ -1,43 +1,43 @@ -import { State } from 'store/types'; -import { createSelector } from 'reselect'; -import { isPending } from 'utils/api'; -import * as testers from 'utils/testers'; - -export const getDfspCaError = (state: State) => state.wizard.environment.dfspca.dfspCaError; -export const getDfspCaRootCertificate = (state: State) => - state.wizard.environment.dfspca.dfspCaRootCert; -export const getIsDfspCaRootCertificateModalVisible = (state: State) => - state.wizard.environment.dfspca.isDfspCaRootCertificateModalVisible; -export const getDfspCaIntermediateChain = (state: State) => - state.wizard.environment.dfspca.dfspCaIntermediateChain; -export const getIsDfspCaIntermediateChainModalVisible = (state: State) => - state.wizard.environment.dfspca.isDfspCaIntermediateChainModalVisible; -export const getDfspCaValidations = (state: State) => - state.wizard.environment.dfspca.dfspCaValidations; -export const getDfspCaValidationState = (state: State) => - state.wizard.environment.dfspca.dfspCaValidationState; - -export const getIsDfspCaPending = createSelector( - (state: State) => state.api, - isPending('dfspCA.create') -); - -export const getisAutoGeneratePending = createSelector( - (state: State) => state.api, - isPending('dfspAutoCA.create') -); - -export const getIsAutoGenerateCAEnabled = createSelector( - getDfspCaRootCertificate, - getDfspCaIntermediateChain, - testers.getAllAre(undefined) -); - -export const getDfspCaHubCertificate = (state: State) => - state.wizard.environment.dfspca.dfspCaHubCert; -export const getIsDfspCaHubCertificateModalVisible = (state: State) => - state.wizard.environment.dfspca.isDfspCaHubCertificateModalVisible; -export const getisDfspCaHubCertificatePending = createSelector( - (state: State) => state.api, - isPending('dfspHubCA.create') -); +import { State } from 'store/types'; +import { createSelector } from 'reselect'; +import { isPending } from 'utils/api'; +import * as testers from 'utils/testers'; + +export const getDfspCaError = (state: State) => state.wizard.environment.dfspca.dfspCaError; +export const getDfspCaRootCertificate = (state: State) => + state.wizard.environment.dfspca.dfspCaRootCert; +export const getIsDfspCaRootCertificateModalVisible = (state: State) => + state.wizard.environment.dfspca.isDfspCaRootCertificateModalVisible; +export const getDfspCaIntermediateChain = (state: State) => + state.wizard.environment.dfspca.dfspCaIntermediateChain; +export const getIsDfspCaIntermediateChainModalVisible = (state: State) => + state.wizard.environment.dfspca.isDfspCaIntermediateChainModalVisible; +export const getDfspCaValidations = (state: State) => + state.wizard.environment.dfspca.dfspCaValidations; +export const getDfspCaValidationState = (state: State) => + state.wizard.environment.dfspca.dfspCaValidationState; + +export const getIsDfspCaPending = createSelector( + (state: State) => state.api, + isPending('dfspCA.create') +); + +export const getisAutoGeneratePending = createSelector( + (state: State) => state.api, + isPending('dfspAutoCA.create') +); + +export const getIsAutoGenerateCAEnabled = createSelector( + getDfspCaRootCertificate, + getDfspCaIntermediateChain, + testers.getAllAre(undefined) +); + +export const getDfspCaHubCertificate = (state: State) => + state.wizard.environment.dfspca.dfspCaHubCert; +export const getIsDfspCaHubCertificateModalVisible = (state: State) => + state.wizard.environment.dfspca.isDfspCaHubCertificateModalVisible; +export const getisDfspCaHubCertificatePending = createSelector( + (state: State) => state.api, + isPending('dfspHubCA.create') +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/types.ts index bc920bb..3141a7c 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/DFSPCertificateAuthority/types.ts @@ -1,191 +1,191 @@ -import { CertificateValidationResults } from 'App/types'; - -export const STORE_DFSP_CA = 'DFSP CA / Store'; -export const SUBMIT_DFSP_CA = 'DFSP CA / Submit'; -export const RESET_DFSP_CA = 'DFSP CA / Reset'; -export const REQUEST_DFSP_CA = 'DFSP CA / Request'; -export const SET_DFSP_CA_ERROR = 'DFSP CA / Set Root Cert Error'; -export const SET_DFSP_CA_ROOT_CERTIFICATE = 'DFSP CA / Set Root Certificate'; -export const CHANGE_DFSP_CA_ROOT_CERTIFICATE = 'DFSP CA / Change Root Certificate'; -export const SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL = 'DFSP CA / Show Root Certificate Modal'; -export const HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL = 'DFSP CA / Hide Root Certificate Modal'; -export const DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE = 'DFSP CA / Download Root Certificate'; -export const CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE = - 'DFSP CA / Change and Submit Root Certificate'; -export const SET_DFSP_CA_INTERMEDIATE_CHAIN = 'DFSP CA / Set Intermediate Chain'; -export const CHANGE_DFSP_CA_INTERMEDIATE_CHAIN = 'DFSP CA / Change Intermediate Chain'; -export const SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL = 'DFSP CA / Show Intermediate Chain Modal'; -export const HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL = 'DFSP CA / Hide Intermediate Chain Modal'; -export const DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN = 'DFSP CA / Download Intermediate Chain'; -export const CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN = - 'DFSP CA / Change and Submit Intermediate Chain'; -export const SET_DFSP_CA_VALIDATIONS = 'DFSP CA / Set Validations'; -export const SET_DFSP_CA_VALIDATION_STATE = 'DFSP CA / Set Validation State'; -export const SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE = 'DFSP CA / Auto Generate'; -export const REQUEST_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Request Hub Certificate'; -export const SET_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Set Hub Certificate'; -export const SET_DFSP_CA_HUB_CERTIFICATE_ERROR = 'DFSP CA / Set Hub Certificate Error'; -export const CHANGE_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Change Hub Certificate'; -export const SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL = 'DFSP CA / Show Hub Certificate Modal'; -export const HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL = 'DFSP CA / Hide Hub Certificate Modal'; -export const DOWNLOAD_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Download Hub Certificate'; - -export interface DFSPCertificateAuthorityPayload { - payload: string | undefined; -} - -export interface SubmitDFSPCAAction { - type: typeof SUBMIT_DFSP_CA; - payload: DFSPCertificateAuthorityPayload; -} - -export interface ChangeCertificateAction { - type: typeof SUBMIT_DFSP_CA; - payload: DFSPCertificateAuthorityPayload; -} - -export interface ResetDFPCAAction { - type: typeof RESET_DFSP_CA; -} - -export interface RequestDFPCAAction { - type: typeof REQUEST_DFSP_CA; -} - -export interface SetDFSPCAErrorAction { - type: typeof SET_DFSP_CA_ERROR; - error: string; -} - -export interface SetDFSPCARootCertificateAction { - type: typeof SET_DFSP_CA_ROOT_CERTIFICATE; - certificate: string; -} - -export interface SetDFSPCAIntermediateChainAction { - type: typeof SET_DFSP_CA_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface SetDFSPCAValidationsAction { - type: typeof SET_DFSP_CA_VALIDATIONS; - validations: CertificateValidationResults[]; -} - -export interface SetDFSPCAValidationsStateAction { - type: typeof SET_DFSP_CA_VALIDATION_STATE; - validationState: string | undefined; -} - -export interface ChangeDFSPCARootCertificateAction { - type: typeof CHANGE_DFSP_CA_ROOT_CERTIFICATE; - certificate: string; -} - -export interface ChangeDFSPCARootIntermediateChainAction { - type: typeof CHANGE_DFSP_CA_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface ShowDFSPCARootCertificateModalAction { - type: typeof SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL; -} - -export interface HideDFSPCARootCertificateModalAction { - type: typeof HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL; -} - -export interface DownloadDFSPCARootCertificateAction { - type: typeof DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE; -} - -export interface ShowDFSPCAIntermediateChainModalAction { - type: typeof SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL; -} - -export interface HideDFSPCAIntermediateChainModalAction { - type: typeof HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL; -} - -export interface DownloadDFSPCAIntermediateChainAction { - type: typeof DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN; -} - -export interface ChangeAndSubmitDFSPCARootCertificateAction { - type: typeof CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE; - certificate: string; -} - -export interface ChangeAndSubmitDFSPCARootIntermediateChainAction { - type: typeof CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface AutoGenerateDFSPCACertificateAction { - type: typeof SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE; - certificate: string; -} - -export interface SetDFSPCAHubCertificateAction { - type: typeof SET_DFSP_CA_HUB_CERTIFICATE; - certificate: string; -} - -export interface SetDFSPCAHubCertificateErrorAction { - type: typeof SET_DFSP_CA_HUB_CERTIFICATE_ERROR; - error: string; -} - -export interface RequestDFSPCAHubCertificateModalAction { - type: typeof REQUEST_DFSP_CA_HUB_CERTIFICATE; -} - -export interface ShowDFSPCAHubCertificateModalAction { - type: typeof SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL; -} - -export interface HideDFSPCAHubCertificateModalAction { - type: typeof HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL; -} - -export interface DownloadDFSPCAHubCertificateAction { - type: typeof DOWNLOAD_DFSP_CA_HUB_CERTIFICATE; -} - -export type DFSPCertificateAuthorityActionTypes = - | ResetDFPCAAction - | SetDFSPCAErrorAction - | RequestDFPCAAction - | SetDFSPCARootCertificateAction - | SetDFSPCAIntermediateChainAction - | SetDFSPCAValidationsAction - | SetDFSPCAValidationsStateAction - | ChangeDFSPCARootCertificateAction - | ChangeDFSPCARootIntermediateChainAction - | ShowDFSPCARootCertificateModalAction - | HideDFSPCARootCertificateModalAction - | ShowDFSPCAIntermediateChainModalAction - | HideDFSPCAIntermediateChainModalAction - | DownloadDFSPCARootCertificateAction - | ChangeAndSubmitDFSPCARootCertificateAction - | ChangeAndSubmitDFSPCARootIntermediateChainAction - | AutoGenerateDFSPCACertificateAction - | RequestDFSPCAHubCertificateModalAction - | SetDFSPCAHubCertificateAction - | SetDFSPCAHubCertificateErrorAction - | ShowDFSPCAHubCertificateModalAction - | HideDFSPCAHubCertificateModalAction - | DownloadDFSPCAHubCertificateAction; - -export interface DFSPCertificateAuthorityState { - dfspName?: string; - dfspCaError?: string; - dfspCaRootCert?: string; - dfspCaIntermediateChain?: string; - dfspCaHubCert?: string; - dfspCaValidations: CertificateValidationResults[]; - dfspCaValidationState?: string; - isDfspCaRootCertificateModalVisible: boolean; - isDfspCaIntermediateChainModalVisible: boolean; - isDfspCaHubCertificateModalVisible: boolean; -} +import { CertificateValidationResults } from 'App/types'; + +export const STORE_DFSP_CA = 'DFSP CA / Store'; +export const SUBMIT_DFSP_CA = 'DFSP CA / Submit'; +export const RESET_DFSP_CA = 'DFSP CA / Reset'; +export const REQUEST_DFSP_CA = 'DFSP CA / Request'; +export const SET_DFSP_CA_ERROR = 'DFSP CA / Set Root Cert Error'; +export const SET_DFSP_CA_ROOT_CERTIFICATE = 'DFSP CA / Set Root Certificate'; +export const CHANGE_DFSP_CA_ROOT_CERTIFICATE = 'DFSP CA / Change Root Certificate'; +export const SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL = 'DFSP CA / Show Root Certificate Modal'; +export const HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL = 'DFSP CA / Hide Root Certificate Modal'; +export const DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE = 'DFSP CA / Download Root Certificate'; +export const CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE = + 'DFSP CA / Change and Submit Root Certificate'; +export const SET_DFSP_CA_INTERMEDIATE_CHAIN = 'DFSP CA / Set Intermediate Chain'; +export const CHANGE_DFSP_CA_INTERMEDIATE_CHAIN = 'DFSP CA / Change Intermediate Chain'; +export const SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL = 'DFSP CA / Show Intermediate Chain Modal'; +export const HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL = 'DFSP CA / Hide Intermediate Chain Modal'; +export const DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN = 'DFSP CA / Download Intermediate Chain'; +export const CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN = + 'DFSP CA / Change and Submit Intermediate Chain'; +export const SET_DFSP_CA_VALIDATIONS = 'DFSP CA / Set Validations'; +export const SET_DFSP_CA_VALIDATION_STATE = 'DFSP CA / Set Validation State'; +export const SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE = 'DFSP CA / Auto Generate'; +export const REQUEST_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Request Hub Certificate'; +export const SET_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Set Hub Certificate'; +export const SET_DFSP_CA_HUB_CERTIFICATE_ERROR = 'DFSP CA / Set Hub Certificate Error'; +export const CHANGE_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Change Hub Certificate'; +export const SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL = 'DFSP CA / Show Hub Certificate Modal'; +export const HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL = 'DFSP CA / Hide Hub Certificate Modal'; +export const DOWNLOAD_DFSP_CA_HUB_CERTIFICATE = 'DFSP CA / Download Hub Certificate'; + +export interface DFSPCertificateAuthorityPayload { + payload: string | undefined; +} + +export interface SubmitDFSPCAAction { + type: typeof SUBMIT_DFSP_CA; + payload: DFSPCertificateAuthorityPayload; +} + +export interface ChangeCertificateAction { + type: typeof SUBMIT_DFSP_CA; + payload: DFSPCertificateAuthorityPayload; +} + +export interface ResetDFPCAAction { + type: typeof RESET_DFSP_CA; +} + +export interface RequestDFPCAAction { + type: typeof REQUEST_DFSP_CA; +} + +export interface SetDFSPCAErrorAction { + type: typeof SET_DFSP_CA_ERROR; + error: string; +} + +export interface SetDFSPCARootCertificateAction { + type: typeof SET_DFSP_CA_ROOT_CERTIFICATE; + certificate: string; +} + +export interface SetDFSPCAIntermediateChainAction { + type: typeof SET_DFSP_CA_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface SetDFSPCAValidationsAction { + type: typeof SET_DFSP_CA_VALIDATIONS; + validations: CertificateValidationResults[]; +} + +export interface SetDFSPCAValidationsStateAction { + type: typeof SET_DFSP_CA_VALIDATION_STATE; + validationState: string | undefined; +} + +export interface ChangeDFSPCARootCertificateAction { + type: typeof CHANGE_DFSP_CA_ROOT_CERTIFICATE; + certificate: string; +} + +export interface ChangeDFSPCARootIntermediateChainAction { + type: typeof CHANGE_DFSP_CA_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface ShowDFSPCARootCertificateModalAction { + type: typeof SHOW_DFSP_CA_ROOT_CERTIFICATE_MODAL; +} + +export interface HideDFSPCARootCertificateModalAction { + type: typeof HIDE_DFSP_CA_ROOT_CERTIFICATE_MODAL; +} + +export interface DownloadDFSPCARootCertificateAction { + type: typeof DOWNLOAD_DFSP_CA_ROOT_CERTIFICATE; +} + +export interface ShowDFSPCAIntermediateChainModalAction { + type: typeof SHOW_DFSP_CA_INTERMEDIATE_CHAIN_MODAL; +} + +export interface HideDFSPCAIntermediateChainModalAction { + type: typeof HIDE_DFSP_CA_INTERMEDIATE_CHAIN_MODAL; +} + +export interface DownloadDFSPCAIntermediateChainAction { + type: typeof DOWNLOAD_DFSP_CA_INTERMEDIATE_CHAIN; +} + +export interface ChangeAndSubmitDFSPCARootCertificateAction { + type: typeof CHANGE_AND_SUBMIT_DFSP_CA_ROOT_CERTIFICATE; + certificate: string; +} + +export interface ChangeAndSubmitDFSPCARootIntermediateChainAction { + type: typeof CHANGE_AND_SUBMIT_DFSP_CA_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface AutoGenerateDFSPCACertificateAction { + type: typeof SET_AUTO_GENERATE_DFSP_CA_CERTIFICATE; + certificate: string; +} + +export interface SetDFSPCAHubCertificateAction { + type: typeof SET_DFSP_CA_HUB_CERTIFICATE; + certificate: string; +} + +export interface SetDFSPCAHubCertificateErrorAction { + type: typeof SET_DFSP_CA_HUB_CERTIFICATE_ERROR; + error: string; +} + +export interface RequestDFSPCAHubCertificateModalAction { + type: typeof REQUEST_DFSP_CA_HUB_CERTIFICATE; +} + +export interface ShowDFSPCAHubCertificateModalAction { + type: typeof SHOW_DFSP_CA_HUB_CERTIFICATE_MODAL; +} + +export interface HideDFSPCAHubCertificateModalAction { + type: typeof HIDE_DFSP_CA_HUB_CERTIFICATE_MODAL; +} + +export interface DownloadDFSPCAHubCertificateAction { + type: typeof DOWNLOAD_DFSP_CA_HUB_CERTIFICATE; +} + +export type DFSPCertificateAuthorityActionTypes = + | ResetDFPCAAction + | SetDFSPCAErrorAction + | RequestDFPCAAction + | SetDFSPCARootCertificateAction + | SetDFSPCAIntermediateChainAction + | SetDFSPCAValidationsAction + | SetDFSPCAValidationsStateAction + | ChangeDFSPCARootCertificateAction + | ChangeDFSPCARootIntermediateChainAction + | ShowDFSPCARootCertificateModalAction + | HideDFSPCARootCertificateModalAction + | ShowDFSPCAIntermediateChainModalAction + | HideDFSPCAIntermediateChainModalAction + | DownloadDFSPCARootCertificateAction + | ChangeAndSubmitDFSPCARootCertificateAction + | ChangeAndSubmitDFSPCARootIntermediateChainAction + | AutoGenerateDFSPCACertificateAction + | RequestDFSPCAHubCertificateModalAction + | SetDFSPCAHubCertificateAction + | SetDFSPCAHubCertificateErrorAction + | ShowDFSPCAHubCertificateModalAction + | HideDFSPCAHubCertificateModalAction + | DownloadDFSPCAHubCertificateAction; + +export interface DFSPCertificateAuthorityState { + dfspName?: string; + dfspCaError?: string; + dfspCaRootCert?: string; + dfspCaIntermediateChain?: string; + dfspCaHubCert?: string; + dfspCaValidations: CertificateValidationResults[]; + dfspCaValidationState?: string; + isDfspCaRootCertificateModalVisible: boolean; + isDfspCaIntermediateChainModalVisible: boolean; + isDfspCaHubCertificateModalVisible: boolean; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.css index 9d6492f..5d5642b 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.css @@ -1,76 +1,76 @@ -.egress____buttons { - margin-bottom: 20px; - display: flex; - align-items: flex-start; - flex-direction: row; -} -.egress____button { - margin-right: 10px; - width: 250px; -} - -.egress__url__container { - padding: 5px; -} -.egress__url { - padding-bottom: 10px; - margin-bottom: 7px; - width: 415px; - margin-left: 50px; -} -.egress__url__status__container { - margin-top: 5px; -} -.egress__ip__row { - display: flex; - flex-direction: row; - align-items: flex-start; - justify-content: flex-start; - border-bottom: 2px solid #eee; - padding-bottom: 10px; - margin-bottom: 10px; -} -.egress__ip__controls { - margin-left: 10px; -} -.egress__ip__fields { - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; -} -.egress__ip__remove { - margin: 10px; - margin-top: 18px; - fill: #c33; -} -.egress__ip__address__container { - margin: 5px; -} -.egress__ip__address { - width: 250px; -} -.egress__ip__port__container { - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - margin: 0px 5px; - padding: 5px; - background: #f4f4f4; - border-radius: 5px; -} -.egress__ip__port { - width: 150px; -} -.egress__ip__port-add { - margin-left: 5px; -} -.egress__ip__port-remove { - margin-left: 5px; - fill: #c33; -} - -.egress__status__container { - margin-left: 5px; -} +.egress____buttons { + margin-bottom: 20px; + display: flex; + align-items: flex-start; + flex-direction: row; +} +.egress____button { + margin-right: 10px; + width: 250px; +} + +.egress__url__container { + padding: 5px; +} +.egress__url { + padding-bottom: 10px; + margin-bottom: 7px; + width: 415px; + margin-left: 50px; +} +.egress__url__status__container { + margin-top: 5px; +} +.egress__ip__row { + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + border-bottom: 2px solid #eee; + padding-bottom: 10px; + margin-bottom: 10px; +} +.egress__ip__controls { + margin-left: 10px; +} +.egress__ip__fields { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; +} +.egress__ip__remove { + margin: 10px; + margin-top: 18px; + fill: #c33; +} +.egress__ip__address__container { + margin: 5px; +} +.egress__ip__address { + width: 250px; +} +.egress__ip__port__container { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + margin: 0px 5px; + padding: 5px; + background: #f4f4f4; + border-radius: 5px; +} +.egress__ip__port { + width: 150px; +} +.egress__ip__port-add { + margin-left: 5px; +} +.egress__ip__port-remove { + margin-left: 5px; + fill: #c33; +} + +.egress__status__container { + margin-left: 5px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.tsx index 3c05a38..b409f58 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/Egress.tsx @@ -1,254 +1,254 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { - AnimateFadeIn, - Button, - ControlIcon, - FormInput, - MessageBox, - Spinner, - Status, -} from 'components'; -import { State, Dispatch } from 'store/types'; -import { withMount } from 'utils/hocs'; -import { States } from '../types'; -import { - getEgressError, - getEgressIps, - getEgressIpsValidationResult, - getIsEgressPending, - getIsEgressSubmitEnabled, - getIsEgressSubmitPending, - getIsEgressChanged, -} from './selectors'; -import { - requestEgressEndpoints, - addEgressIp, - removeEgressIp, - changeEgressAddress, - changeEgressPort, - addEgressPort, - removeEgressPort, - submitEgressEndpoints, - undoEgressChanges, -} from './actions'; - -import { EgressIP } from './types'; -import './Egress.css'; - -const stateProps = (state: State) => ({ - error: getEgressError(state), - ips: getEgressIps(state), - ipsValidation: getEgressIpsValidationResult(state), - isPending: getIsEgressPending(state), - isSubmitEnabled: getIsEgressSubmitEnabled(state), - isSubmitPending: getIsEgressSubmitPending(state), - isChanged: getIsEgressChanged(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(requestEgressEndpoints()), - onAddIpClick: () => dispatch(addEgressIp()), - onChangeAddress: (address: string, index: number) => - dispatch(changeEgressAddress({ address, index })), - onChangePort: (port: string, portIndex: number, index: number) => - dispatch(changeEgressPort({ port, portIndex, index })), - onAddPortClick: (index: number) => dispatch(addEgressPort({ index })), - onRemovePortClick: (portIndex: number, index: number) => - dispatch(removeEgressPort({ portIndex, index })), - onRemoveIpClick: (index: number) => dispatch(removeEgressIp({ index })), - onSubmitClick: () => dispatch(submitEgressEndpoints()), - onUndoClick: () => dispatch(undoEgressChanges()), -}); - -interface EgressProps { - error: boolean; - ips: EgressIP[]; - // TODO: Find correct validation - // eslint-disable-next-line - ipsValidation: any; - isPending: boolean; - isSubmitEnabled: boolean; - isSubmitPending: boolean; - isChanged: boolean; - onMount: () => null; - onAddIpClick: () => null; - onChangeAddress: (address: string, index: number) => null; - onChangePort: (port: string, portIndex: number, index: number) => null; - onAddPortClick: (index: number) => null; - onRemovePortClick: (portIndex: number, index: number) => null; - onRemoveIpClick: (index: number) => null; - onSubmitClick: () => null; - onUndoClick: () => null; -} -const Egress: FC = ({ - error, - ips, - ipsValidation, - isPending, - isSubmitEnabled, - isSubmitPending, - isChanged, - onAddIpClick, - onChangeAddress, - onChangePort, - onAddPortClick, - onRemovePortClick, - onRemoveIpClick, - onSubmitClick, - onUndoClick, -}) => { - if (isPending) { - return ; - } - if (error) { - return ( - - ); - } - return ( -
-
-
- {ips.map((egressIp, index) => ( - - - - ))} -
- ); -}; - -interface EgressIPProps { - index: number; - state: States; - address?: string; - ports: (string | undefined)[]; - // TODO: Find correct validation - // eslint-disable-next-line - validation: any; - onChangeAddress: (address: string, index: number) => null; - onChangePort: (port: string, portIndex: number, index: number) => null; - onAddPort: (index: number) => null; - onRemovePort: (portIndex: number, index: number) => null; - onRemoveIp: (index: number) => null; -} -const EgressIp: FC = ({ - index, - state, - address, - ports, - validation, - onChangeAddress, - onChangePort, - onAddPort, - onRemovePort, - onRemoveIp, -}) => ( -
-
- onRemoveIp(index)} - disabled={index === 0} - /> -
-
-
-
-
- onChangeAddress(addressValue, index)} - validation={validation[index].address} - /> -
-
- {ports.map((port, portIndex) => ( -
-
- onChangePort(value, portIndex, index)} - validation={validation[index].ports[portIndex]} - /> -
- {portIndex > 0 && ( -
- onRemovePort(portIndex, index)} - disabled={portIndex === 0} - /> -
- )} -
- ))} -
-
- -
-
-
-); - -const MountedEgress = withMount(Egress, 'onMount'); - -export default connect(stateProps, actionProps)(MountedEgress); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { + AnimateFadeIn, + Button, + ControlIcon, + FormInput, + MessageBox, + Spinner, + Status, +} from 'components'; +import { State, Dispatch } from 'store/types'; +import { withMount } from 'utils/hocs'; +import { States } from '../types'; +import { + getEgressError, + getEgressIps, + getEgressIpsValidationResult, + getIsEgressPending, + getIsEgressSubmitEnabled, + getIsEgressSubmitPending, + getIsEgressChanged, +} from './selectors'; +import { + requestEgressEndpoints, + addEgressIp, + removeEgressIp, + changeEgressAddress, + changeEgressPort, + addEgressPort, + removeEgressPort, + submitEgressEndpoints, + undoEgressChanges, +} from './actions'; + +import { EgressIP } from './types'; +import './Egress.css'; + +const stateProps = (state: State) => ({ + error: getEgressError(state), + ips: getEgressIps(state), + ipsValidation: getEgressIpsValidationResult(state), + isPending: getIsEgressPending(state), + isSubmitEnabled: getIsEgressSubmitEnabled(state), + isSubmitPending: getIsEgressSubmitPending(state), + isChanged: getIsEgressChanged(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(requestEgressEndpoints()), + onAddIpClick: () => dispatch(addEgressIp()), + onChangeAddress: (address: string, index: number) => + dispatch(changeEgressAddress({ address, index })), + onChangePort: (port: string, portIndex: number, index: number) => + dispatch(changeEgressPort({ port, portIndex, index })), + onAddPortClick: (index: number) => dispatch(addEgressPort({ index })), + onRemovePortClick: (portIndex: number, index: number) => + dispatch(removeEgressPort({ portIndex, index })), + onRemoveIpClick: (index: number) => dispatch(removeEgressIp({ index })), + onSubmitClick: () => dispatch(submitEgressEndpoints()), + onUndoClick: () => dispatch(undoEgressChanges()), +}); + +interface EgressProps { + error: boolean; + ips: EgressIP[]; + // TODO: Find correct validation + // eslint-disable-next-line + ipsValidation: any; + isPending: boolean; + isSubmitEnabled: boolean; + isSubmitPending: boolean; + isChanged: boolean; + onMount: () => null; + onAddIpClick: () => null; + onChangeAddress: (address: string, index: number) => null; + onChangePort: (port: string, portIndex: number, index: number) => null; + onAddPortClick: (index: number) => null; + onRemovePortClick: (portIndex: number, index: number) => null; + onRemoveIpClick: (index: number) => null; + onSubmitClick: () => null; + onUndoClick: () => null; +} +const Egress: FC = ({ + error, + ips, + ipsValidation, + isPending, + isSubmitEnabled, + isSubmitPending, + isChanged, + onAddIpClick, + onChangeAddress, + onChangePort, + onAddPortClick, + onRemovePortClick, + onRemoveIpClick, + onSubmitClick, + onUndoClick, +}) => { + if (isPending) { + return ; + } + if (error) { + return ( + + ); + } + return ( +
+
+
+ {ips.map((egressIp, index) => ( + + + + ))} +
+ ); +}; + +interface EgressIPProps { + index: number; + state: States; + address?: string; + ports: (string | undefined)[]; + // TODO: Find correct validation + // eslint-disable-next-line + validation: any; + onChangeAddress: (address: string, index: number) => null; + onChangePort: (port: string, portIndex: number, index: number) => null; + onAddPort: (index: number) => null; + onRemovePort: (portIndex: number, index: number) => null; + onRemoveIp: (index: number) => null; +} +const EgressIp: FC = ({ + index, + state, + address, + ports, + validation, + onChangeAddress, + onChangePort, + onAddPort, + onRemovePort, + onRemoveIp, +}) => ( +
+
+ onRemoveIp(index)} + disabled={index === 0} + /> +
+
+
+
+
+ onChangeAddress(addressValue, index)} + validation={validation[index].address} + /> +
+
+ {ports.map((port, portIndex) => ( +
+
+ onChangePort(value, portIndex, index)} + validation={validation[index].ports[portIndex]} + /> +
+ {portIndex > 0 && ( +
+ onRemovePort(portIndex, index)} + disabled={portIndex === 0} + /> +
+ )} +
+ ))} +
+
+ +
+
+
+); + +const MountedEgress = withMount(Egress, 'onMount'); + +export default connect(stateProps, actionProps)(MountedEgress); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/_mockData.js index b8fe23e..0e29f82 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/_mockData.js @@ -1,12 +1,12 @@ -import { States } from '../types'; - -export const egressIps = [ - { - id: '123123', - state: States.New, - value: { - address: '192.156.22.22', - ports: ['9090'], - }, - }, -]; +import { States } from '../types'; + +export const egressIps = [ + { + id: '123123', + state: States.New, + value: { + address: '192.156.22.22', + ports: ['9090'], + }, + }, +]; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/actions.ts index 6232df6..b3b0e0a 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/actions.ts @@ -1,122 +1,122 @@ -import { ErrorMessage } from 'App/types'; - -import { - RequestEgressEndpointsAction, - SubmitEgressEndpointsAction, - ResetEgressAction, - SetEgressIpsAction, - SetEgressIpsErrorAction, - ChangeEgressAddressAction, - ChangeEgressPortAction, - AddEgressIpAction, - RemoveEgressIpAction, - AddEgressPortAction, - RemoveEgressPortAction, - UndoEgressChangesAction, - REQUEST_EGRESS_ENDPOINTS, - SUBMIT_EGRESS_ENDPOINTS, - RESET_EGRESS_ENDPOINT, - SET_EGRESS_ENDPOINT_IPS, - SET_EGRESS_ENDPOINT_IPS_ERROR, - CHANGE_EGRESS_ENDPOINT_ADDRESS, - CHANGE_EGRESS_ENDPOINT_PORT, - ADD_EGRESS_ENDPOINT_IP, - REMOVE_EGRESS_ENDPOINT_IP, - ADD_EGRESS_ENDPOINT_PORT, - REMOVE_EGRESS_ENDPOINT_PORT, - UNDO_EGRESS_ENDPOINT_CHANGES, - EgressIP, -} from './types'; - -export function requestEgressEndpoints(): RequestEgressEndpointsAction { - return { - type: REQUEST_EGRESS_ENDPOINTS, - }; -} -export function submitEgressEndpoints(): SubmitEgressEndpointsAction { - return { - type: SUBMIT_EGRESS_ENDPOINTS, - }; -} -export function resetEgress(): ResetEgressAction { - return { - type: RESET_EGRESS_ENDPOINT, - }; -} -export function setEgressIps({ ips }: { ips: EgressIP[] }): SetEgressIpsAction { - return { - type: SET_EGRESS_ENDPOINT_IPS, - ips, - }; -} -export function setEgressIpsError({ error }: { error: ErrorMessage }): SetEgressIpsErrorAction { - return { - type: SET_EGRESS_ENDPOINT_IPS_ERROR, - error, - }; -} - -export function changeEgressAddress({ - index, - address, -}: { - address: string; - index: number; -}): ChangeEgressAddressAction { - return { - type: CHANGE_EGRESS_ENDPOINT_ADDRESS, - index, - address, - }; -} -export function changeEgressPort({ - index, - port, - portIndex, -}: { - index: number; - port: string; - portIndex: number; -}): ChangeEgressPortAction { - return { - type: CHANGE_EGRESS_ENDPOINT_PORT, - index, - port, - portIndex, - }; -} -export function addEgressIp(): AddEgressIpAction { - return { - type: ADD_EGRESS_ENDPOINT_IP, - }; -} -export function removeEgressIp({ index }: { index: number }): RemoveEgressIpAction { - return { - type: REMOVE_EGRESS_ENDPOINT_IP, - index, - }; -} -export function addEgressPort({ index }: { index: number }): AddEgressPortAction { - return { - type: ADD_EGRESS_ENDPOINT_PORT, - index, - }; -} -export function removeEgressPort({ - index, - portIndex, -}: { - index: number; - portIndex: number; -}): RemoveEgressPortAction { - return { - type: REMOVE_EGRESS_ENDPOINT_PORT, - index, - portIndex, - }; -} -export function undoEgressChanges(): UndoEgressChangesAction { - return { - type: UNDO_EGRESS_ENDPOINT_CHANGES, - }; -} +import { ErrorMessage } from 'App/types'; + +import { + RequestEgressEndpointsAction, + SubmitEgressEndpointsAction, + ResetEgressAction, + SetEgressIpsAction, + SetEgressIpsErrorAction, + ChangeEgressAddressAction, + ChangeEgressPortAction, + AddEgressIpAction, + RemoveEgressIpAction, + AddEgressPortAction, + RemoveEgressPortAction, + UndoEgressChangesAction, + REQUEST_EGRESS_ENDPOINTS, + SUBMIT_EGRESS_ENDPOINTS, + RESET_EGRESS_ENDPOINT, + SET_EGRESS_ENDPOINT_IPS, + SET_EGRESS_ENDPOINT_IPS_ERROR, + CHANGE_EGRESS_ENDPOINT_ADDRESS, + CHANGE_EGRESS_ENDPOINT_PORT, + ADD_EGRESS_ENDPOINT_IP, + REMOVE_EGRESS_ENDPOINT_IP, + ADD_EGRESS_ENDPOINT_PORT, + REMOVE_EGRESS_ENDPOINT_PORT, + UNDO_EGRESS_ENDPOINT_CHANGES, + EgressIP, +} from './types'; + +export function requestEgressEndpoints(): RequestEgressEndpointsAction { + return { + type: REQUEST_EGRESS_ENDPOINTS, + }; +} +export function submitEgressEndpoints(): SubmitEgressEndpointsAction { + return { + type: SUBMIT_EGRESS_ENDPOINTS, + }; +} +export function resetEgress(): ResetEgressAction { + return { + type: RESET_EGRESS_ENDPOINT, + }; +} +export function setEgressIps({ ips }: { ips: EgressIP[] }): SetEgressIpsAction { + return { + type: SET_EGRESS_ENDPOINT_IPS, + ips, + }; +} +export function setEgressIpsError({ error }: { error: ErrorMessage }): SetEgressIpsErrorAction { + return { + type: SET_EGRESS_ENDPOINT_IPS_ERROR, + error, + }; +} + +export function changeEgressAddress({ + index, + address, +}: { + address: string; + index: number; +}): ChangeEgressAddressAction { + return { + type: CHANGE_EGRESS_ENDPOINT_ADDRESS, + index, + address, + }; +} +export function changeEgressPort({ + index, + port, + portIndex, +}: { + index: number; + port: string; + portIndex: number; +}): ChangeEgressPortAction { + return { + type: CHANGE_EGRESS_ENDPOINT_PORT, + index, + port, + portIndex, + }; +} +export function addEgressIp(): AddEgressIpAction { + return { + type: ADD_EGRESS_ENDPOINT_IP, + }; +} +export function removeEgressIp({ index }: { index: number }): RemoveEgressIpAction { + return { + type: REMOVE_EGRESS_ENDPOINT_IP, + index, + }; +} +export function addEgressPort({ index }: { index: number }): AddEgressPortAction { + return { + type: ADD_EGRESS_ENDPOINT_PORT, + index, + }; +} +export function removeEgressPort({ + index, + portIndex, +}: { + index: number; + portIndex: number; +}): RemoveEgressPortAction { + return { + type: REMOVE_EGRESS_ENDPOINT_PORT, + index, + portIndex, + }; +} +export function undoEgressChanges(): UndoEgressChangesAction { + return { + type: UNDO_EGRESS_ENDPOINT_CHANGES, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/index.ts index d34f57a..74d354c 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/index.ts @@ -1,9 +1,9 @@ -import Egress from './Egress'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default Egress; -export { actions, reducer, selectors, types, sagas }; +import Egress from './Egress'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default Egress; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/models.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/models.ts index 2ea95d5..97e04db 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/models.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/models.ts @@ -1,17 +1,17 @@ -import { ExternalEgressIP, EgressIP } from './types'; - -const apiToIpModel = (ip: ExternalEgressIP): EgressIP => ({ - id: ip.id, - state: ip.state, - address: ip.value.address, - ports: ip.value.ports, -}); - -const ipToApiModel = (ip: EgressIP): Partial => ({ - value: { - address: ip.address, - ports: ip.ports, - }, -}); - -export { apiToIpModel, ipToApiModel }; +import { ExternalEgressIP, EgressIP } from './types'; + +const apiToIpModel = (ip: ExternalEgressIP): EgressIP => ({ + id: ip.id, + state: ip.state, + address: ip.value.address, + ports: ip.value.ports, +}); + +const ipToApiModel = (ip: EgressIP): Partial => ({ + value: { + address: ip.address, + ports: ip.ports, + }, +}); + +export { apiToIpModel, ipToApiModel }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/reducers.ts index fc3ea87..d7a5c9b 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/reducers.ts @@ -1,146 +1,146 @@ -import isEqual from 'lodash/isEqual'; -import { States } from '../types'; -import { - RESET_EGRESS_ENDPOINT, - SET_EGRESS_ENDPOINT_IPS, - SET_EGRESS_ENDPOINT_IPS_ERROR, - CHANGE_EGRESS_ENDPOINT_ADDRESS, - CHANGE_EGRESS_ENDPOINT_PORT, - ADD_EGRESS_ENDPOINT_IP, - REMOVE_EGRESS_ENDPOINT_IP, - ADD_EGRESS_ENDPOINT_PORT, - REMOVE_EGRESS_ENDPOINT_PORT, - UNDO_EGRESS_ENDPOINT_CHANGES, - EgressIP, - EgressActionTypes, - EgressState, -} from './types'; - -const initialEgressIp: EgressIP = { - id: undefined, - state: States.Unset, - address: undefined, - ports: [undefined], -}; -const initialState: EgressState = { - previousEgressIps: [initialEgressIp], - egressIpsError: null, - egressIps: [initialEgressIp], -}; - -export default function egressReducer( - state = initialState, - action: EgressActionTypes -): EgressState { - switch (action.type) { - case RESET_EGRESS_ENDPOINT: { - return initialState; - } - case SET_EGRESS_ENDPOINT_IPS: { - // we should set an empty ip structure - // if the dfsp has no ips set - let { ips } = action; - if (isEqual(ips, [])) { - ips = [initialEgressIp]; - } - return { - ...state, - previousEgressIps: ips, - egressIps: ips, - }; - } - case SET_EGRESS_ENDPOINT_IPS_ERROR: { - return { - ...state, - egressIpsError: action.error, - }; - } - case CHANGE_EGRESS_ENDPOINT_ADDRESS: { - const { address, index } = action; - return { - ...state, - egressIps: [ - ...state.egressIps.slice(0, index), - { - ...state.egressIps[index], - address, - }, - ...state.egressIps.slice(index + 1), - ], - }; - } - case CHANGE_EGRESS_ENDPOINT_PORT: { - const { port, index, portIndex } = action; - return { - ...state, - egressIps: [ - ...state.egressIps.slice(0, index), - { - ...state.egressIps[index], - ports: [ - ...state.egressIps[index].ports.slice(0, portIndex), - port, - ...state.egressIps[index].ports.slice(portIndex + 1), - ], - }, - ...state.egressIps.slice(index + 1), - ], - }; - } - case ADD_EGRESS_ENDPOINT_IP: { - return { - ...state, - egressIps: [...state.egressIps, initialEgressIp], - }; - } - case REMOVE_EGRESS_ENDPOINT_IP: { - const { index } = action; - return { - ...state, - egressIps: [...state.egressIps.slice(0, index), ...state.egressIps.slice(index + 1)], - }; - } - case ADD_EGRESS_ENDPOINT_PORT: { - const { index } = action; - return { - ...state, - egressIps: [ - ...state.egressIps.slice(0, index), - { - ...state.egressIps[index], - ports: [...state.egressIps[index].ports, undefined], - }, - ...state.egressIps.slice(index + 1), - ], - }; - } - case REMOVE_EGRESS_ENDPOINT_PORT: { - const { portIndex, index } = action; - return { - ...state, - egressIps: [ - ...state.egressIps.slice(0, index), - { - ...state.egressIps[index], - ports: [ - ...state.egressIps[index].ports.slice(0, portIndex), - ...state.egressIps[index].ports.slice(portIndex + 1), - ], - }, - ...state.egressIps.slice(index + 1), - ], - }; - } - case UNDO_EGRESS_ENDPOINT_CHANGES: { - return { - ...state, - egressIps: [...state.previousEgressIps], - }; - } - default: { - return state; - } - } -} - -export { initialState, initialEgressIp }; +import isEqual from 'lodash/isEqual'; +import { States } from '../types'; +import { + RESET_EGRESS_ENDPOINT, + SET_EGRESS_ENDPOINT_IPS, + SET_EGRESS_ENDPOINT_IPS_ERROR, + CHANGE_EGRESS_ENDPOINT_ADDRESS, + CHANGE_EGRESS_ENDPOINT_PORT, + ADD_EGRESS_ENDPOINT_IP, + REMOVE_EGRESS_ENDPOINT_IP, + ADD_EGRESS_ENDPOINT_PORT, + REMOVE_EGRESS_ENDPOINT_PORT, + UNDO_EGRESS_ENDPOINT_CHANGES, + EgressIP, + EgressActionTypes, + EgressState, +} from './types'; + +const initialEgressIp: EgressIP = { + id: undefined, + state: States.Unset, + address: undefined, + ports: [undefined], +}; +const initialState: EgressState = { + previousEgressIps: [initialEgressIp], + egressIpsError: null, + egressIps: [initialEgressIp], +}; + +export default function egressReducer( + state = initialState, + action: EgressActionTypes +): EgressState { + switch (action.type) { + case RESET_EGRESS_ENDPOINT: { + return initialState; + } + case SET_EGRESS_ENDPOINT_IPS: { + // we should set an empty ip structure + // if the dfsp has no ips set + let { ips } = action; + if (isEqual(ips, [])) { + ips = [initialEgressIp]; + } + return { + ...state, + previousEgressIps: ips, + egressIps: ips, + }; + } + case SET_EGRESS_ENDPOINT_IPS_ERROR: { + return { + ...state, + egressIpsError: action.error, + }; + } + case CHANGE_EGRESS_ENDPOINT_ADDRESS: { + const { address, index } = action; + return { + ...state, + egressIps: [ + ...state.egressIps.slice(0, index), + { + ...state.egressIps[index], + address, + }, + ...state.egressIps.slice(index + 1), + ], + }; + } + case CHANGE_EGRESS_ENDPOINT_PORT: { + const { port, index, portIndex } = action; + return { + ...state, + egressIps: [ + ...state.egressIps.slice(0, index), + { + ...state.egressIps[index], + ports: [ + ...state.egressIps[index].ports.slice(0, portIndex), + port, + ...state.egressIps[index].ports.slice(portIndex + 1), + ], + }, + ...state.egressIps.slice(index + 1), + ], + }; + } + case ADD_EGRESS_ENDPOINT_IP: { + return { + ...state, + egressIps: [...state.egressIps, initialEgressIp], + }; + } + case REMOVE_EGRESS_ENDPOINT_IP: { + const { index } = action; + return { + ...state, + egressIps: [...state.egressIps.slice(0, index), ...state.egressIps.slice(index + 1)], + }; + } + case ADD_EGRESS_ENDPOINT_PORT: { + const { index } = action; + return { + ...state, + egressIps: [ + ...state.egressIps.slice(0, index), + { + ...state.egressIps[index], + ports: [...state.egressIps[index].ports, undefined], + }, + ...state.egressIps.slice(index + 1), + ], + }; + } + case REMOVE_EGRESS_ENDPOINT_PORT: { + const { portIndex, index } = action; + return { + ...state, + egressIps: [ + ...state.egressIps.slice(0, index), + { + ...state.egressIps[index], + ports: [ + ...state.egressIps[index].ports.slice(0, portIndex), + ...state.egressIps[index].ports.slice(portIndex + 1), + ], + }, + ...state.egressIps.slice(index + 1), + ], + }; + } + case UNDO_EGRESS_ENDPOINT_CHANGES: { + return { + ...state, + egressIps: [...state.previousEgressIps], + }; + } + default: { + return state; + } + } +} + +export { initialState, initialEgressIp }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/sagas.ts index 3df0b68..9186416 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/sagas.ts @@ -1,82 +1,82 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import apis from 'utils/apis'; -import { is20x } from 'utils/http'; -import { showToast, showErrorModal } from 'App/actions'; -import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { - REQUEST_EGRESS_ENDPOINTS, - SUBMIT_EGRESS_ENDPOINTS, - RequestEgressEndpointsAction, - SubmitEgressEndpointsAction, - EgressIP, -} from './types'; -import { setEgressIps, setEgressIpsError } from './actions'; -import { apiToIpModel, ipToApiModel } from './models'; -import { getIpsOperations } from './selectors'; - -function* fetchEgressEndpointsIps( - action: RequestEgressEndpointsAction | SubmitEgressEndpointsAction -) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.egressIps.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setEgressIps({ ips: response.data.map(apiToIpModel) })); - } else { - yield put(setEgressIpsError({ error: 'Error Fetching Egress Endpoint IPs' })); - } - } catch (e) { - yield put(setEgressIpsError({ error: e.message })); - } -} - -function* fetchEgressEndpoints(action: RequestEgressEndpointsAction | SubmitEgressEndpointsAction) { - yield all([call(fetchEgressEndpointsIps, action)]); -} - -export function* retrieveEgressEndpointsSaga() { - yield takeLatest([REQUEST_EGRESS_ENDPOINTS], fetchEgressEndpoints); -} - -export function* saveEgressEndpoints(action: SubmitEgressEndpointsAction) { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const ipsOperations = getIpsOperations(state); - - const createIpsActions = ipsOperations.create.map((ip: EgressIP) => - call(apis.egressIps.create, { environmentId, body: ipToApiModel(ip) }) - ); - - const updateIpsActions = ipsOperations.update.map((ip: EgressIP) => - call(apis.egressIp.update, { environmentId, ipId: ip.id, body: ipToApiModel(ip) }) - ); - - const deleteIpsActions = ipsOperations.delete.map((ip: EgressIP) => - call(apis.egressIp.delete, { environmentId, ipId: ip.id }) - ); - - try { - const responses = yield all([...createIpsActions, ...updateIpsActions, ...deleteIpsActions]); - - const allSucceeded = responses.every(({ status }: { status: number }) => is20x(status)); - - if (allSucceeded) { - yield put(showToast()); - yield call(fetchEgressEndpoints, action); - } else { - yield put(showErrorModal('There was a problem saving the configuration')); - } - } catch (e) { - yield put(showErrorModal(e.message)); - } -} - -export function* saveEgressEndpointsSaga() { - yield takeLatest([SUBMIT_EGRESS_ENDPOINTS], saveEgressEndpoints); -} - -export default function* rootSaga() { - yield all([retrieveEgressEndpointsSaga(), saveEgressEndpointsSaga()]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import apis from 'utils/apis'; +import { is20x } from 'utils/http'; +import { showToast, showErrorModal } from 'App/actions'; +import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { + REQUEST_EGRESS_ENDPOINTS, + SUBMIT_EGRESS_ENDPOINTS, + RequestEgressEndpointsAction, + SubmitEgressEndpointsAction, + EgressIP, +} from './types'; +import { setEgressIps, setEgressIpsError } from './actions'; +import { apiToIpModel, ipToApiModel } from './models'; +import { getIpsOperations } from './selectors'; + +function* fetchEgressEndpointsIps( + action: RequestEgressEndpointsAction | SubmitEgressEndpointsAction +) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.egressIps.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setEgressIps({ ips: response.data.map(apiToIpModel) })); + } else { + yield put(setEgressIpsError({ error: 'Error Fetching Egress Endpoint IPs' })); + } + } catch (e) { + yield put(setEgressIpsError({ error: e.message })); + } +} + +function* fetchEgressEndpoints(action: RequestEgressEndpointsAction | SubmitEgressEndpointsAction) { + yield all([call(fetchEgressEndpointsIps, action)]); +} + +export function* retrieveEgressEndpointsSaga() { + yield takeLatest([REQUEST_EGRESS_ENDPOINTS], fetchEgressEndpoints); +} + +export function* saveEgressEndpoints(action: SubmitEgressEndpointsAction) { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const ipsOperations = getIpsOperations(state); + + const createIpsActions = ipsOperations.create.map((ip: EgressIP) => + call(apis.egressIps.create, { environmentId, body: ipToApiModel(ip) }) + ); + + const updateIpsActions = ipsOperations.update.map((ip: EgressIP) => + call(apis.egressIp.update, { environmentId, ipId: ip.id, body: ipToApiModel(ip) }) + ); + + const deleteIpsActions = ipsOperations.delete.map((ip: EgressIP) => + call(apis.egressIp.delete, { environmentId, ipId: ip.id }) + ); + + try { + const responses = yield all([...createIpsActions, ...updateIpsActions, ...deleteIpsActions]); + + const allSucceeded = responses.every(({ status }: { status: number }) => is20x(status)); + + if (allSucceeded) { + yield put(showToast()); + yield call(fetchEgressEndpoints, action); + } else { + yield put(showErrorModal('There was a problem saving the configuration')); + } + } catch (e) { + yield put(showErrorModal(e.message)); + } +} + +export function* saveEgressEndpointsSaga() { + yield takeLatest([SUBMIT_EGRESS_ENDPOINTS], saveEgressEndpoints); +} + +export default function* rootSaga() { + yield all([retrieveEgressEndpointsSaga(), saveEgressEndpointsSaga()]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/selectors.ts index 94367bf..eb641d2 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/selectors.ts @@ -1,83 +1,83 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import isEqual from 'lodash/isEqual'; -import find from 'lodash/find'; -import { validate, getIsValid } from '@modusbox/modusbox-ui-components/dist/redux-validation'; -import * as testers from 'utils/testers'; -import { States } from '../types'; -import { getEgressAddressValidation, getEgressPortValidation } from './validators'; - -export const getPreviousEgressIps = (state: State) => - state.wizard.environment.endpoints.egress.previousEgressIps; -export const getEgressIps = (state: State) => state.wizard.environment.endpoints.egress.egressIps; -export const getEgressIpsError = (state: State) => - state.wizard.environment.endpoints.egress.egressIpsError; - -export const getEgressError = createSelector(getEgressIpsError, testers.getAnyIsNotNil); - -export const getEgressIpsValidationResult = createSelector( - getEgressIps, - getEgressAddressValidation, - getEgressPortValidation, - (ips, addressValidation, portValidation) => - ips.map(({ address, ports }) => ({ - address: validate(address, addressValidation), - ports: ports.map((port) => validate(port, portValidation)), - })) -); - -export const getIsEgressIpsValid = createSelector(getEgressIpsValidationResult, (results) => - results.every((result) => getIsValid(result.address) && result.ports.every(getIsValid)) -); - -const getIsEgressIpsChanged = createSelector( - getPreviousEgressIps, - getEgressIps, - testers.isNotEqual -); - -export const getIsEgressChanged = createSelector(getIsEgressIpsChanged, testers.getAnyIs(true)); - -export const getIsEgressSubmitEnabled = createSelector( - getIsEgressIpsValid, - getIsEgressChanged, - testers.getAllAre(true) -); - -export const getIsEgressIpsReadPending = createSelector( - (state: State) => state.api, - isPending('egressIps.read') -); -const getIsEgressIpCreatePending = createSelector( - (state: State) => state.api, - isPending('egressIps.create') -); -const getIsEgressIpEditPending = createSelector( - (state: State) => state.api, - isPending('egressIp.update') -); -const getIsEgressIpDeletePending = createSelector( - (state: State) => state.api, - isPending('egressIp.delete') -); - -export const getIsEgressPending = createSelector(getIsEgressIpsReadPending, testers.getAnyIs(true)); -export const getIsEgressSubmitPending = createSelector( - getIsEgressIpCreatePending, - getIsEgressIpEditPending, - getIsEgressIpDeletePending, - testers.getAnyIs(true) -); - -export const getIpsOperations = createSelector( - getEgressIps, - getPreviousEgressIps, - (ips, previousIps) => ({ - create: ips.filter((ip) => ip.state === States.Unset), - update: ips - .filter((ip) => ip.state !== States.Unset) - .filter((ip) => !isEqual(find(previousIps, { id: ip.id }), ip)), - delete: previousIps.filter((ip) => !find(ips, { id: ip.id })), - }) -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import isEqual from 'lodash/isEqual'; +import find from 'lodash/find'; +import { validate, getIsValid } from '@modusbox/modusbox-ui-components/dist/redux-validation'; +import * as testers from 'utils/testers'; +import { States } from '../types'; +import { getEgressAddressValidation, getEgressPortValidation } from './validators'; + +export const getPreviousEgressIps = (state: State) => + state.wizard.environment.endpoints.egress.previousEgressIps; +export const getEgressIps = (state: State) => state.wizard.environment.endpoints.egress.egressIps; +export const getEgressIpsError = (state: State) => + state.wizard.environment.endpoints.egress.egressIpsError; + +export const getEgressError = createSelector(getEgressIpsError, testers.getAnyIsNotNil); + +export const getEgressIpsValidationResult = createSelector( + getEgressIps, + getEgressAddressValidation, + getEgressPortValidation, + (ips, addressValidation, portValidation) => + ips.map(({ address, ports }) => ({ + address: validate(address, addressValidation), + ports: ports.map((port) => validate(port, portValidation)), + })) +); + +export const getIsEgressIpsValid = createSelector(getEgressIpsValidationResult, (results) => + results.every((result) => getIsValid(result.address) && result.ports.every(getIsValid)) +); + +const getIsEgressIpsChanged = createSelector( + getPreviousEgressIps, + getEgressIps, + testers.isNotEqual +); + +export const getIsEgressChanged = createSelector(getIsEgressIpsChanged, testers.getAnyIs(true)); + +export const getIsEgressSubmitEnabled = createSelector( + getIsEgressIpsValid, + getIsEgressChanged, + testers.getAllAre(true) +); + +export const getIsEgressIpsReadPending = createSelector( + (state: State) => state.api, + isPending('egressIps.read') +); +const getIsEgressIpCreatePending = createSelector( + (state: State) => state.api, + isPending('egressIps.create') +); +const getIsEgressIpEditPending = createSelector( + (state: State) => state.api, + isPending('egressIp.update') +); +const getIsEgressIpDeletePending = createSelector( + (state: State) => state.api, + isPending('egressIp.delete') +); + +export const getIsEgressPending = createSelector(getIsEgressIpsReadPending, testers.getAnyIs(true)); +export const getIsEgressSubmitPending = createSelector( + getIsEgressIpCreatePending, + getIsEgressIpEditPending, + getIsEgressIpDeletePending, + testers.getAnyIs(true) +); + +export const getIpsOperations = createSelector( + getEgressIps, + getPreviousEgressIps, + (ips, previousIps) => ({ + create: ips.filter((ip) => ip.state === States.Unset), + update: ips + .filter((ip) => ip.state !== States.Unset) + .filter((ip) => !isEqual(find(previousIps, { id: ip.id }), ip)), + delete: previousIps.filter((ip) => !find(ips, { id: ip.id })), + }) +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/types.ts index babb454..ad17e1b 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/types.ts @@ -1,97 +1,97 @@ -import { States } from '../types'; - -export const REQUEST_EGRESS_ENDPOINTS = 'Egress Endpoint / Request endpoints'; -export const SUBMIT_EGRESS_ENDPOINTS = 'Egress Endpoint / Submit endpoints'; -export const RESET_EGRESS_ENDPOINT = 'Egress Endpoint / Reset'; -export const SET_EGRESS_ENDPOINT_IPS = 'Egress Endpoint / Set Ips'; -export const SET_EGRESS_ENDPOINT_IPS_ERROR = 'Egress Endpoint / Set Ips Error'; -export const CHANGE_EGRESS_ENDPOINT_ADDRESS = 'Egress Endpoint / Change IP'; -export const CHANGE_EGRESS_ENDPOINT_PORT = 'Egress Endpoint / Change Port'; -export const ADD_EGRESS_ENDPOINT_IP = 'Egress Endpoint / Add Configuration'; -export const REMOVE_EGRESS_ENDPOINT_IP = 'Egress Endpoint / Remove Configuration'; -export const ADD_EGRESS_ENDPOINT_PORT = 'Egress Endpoint / Add Port'; -export const REMOVE_EGRESS_ENDPOINT_PORT = 'Egress Endpoint / Remove Port'; -export const UNDO_EGRESS_ENDPOINT_CHANGES = 'Egress Endpoint / Undo Changes'; - -export interface ExternalEgressIP { - id?: string; - state: States; - value: { - address?: string; - ports: (string | undefined)[]; - }; -} - -export interface EgressIP { - id?: string; - state: States; - address?: string; - ports: (string | undefined)[]; -} - -export interface EgressState { - previousEgressIps: EgressIP[]; - egressIpsError: string | null; - egressIps: EgressIP[]; -} - -export interface RequestEgressEndpointsAction { - type: typeof REQUEST_EGRESS_ENDPOINTS; -} -export interface SubmitEgressEndpointsAction { - type: typeof SUBMIT_EGRESS_ENDPOINTS; -} -export interface ResetEgressAction { - type: typeof RESET_EGRESS_ENDPOINT; -} -export interface SetEgressIpsAction { - type: typeof SET_EGRESS_ENDPOINT_IPS; - ips: EgressIP[]; -} -export interface SetEgressIpsErrorAction { - type: typeof SET_EGRESS_ENDPOINT_IPS_ERROR; - error: string | null; -} -export interface ChangeEgressAddressAction { - type: typeof CHANGE_EGRESS_ENDPOINT_ADDRESS; - address: string; - index: number; -} -export interface ChangeEgressPortAction { - type: typeof CHANGE_EGRESS_ENDPOINT_PORT; - port: string; - index: number; - portIndex: number; -} -export interface AddEgressIpAction { - type: typeof ADD_EGRESS_ENDPOINT_IP; -} -export interface RemoveEgressIpAction { - type: typeof REMOVE_EGRESS_ENDPOINT_IP; - index: number; -} -export interface AddEgressPortAction { - type: typeof ADD_EGRESS_ENDPOINT_PORT; - index: number; -} -export interface RemoveEgressPortAction { - type: typeof REMOVE_EGRESS_ENDPOINT_PORT; - index: number; - portIndex: number; -} -export interface UndoEgressChangesAction { - type: typeof UNDO_EGRESS_ENDPOINT_CHANGES; -} - -export type EgressActionTypes = - | RequestEgressEndpointsAction - | ResetEgressAction - | SetEgressIpsAction - | SetEgressIpsErrorAction - | ChangeEgressAddressAction - | ChangeEgressPortAction - | AddEgressIpAction - | RemoveEgressIpAction - | AddEgressPortAction - | RemoveEgressPortAction - | UndoEgressChangesAction; +import { States } from '../types'; + +export const REQUEST_EGRESS_ENDPOINTS = 'Egress Endpoint / Request endpoints'; +export const SUBMIT_EGRESS_ENDPOINTS = 'Egress Endpoint / Submit endpoints'; +export const RESET_EGRESS_ENDPOINT = 'Egress Endpoint / Reset'; +export const SET_EGRESS_ENDPOINT_IPS = 'Egress Endpoint / Set Ips'; +export const SET_EGRESS_ENDPOINT_IPS_ERROR = 'Egress Endpoint / Set Ips Error'; +export const CHANGE_EGRESS_ENDPOINT_ADDRESS = 'Egress Endpoint / Change IP'; +export const CHANGE_EGRESS_ENDPOINT_PORT = 'Egress Endpoint / Change Port'; +export const ADD_EGRESS_ENDPOINT_IP = 'Egress Endpoint / Add Configuration'; +export const REMOVE_EGRESS_ENDPOINT_IP = 'Egress Endpoint / Remove Configuration'; +export const ADD_EGRESS_ENDPOINT_PORT = 'Egress Endpoint / Add Port'; +export const REMOVE_EGRESS_ENDPOINT_PORT = 'Egress Endpoint / Remove Port'; +export const UNDO_EGRESS_ENDPOINT_CHANGES = 'Egress Endpoint / Undo Changes'; + +export interface ExternalEgressIP { + id?: string; + state: States; + value: { + address?: string; + ports: (string | undefined)[]; + }; +} + +export interface EgressIP { + id?: string; + state: States; + address?: string; + ports: (string | undefined)[]; +} + +export interface EgressState { + previousEgressIps: EgressIP[]; + egressIpsError: string | null; + egressIps: EgressIP[]; +} + +export interface RequestEgressEndpointsAction { + type: typeof REQUEST_EGRESS_ENDPOINTS; +} +export interface SubmitEgressEndpointsAction { + type: typeof SUBMIT_EGRESS_ENDPOINTS; +} +export interface ResetEgressAction { + type: typeof RESET_EGRESS_ENDPOINT; +} +export interface SetEgressIpsAction { + type: typeof SET_EGRESS_ENDPOINT_IPS; + ips: EgressIP[]; +} +export interface SetEgressIpsErrorAction { + type: typeof SET_EGRESS_ENDPOINT_IPS_ERROR; + error: string | null; +} +export interface ChangeEgressAddressAction { + type: typeof CHANGE_EGRESS_ENDPOINT_ADDRESS; + address: string; + index: number; +} +export interface ChangeEgressPortAction { + type: typeof CHANGE_EGRESS_ENDPOINT_PORT; + port: string; + index: number; + portIndex: number; +} +export interface AddEgressIpAction { + type: typeof ADD_EGRESS_ENDPOINT_IP; +} +export interface RemoveEgressIpAction { + type: typeof REMOVE_EGRESS_ENDPOINT_IP; + index: number; +} +export interface AddEgressPortAction { + type: typeof ADD_EGRESS_ENDPOINT_PORT; + index: number; +} +export interface RemoveEgressPortAction { + type: typeof REMOVE_EGRESS_ENDPOINT_PORT; + index: number; + portIndex: number; +} +export interface UndoEgressChangesAction { + type: typeof UNDO_EGRESS_ENDPOINT_CHANGES; +} + +export type EgressActionTypes = + | RequestEgressEndpointsAction + | ResetEgressAction + | SetEgressIpsAction + | SetEgressIpsErrorAction + | ChangeEgressAddressAction + | ChangeEgressPortAction + | AddEgressIpAction + | RemoveEgressIpAction + | AddEgressPortAction + | RemoveEgressPortAction + | UndoEgressChangesAction; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/validators.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/validators.ts index 9a1165b..c615ecc 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/validators.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Egress/validators.ts @@ -1,7 +1,7 @@ -import { createValidation, vd } from '@modusbox/modusbox-ui-components/dist/redux-validation'; -import { portValidator, IPAddressValidator } from '../validators'; - -const getEgressPortValidation = () => createValidation([vd.isRequired, portValidator]); -const getEgressAddressValidation = () => createValidation([vd.isRequired, IPAddressValidator]); - -export { getEgressAddressValidation, getEgressPortValidation }; +import { createValidation, vd } from '@modusbox/modusbox-ui-components/dist/redux-validation'; +import { portValidator, IPAddressValidator } from '../validators'; + +const getEgressPortValidation = () => createValidation([vd.isRequired, portValidator]); +const getEgressAddressValidation = () => createValidation([vd.isRequired, IPAddressValidator]); + +export { getEgressAddressValidation, getEgressPortValidation }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.css index 89b1575..b1c64e2 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.css @@ -1,3 +1,3 @@ -.endpoints { - margin-top: 10px; -} +.endpoints { + margin-top: 10px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.tsx index ff35bec..175636f 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Endpoints.tsx @@ -1,33 +1,33 @@ -import React, { FC } from 'react'; -import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; -import Egress from './Egress'; -import Ingress from './Ingress'; -import Hub from './Hub'; - -import './Endpoints.css'; - -interface EndpointsProps {} - -const Endpoints: FC = () => ( -
- - - Egress Endpoints - Ingress Endpoints - Hub Endpoints - - - - - - - - - - - - - -
-); -export default Endpoints; +import React, { FC } from 'react'; +import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; +import Egress from './Egress'; +import Ingress from './Ingress'; +import Hub from './Hub'; + +import './Endpoints.css'; + +interface EndpointsProps {} + +const Endpoints: FC = () => ( +
+ + + Egress Endpoints + Ingress Endpoints + Hub Endpoints + + + + + + + + + + + + + +
+); +export default Endpoints; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/EndpointEntry.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/EndpointEntry.css index ae3d5f7..44bb794 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/EndpointEntry.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/EndpointEntry.css @@ -1,18 +1,18 @@ -.endpoint__entry { - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; - margin-bottom: 10px; -} -.endpoint__entry__detail { - margin: 0px 5px; - margin-right: 10px; -} -.endpoint__entry__title { - font-weight: bold; -} -.endpoint__entry__value { - margin-left: 5px; - font-family: monospace; -} +.endpoint__entry { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + margin-bottom: 10px; +} +.endpoint__entry__detail { + margin: 0px 5px; + margin-right: 10px; +} +.endpoint__entry__title { + font-weight: bold; +} +.endpoint__entry__value { + margin-left: 5px; + font-family: monospace; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/index.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/index.tsx index c04e959..29e733a 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/index.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/EndpointEntry/index.tsx @@ -1,56 +1,56 @@ -import React, { FC } from 'react'; -import { Types } from '../../types'; -import { HubEndpointAddress, HubEndpointURL, HubEndpointValue } from '../types'; -import './EndpointEntry.css'; - -interface EndpointDetailProps { - title: string; - value: string; -} - -const EndpointDetail: FC = ({ title, value }) => ( -
- {title}: - {value} -
-); - -interface AddressDetailsProps { - value: HubEndpointAddress; -} - -const AddressDetails: FC = ({ value }) => ( - <> - - 1 ? 's' : ''}`} - value={value.ports.join(', ')} - key="ports" - /> - -); - -interface URLDetailsProps { - value: HubEndpointURL; -} - -const URLDetails: FC = ({ value }) => ( - -); - -interface EndpointEntryProps { - type: Types; - value: HubEndpointValue; -} - -const EndpointEntry: FC = ({ type, value }) => ( -
- {type === Types.IP ? ( - - ) : ( - - )} -
-); - -export default EndpointEntry; +import React, { FC } from 'react'; +import { Types } from '../../types'; +import { HubEndpointAddress, HubEndpointURL, HubEndpointValue } from '../types'; +import './EndpointEntry.css'; + +interface EndpointDetailProps { + title: string; + value: string; +} + +const EndpointDetail: FC = ({ title, value }) => ( +
+ {title}: + {value} +
+); + +interface AddressDetailsProps { + value: HubEndpointAddress; +} + +const AddressDetails: FC = ({ value }) => ( + <> + + 1 ? 's' : ''}`} + value={value.ports.join(', ')} + key="ports" + /> + +); + +interface URLDetailsProps { + value: HubEndpointURL; +} + +const URLDetails: FC = ({ value }) => ( + +); + +interface EndpointEntryProps { + type: Types; + value: HubEndpointValue; +} + +const EndpointEntry: FC = ({ type, value }) => ( +
+ {type === Types.IP ? ( + + ) : ( + + )} +
+); + +export default EndpointEntry; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.css index 685cd1b..2a338a1 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.css @@ -1,63 +1,63 @@ -.hub-endpoints__filter { - margin-top: 20px; - margin-bottom: 20px; -} - -.hub-endpoints__content { -} - -.hub-endpoints__no-items { - font-size: 20px; - text-align: center; - color: #666; - margin: 20px; -} - -.hub-endpoints__row { - border: 1px solid #ddd; - margin-bottom: 10px; -} - -.hub-endpoints__header { - background: #f8f8f8; - padding: 15px; -} -.hub-endpoints__header__names { - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; - margin-bottom: 5px; -} -.hub-endpoints__hub-name { - font-weight: bold; - font-size: 16px; - margin-right: 10px; -} -.hub-endpoints__environment-name { - font-size: 16px; -} - -.hub-endpoints__body { - display: flex; - flex-direction: row; - padding: 10px; -} -.hub-endpoints__body__section { - flex: 0 0 50%; - padding: 20px; -} -.hub-endpoints__body__section__title { - font-weight: bold; - margin-bottom: 10px; - padding-bottom: 5px; -} - -.hub-endpoints__footer { - display: flex; - flex-direction: row; -} -.hub-endpoints__footer__section { - flex: 0 0 50%; - padding: 20px; -} +.hub-endpoints__filter { + margin-top: 20px; + margin-bottom: 20px; +} + +.hub-endpoints__content { +} + +.hub-endpoints__no-items { + font-size: 20px; + text-align: center; + color: #666; + margin: 20px; +} + +.hub-endpoints__row { + border: 1px solid #ddd; + margin-bottom: 10px; +} + +.hub-endpoints__header { + background: #f8f8f8; + padding: 15px; +} +.hub-endpoints__header__names { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + margin-bottom: 5px; +} +.hub-endpoints__hub-name { + font-weight: bold; + font-size: 16px; + margin-right: 10px; +} +.hub-endpoints__environment-name { + font-size: 16px; +} + +.hub-endpoints__body { + display: flex; + flex-direction: row; + padding: 10px; +} +.hub-endpoints__body__section { + flex: 0 0 50%; + padding: 20px; +} +.hub-endpoints__body__section__title { + font-weight: bold; + margin-bottom: 10px; + padding-bottom: 5px; +} + +.hub-endpoints__footer { + display: flex; + flex-direction: row; +} +.hub-endpoints__footer__section { + flex: 0 0 50%; + padding: 20px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.tsx index 42ca880..b8a91e4 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/Hub.tsx @@ -1,111 +1,111 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { MessageBox, Spinner } from 'components'; -import { State, Dispatch } from 'store/types'; -import { withMount } from 'utils/hocs'; -import { ErrorMessage } from 'App/types'; -import EndpointEntry from './EndpointEntry'; -import './Hub.css'; - -import { - getIsHubEndpointsReadPending, - getHubEndpointsEgressEndpoints, - getHubEndpointsEgressEndpointsError, - getHubEndpointsIngressEndpoints, - getHubEndpointsIngressEndpointsError, -} from './selectors'; -import { requestHubEndpoints } from './actions'; -import { EgressHubEndpoint, IngressHubEndpoint } from './types'; - -const stateProps = (state: State) => ({ - isEndpointsPending: getIsHubEndpointsReadPending(state), - egressEndpoints: getHubEndpointsEgressEndpoints(state), - egressEndpointsError: getHubEndpointsEgressEndpointsError(state), - ingressEndpoints: getHubEndpointsIngressEndpoints(state), - ingressEndpointsError: getHubEndpointsIngressEndpointsError(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(requestHubEndpoints()), -}); - -interface HubEndpointsProps { - isEndpointsPending: boolean; - egressEndpoints: EgressHubEndpoint[]; - ingressEndpoints: IngressHubEndpoint[]; - egressEndpointsError: ErrorMessage; - ingressEndpointsError: ErrorMessage; -} - -const HubEndpoints: FC = ({ - isEndpointsPending, - egressEndpoints, - ingressEndpoints, - egressEndpointsError, - ingressEndpointsError, -}) => { - let content = null; - if (egressEndpointsError || ingressEndpointsError) { - content = ( - - ); - } else if (isEndpointsPending) { - content = ; - } else if (!egressEndpoints.length && !ingressEndpoints.length) { - content = ( - - ); - } else { - content = ( -
-
-
-
HUB NAME
-
-
-
- - -
-
-
- ); - } - - return content; -}; - -const HubEndpointsLoader = () => ; - -interface HubEndpointsSectionProps { - title: string; - endpoints: EgressHubEndpoint[] | IngressHubEndpoint[]; -} - -const HubEndpointsSection: FC = ({ title, endpoints }) => ( -
-
{title}
-
- {endpoints.map((endpoint, index) => ( - - ))} -
-
-); - -const MountedHubEndpoints = withMount(HubEndpoints, 'onMount'); -export default connect(stateProps, actionProps)(MountedHubEndpoints); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { MessageBox, Spinner } from 'components'; +import { State, Dispatch } from 'store/types'; +import { withMount } from 'utils/hocs'; +import { ErrorMessage } from 'App/types'; +import EndpointEntry from './EndpointEntry'; +import './Hub.css'; + +import { + getIsHubEndpointsReadPending, + getHubEndpointsEgressEndpoints, + getHubEndpointsEgressEndpointsError, + getHubEndpointsIngressEndpoints, + getHubEndpointsIngressEndpointsError, +} from './selectors'; +import { requestHubEndpoints } from './actions'; +import { EgressHubEndpoint, IngressHubEndpoint } from './types'; + +const stateProps = (state: State) => ({ + isEndpointsPending: getIsHubEndpointsReadPending(state), + egressEndpoints: getHubEndpointsEgressEndpoints(state), + egressEndpointsError: getHubEndpointsEgressEndpointsError(state), + ingressEndpoints: getHubEndpointsIngressEndpoints(state), + ingressEndpointsError: getHubEndpointsIngressEndpointsError(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(requestHubEndpoints()), +}); + +interface HubEndpointsProps { + isEndpointsPending: boolean; + egressEndpoints: EgressHubEndpoint[]; + ingressEndpoints: IngressHubEndpoint[]; + egressEndpointsError: ErrorMessage; + ingressEndpointsError: ErrorMessage; +} + +const HubEndpoints: FC = ({ + isEndpointsPending, + egressEndpoints, + ingressEndpoints, + egressEndpointsError, + ingressEndpointsError, +}) => { + let content = null; + if (egressEndpointsError || ingressEndpointsError) { + content = ( + + ); + } else if (isEndpointsPending) { + content = ; + } else if (!egressEndpoints.length && !ingressEndpoints.length) { + content = ( + + ); + } else { + content = ( +
+
+
+
HUB NAME
+
+
+
+ + +
+
+
+ ); + } + + return content; +}; + +const HubEndpointsLoader = () => ; + +interface HubEndpointsSectionProps { + title: string; + endpoints: EgressHubEndpoint[] | IngressHubEndpoint[]; +} + +const HubEndpointsSection: FC = ({ title, endpoints }) => ( +
+
{title}
+
+ {endpoints.map((endpoint, index) => ( + + ))} +
+
+); + +const MountedHubEndpoints = withMount(HubEndpoints, 'onMount'); +export default connect(stateProps, actionProps)(MountedHubEndpoints); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/_mockData.js index 7b51163..3fce729 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/_mockData.js @@ -1,12 +1,12 @@ -import { Types, Directions } from '../types'; - -export const hubIps = [ - { - direction: Directions.Ingress, - value: { - address: '120.2.233.2', - ports: ['9090', '2323'], - }, - type: Types.IP, - }, -]; +import { Types, Directions } from '../types'; + +export const hubIps = [ + { + direction: Directions.Ingress, + value: { + address: '120.2.233.2', + ports: ['9090', '2323'], + }, + type: Types.IP, + }, +]; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/actions.ts index 3da523c..0fa6bfe 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/actions.ts @@ -1,70 +1,70 @@ -import { - RESET_HUB_ENDPOINTS, - ResetHubEndpointsAction, - REQUEST_HUB_ENDPOINTS, - RequestHubEndpointsAction, - SetHubEndpointsEgressEndpointsAction, - SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS, - SetHubEndpointsEgressEndpointsErrorAction, - SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR, - SetHubEndpointsIngressEndpointsAction, - SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS, - SetHubEndpointsIngressEndpointsErrorAction, - SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR, - EgressHubEndpoint, - IngressHubEndpoint, -} from './types'; - -export function resetHubEndpoints(): ResetHubEndpointsAction { - return { - type: RESET_HUB_ENDPOINTS, - }; -} - -export function requestHubEndpoints(): RequestHubEndpointsAction { - return { - type: REQUEST_HUB_ENDPOINTS, - }; -} - -export function setHubEndpointsEgressEndpoints({ - data, -}: { - data: EgressHubEndpoint[]; -}): SetHubEndpointsEgressEndpointsAction { - return { - type: SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS, - data, - }; -} -export function setHubEndpointsEgressEndpointsError({ - error, -}: { - error: string; -}): SetHubEndpointsEgressEndpointsErrorAction { - return { - type: SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR, - error, - }; -} - -export function setHubEndpointsIngressEndpoints({ - data, -}: { - data: IngressHubEndpoint[]; -}): SetHubEndpointsIngressEndpointsAction { - return { - type: SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS, - data, - }; -} -export function setHubEndpointsIngressEndpointsError({ - error, -}: { - error: string; -}): SetHubEndpointsIngressEndpointsErrorAction { - return { - type: SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR, - error, - }; -} +import { + RESET_HUB_ENDPOINTS, + ResetHubEndpointsAction, + REQUEST_HUB_ENDPOINTS, + RequestHubEndpointsAction, + SetHubEndpointsEgressEndpointsAction, + SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS, + SetHubEndpointsEgressEndpointsErrorAction, + SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR, + SetHubEndpointsIngressEndpointsAction, + SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS, + SetHubEndpointsIngressEndpointsErrorAction, + SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR, + EgressHubEndpoint, + IngressHubEndpoint, +} from './types'; + +export function resetHubEndpoints(): ResetHubEndpointsAction { + return { + type: RESET_HUB_ENDPOINTS, + }; +} + +export function requestHubEndpoints(): RequestHubEndpointsAction { + return { + type: REQUEST_HUB_ENDPOINTS, + }; +} + +export function setHubEndpointsEgressEndpoints({ + data, +}: { + data: EgressHubEndpoint[]; +}): SetHubEndpointsEgressEndpointsAction { + return { + type: SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS, + data, + }; +} +export function setHubEndpointsEgressEndpointsError({ + error, +}: { + error: string; +}): SetHubEndpointsEgressEndpointsErrorAction { + return { + type: SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR, + error, + }; +} + +export function setHubEndpointsIngressEndpoints({ + data, +}: { + data: IngressHubEndpoint[]; +}): SetHubEndpointsIngressEndpointsAction { + return { + type: SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS, + data, + }; +} +export function setHubEndpointsIngressEndpointsError({ + error, +}: { + error: string; +}): SetHubEndpointsIngressEndpointsErrorAction { + return { + type: SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR, + error, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/index.ts index c336631..13f5a68 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/index.ts @@ -1,9 +1,9 @@ -import Hub from './Hub'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default Hub; -export { actions, reducer, selectors, types, sagas }; +import Hub from './Hub'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default Hub; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/reducers.ts index 312a3f1..0c9cc30 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/reducers.ts @@ -1,53 +1,53 @@ -import { - HubState, - HubActionTypes, - RESET_HUB_ENDPOINTS, - SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS, - SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR, - SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS, - SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR, -} from './types'; - -const initialState: HubState = { - egressHubEndpoints: [], - egressHubEndpointsError: null, - ingressHubEndpoints: [], - ingressHubEndpointsError: null, -}; - -export default function hubEndpointsReducer( - state = initialState, - action: HubActionTypes -): HubState { - switch (action.type) { - case RESET_HUB_ENDPOINTS: { - return initialState; - } - case SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS: { - return { - ...state, - egressHubEndpoints: action.data, - }; - } - case SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR: { - return { - ...state, - egressHubEndpointsError: action.error, - }; - } - case SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS: { - return { - ...state, - ingressHubEndpoints: action.data, - }; - } - case SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR: { - return { - ...state, - ingressHubEndpointsError: action.error, - }; - } - default: - return state; - } -} +import { + HubState, + HubActionTypes, + RESET_HUB_ENDPOINTS, + SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS, + SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR, + SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS, + SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR, +} from './types'; + +const initialState: HubState = { + egressHubEndpoints: [], + egressHubEndpointsError: null, + ingressHubEndpoints: [], + ingressHubEndpointsError: null, +}; + +export default function hubEndpointsReducer( + state = initialState, + action: HubActionTypes +): HubState { + switch (action.type) { + case RESET_HUB_ENDPOINTS: { + return initialState; + } + case SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS: { + return { + ...state, + egressHubEndpoints: action.data, + }; + } + case SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR: { + return { + ...state, + egressHubEndpointsError: action.error, + }; + } + case SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS: { + return { + ...state, + ingressHubEndpoints: action.data, + }; + } + case SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR: { + return { + ...state, + ingressHubEndpointsError: action.error, + }; + } + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/sagas.ts index 61562d5..c301639 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/sagas.ts @@ -1,59 +1,59 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import apis from 'utils/apis'; -import { is20x } from 'utils/http'; -import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { REQUEST_HUB_ENDPOINTS } from './types'; -import { - setHubEndpointsEgressEndpoints, - setHubEndpointsEgressEndpointsError, - setHubEndpointsIngressEndpoints, - setHubEndpointsIngressEndpointsError, -} from './actions'; - -function* fetchHubEgressEndpoints() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.egressHubEndpoints.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setHubEndpointsEgressEndpoints({ data: response.data })); - } else { - yield put( - setHubEndpointsEgressEndpointsError({ error: 'Error Fetching Egress Hub Endpoints' }) - ); - } - } catch (e) { - yield put(setHubEndpointsEgressEndpointsError({ error: e.message })); - } -} - -function* fetchHubIngressEndpoints() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.ingressHubEndpoints.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setHubEndpointsIngressEndpoints({ data: response.data })); - } else { - yield put( - setHubEndpointsIngressEndpointsError({ error: 'Error Fetching Ingress Hub Endpoints' }) - ); - } - } catch (e) { - yield put(setHubEndpointsIngressEndpointsError({ error: e.message })); - } -} - -function* fetchHubEndpointsAllData() { - yield all([call(fetchHubEgressEndpoints), call(fetchHubIngressEndpoints)]); -} - -export function* requestHubEndpointsSaga() { - yield takeLatest([REQUEST_HUB_ENDPOINTS], fetchHubEndpointsAllData); -} - -export default function* rootSaga() { - yield all([requestHubEndpointsSaga()]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import apis from 'utils/apis'; +import { is20x } from 'utils/http'; +import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { REQUEST_HUB_ENDPOINTS } from './types'; +import { + setHubEndpointsEgressEndpoints, + setHubEndpointsEgressEndpointsError, + setHubEndpointsIngressEndpoints, + setHubEndpointsIngressEndpointsError, +} from './actions'; + +function* fetchHubEgressEndpoints() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.egressHubEndpoints.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setHubEndpointsEgressEndpoints({ data: response.data })); + } else { + yield put( + setHubEndpointsEgressEndpointsError({ error: 'Error Fetching Egress Hub Endpoints' }) + ); + } + } catch (e) { + yield put(setHubEndpointsEgressEndpointsError({ error: e.message })); + } +} + +function* fetchHubIngressEndpoints() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.ingressHubEndpoints.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setHubEndpointsIngressEndpoints({ data: response.data })); + } else { + yield put( + setHubEndpointsIngressEndpointsError({ error: 'Error Fetching Ingress Hub Endpoints' }) + ); + } + } catch (e) { + yield put(setHubEndpointsIngressEndpointsError({ error: e.message })); + } +} + +function* fetchHubEndpointsAllData() { + yield all([call(fetchHubEgressEndpoints), call(fetchHubIngressEndpoints)]); +} + +export function* requestHubEndpointsSaga() { + yield takeLatest([REQUEST_HUB_ENDPOINTS], fetchHubEndpointsAllData); +} + +export default function* rootSaga() { + yield all([requestHubEndpointsSaga()]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/selectors.ts index e66735e..502e5bb 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/selectors.ts @@ -1,31 +1,31 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import * as testers from 'utils/testers'; - -export const getHubEndpointsEgressEndpoints = (state: State) => - state.wizard.environment.endpoints.hub.egressHubEndpoints; -export const getHubEndpointsEgressEndpointsError = (state: State) => - state.wizard.environment.endpoints.hub.egressHubEndpointsError; - -export const getHubEndpointsIngressEndpoints = (state: State) => - state.wizard.environment.endpoints.hub.ingressHubEndpoints; - -export const getHubEndpointsIngressEndpointsError = (state: State) => - state.wizard.environment.endpoints.hub.ingressHubEndpointsError; - -const getIsHubIngressEndpointsReadPending = createSelector( - (state: State) => state.api, - isPending('ingressHubEndpoints.read') -); - -const getIsHubEgressEndpointsReadPending = createSelector( - (state: State) => state.api, - isPending('egressHubEndpoints.read') -); - -export const getIsHubEndpointsReadPending = createSelector( - getIsHubIngressEndpointsReadPending, - getIsHubEgressEndpointsReadPending, - testers.getAnyIs(true) -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import * as testers from 'utils/testers'; + +export const getHubEndpointsEgressEndpoints = (state: State) => + state.wizard.environment.endpoints.hub.egressHubEndpoints; +export const getHubEndpointsEgressEndpointsError = (state: State) => + state.wizard.environment.endpoints.hub.egressHubEndpointsError; + +export const getHubEndpointsIngressEndpoints = (state: State) => + state.wizard.environment.endpoints.hub.ingressHubEndpoints; + +export const getHubEndpointsIngressEndpointsError = (state: State) => + state.wizard.environment.endpoints.hub.ingressHubEndpointsError; + +const getIsHubIngressEndpointsReadPending = createSelector( + (state: State) => state.api, + isPending('ingressHubEndpoints.read') +); + +const getIsHubEgressEndpointsReadPending = createSelector( + (state: State) => state.api, + isPending('egressHubEndpoints.read') +); + +export const getIsHubEndpointsReadPending = createSelector( + getIsHubIngressEndpointsReadPending, + getIsHubEgressEndpointsReadPending, + testers.getAnyIs(true) +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/types.ts index c723300..851c76e 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Hub/types.ts @@ -1,72 +1,72 @@ -import { ErrorMessage } from 'App/types'; -import { Types, Directions } from '../types'; - -export const RESET_HUB_ENDPOINTS = 'Hub Endpoints / Reset Endpoints'; -export const REQUEST_HUB_ENDPOINTS = 'Hub Endpoints / Request Endpoints'; -export const SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS = 'Hub Endpoints / Set Egress Endpoints'; -export const SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR = - 'Hub Endpoints / Set Egress Endpoints Error'; -export const SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS = 'Hub Endpoints / Set Ingress Endpoints'; -export const SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR = - 'Hub Endpoints / Set Ingress Endpoints Error'; - -export interface HubEndpointAddress { - address: string; - ports: (string | undefined)[]; -} - -export interface HubEndpointURL { - url: string; -} - -export type HubEndpointValue = HubEndpointAddress | HubEndpointURL; - -export interface EgressHubEndpoint { - direction: Directions; - value: HubEndpointValue; - type: Types; -} - -export interface IngressHubEndpoint { - direction: Directions; - value: HubEndpointValue; - type: Types; -} - -export interface HubState { - egressHubEndpoints: EgressHubEndpoint[]; - egressHubEndpointsError?: ErrorMessage; - ingressHubEndpoints: IngressHubEndpoint[]; - ingressHubEndpointsError?: ErrorMessage; -} - -export interface ResetHubEndpointsAction { - type: typeof RESET_HUB_ENDPOINTS; -} -export interface RequestHubEndpointsAction { - type: typeof REQUEST_HUB_ENDPOINTS; -} -export interface SetHubEndpointsEgressEndpointsAction { - type: typeof SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS; - data: EgressHubEndpoint[]; -} -export interface SetHubEndpointsEgressEndpointsErrorAction { - type: typeof SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR; - error: string; -} - -export interface SetHubEndpointsIngressEndpointsAction { - type: typeof SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS; - data: IngressHubEndpoint[]; -} -export interface SetHubEndpointsIngressEndpointsErrorAction { - type: typeof SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR; - error: string; -} - -export type HubActionTypes = - | ResetHubEndpointsAction - | SetHubEndpointsEgressEndpointsAction - | SetHubEndpointsEgressEndpointsErrorAction - | SetHubEndpointsIngressEndpointsAction - | SetHubEndpointsIngressEndpointsErrorAction; +import { ErrorMessage } from 'App/types'; +import { Types, Directions } from '../types'; + +export const RESET_HUB_ENDPOINTS = 'Hub Endpoints / Reset Endpoints'; +export const REQUEST_HUB_ENDPOINTS = 'Hub Endpoints / Request Endpoints'; +export const SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS = 'Hub Endpoints / Set Egress Endpoints'; +export const SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR = + 'Hub Endpoints / Set Egress Endpoints Error'; +export const SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS = 'Hub Endpoints / Set Ingress Endpoints'; +export const SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR = + 'Hub Endpoints / Set Ingress Endpoints Error'; + +export interface HubEndpointAddress { + address: string; + ports: (string | undefined)[]; +} + +export interface HubEndpointURL { + url: string; +} + +export type HubEndpointValue = HubEndpointAddress | HubEndpointURL; + +export interface EgressHubEndpoint { + direction: Directions; + value: HubEndpointValue; + type: Types; +} + +export interface IngressHubEndpoint { + direction: Directions; + value: HubEndpointValue; + type: Types; +} + +export interface HubState { + egressHubEndpoints: EgressHubEndpoint[]; + egressHubEndpointsError?: ErrorMessage; + ingressHubEndpoints: IngressHubEndpoint[]; + ingressHubEndpointsError?: ErrorMessage; +} + +export interface ResetHubEndpointsAction { + type: typeof RESET_HUB_ENDPOINTS; +} +export interface RequestHubEndpointsAction { + type: typeof REQUEST_HUB_ENDPOINTS; +} +export interface SetHubEndpointsEgressEndpointsAction { + type: typeof SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS; + data: EgressHubEndpoint[]; +} +export interface SetHubEndpointsEgressEndpointsErrorAction { + type: typeof SET_HUB_ENDPOINTS_EGRESS_ENDPOINTS_ERROR; + error: string; +} + +export interface SetHubEndpointsIngressEndpointsAction { + type: typeof SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS; + data: IngressHubEndpoint[]; +} +export interface SetHubEndpointsIngressEndpointsErrorAction { + type: typeof SET_HUB_ENDPOINTS_INGRESS_ENDPOINTS_ERROR; + error: string; +} + +export type HubActionTypes = + | ResetHubEndpointsAction + | SetHubEndpointsEgressEndpointsAction + | SetHubEndpointsEgressEndpointsErrorAction + | SetHubEndpointsIngressEndpointsAction + | SetHubEndpointsIngressEndpointsErrorAction; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.css index e4c026f..d031cbb 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.css @@ -1,76 +1,76 @@ -.ingress____buttons { - margin-bottom: 20px; - display: flex; - align-items: flex-start; - flex-direction: row; -} -.ingress____button { - margin-right: 10px; - width: 250px; -} - -.ingress__url__container { - padding: 5px; -} -.ingress__url { - padding-bottom: 10px; - margin-bottom: 7px; - width: 415px; - margin-left: 50px; -} -.ingress__url__status__container { - margin-top: 5px; -} -.ingress__ip__row { - display: flex; - flex-direction: row; - align-items: flex-start; - justify-content: flex-start; - border-bottom: 2px solid #eee; - padding-bottom: 10px; - margin-bottom: 10px; -} -.ingress__ip__controls { - margin-left: 10px; -} -.ingress__ip__fields { - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-start; -} -.ingress__ip__remove { - margin: 10px; - margin-top: 18px; - fill: #c33; -} -.ingress__ip__address__container { - margin: 5px; -} -.ingress__ip__address { - width: 250px; -} -.ingress__ip__port__container { - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - margin: 0px 5px; - padding: 5px; - background: #f4f4f4; - border-radius: 5px; -} -.ingress__ip__port { - width: 150px; -} -.ingress__ip__port-add { - margin-left: 5px; -} -.ingress__ip__port-remove { - margin-left: 5px; - fill: #c33; -} - -.ingress__status__container { - margin-left: 5px; -} +.ingress____buttons { + margin-bottom: 20px; + display: flex; + align-items: flex-start; + flex-direction: row; +} +.ingress____button { + margin-right: 10px; + width: 250px; +} + +.ingress__url__container { + padding: 5px; +} +.ingress__url { + padding-bottom: 10px; + margin-bottom: 7px; + width: 415px; + margin-left: 50px; +} +.ingress__url__status__container { + margin-top: 5px; +} +.ingress__ip__row { + display: flex; + flex-direction: row; + align-items: flex-start; + justify-content: flex-start; + border-bottom: 2px solid #eee; + padding-bottom: 10px; + margin-bottom: 10px; +} +.ingress__ip__controls { + margin-left: 10px; +} +.ingress__ip__fields { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; +} +.ingress__ip__remove { + margin: 10px; + margin-top: 18px; + fill: #c33; +} +.ingress__ip__address__container { + margin: 5px; +} +.ingress__ip__address { + width: 250px; +} +.ingress__ip__port__container { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + margin: 0px 5px; + padding: 5px; + background: #f4f4f4; + border-radius: 5px; +} +.ingress__ip__port { + width: 150px; +} +.ingress__ip__port-add { + margin-left: 5px; +} +.ingress__ip__port-remove { + margin-left: 5px; + fill: #c33; +} + +.ingress__status__container { + margin-left: 5px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.tsx index 084aa24..0ec24c9 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/Ingress.tsx @@ -1,299 +1,299 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { - AnimateFadeIn, - Button, - ControlIcon, - FormInput, - MessageBox, - Spinner, - Status, -} from 'components'; -import { State, Dispatch } from 'store/types'; -import { withMount } from 'utils/hocs'; -import { States } from '../types'; -import { - getIngressError, - getIngressUrls, - getIngressIps, - getIngressUrlsValidationResult, - getIngressIpsValidationResult, - getIsIngressPending, - getIsIngressSubmitEnabled, - getIsIngressSubmitPending, - getIsIngressChanged, -} from './selectors'; -import { - requestIngressEndpoints, - addIngressIp, - removeIngressIp, - changeIngressUrl, - changeIngressAddress, - changeIngressPort, - addIngressPort, - removeIngressPort, - submitIngressEndpoints, - undoIngressChanges, -} from './actions'; - -import { IngressIP, IngressURL } from './types'; -import './Ingress.css'; - -const stateProps = (state: State) => ({ - error: getIngressError(state), - urls: getIngressUrls(state), - ips: getIngressIps(state), - urlsValidation: getIngressUrlsValidationResult(state), - ipsValidation: getIngressIpsValidationResult(state), - isPending: getIsIngressPending(state), - isSubmitEnabled: getIsIngressSubmitEnabled(state), - isSubmitPending: getIsIngressSubmitPending(state), - isChanged: getIsIngressChanged(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(requestIngressEndpoints()), - onAddIpClick: () => dispatch(addIngressIp()), - onChangeUrl: (url: string, index: number) => dispatch(changeIngressUrl({ url, index })), - onChangeAddress: (address: string, index: number) => - dispatch(changeIngressAddress({ address, index })), - onChangePort: (port: string, portIndex: number, index: number) => - dispatch(changeIngressPort({ port, portIndex, index })), - onAddPortClick: (index: number) => dispatch(addIngressPort({ index })), - onRemovePortClick: (portIndex: number, index: number) => - dispatch(removeIngressPort({ portIndex, index })), - onRemoveIpClick: (index: number) => dispatch(removeIngressIp({ index })), - onSubmitClick: () => dispatch(submitIngressEndpoints()), - onUndoClick: () => dispatch(undoIngressChanges()), -}); - -interface ValidationMessage { - active?: boolean; - message: string; -} - -interface ValidationToken { - value: string | number | undefined; - available: boolean; - isUndefined?: boolean; - replaced: string; -} - -interface ValidationResult { - tokens: ValidationToken[]; - messages: ValidationMessage[]; - isValid: boolean; - isRequired: boolean; -} - -interface IngressProps { - error: boolean; - ips: IngressIP[]; - urls: IngressURL[]; - urlsValidation: ValidationResult[]; - ipsValidation: ValidationResult[]; - isPending: boolean; - isSubmitEnabled: boolean; - isSubmitPending: boolean; - isChanged: boolean; - onMount: () => null; - onAddIpClick: () => null; - onChangeUrl: (url: string, index: number) => null; - onChangeAddress: (address: string, index: number) => null; - onChangePort: (port: string, portIndex: number, index: number) => null; - onAddPortClick: (index: number) => null; - onRemovePortClick: (portIndex: number, index: number) => null; - onRemoveIpClick: (index: number) => null; - onSubmitClick: () => null; - onUndoClick: () => null; -} -const Ingress: FC = ({ - error, - ips, - urls, - urlsValidation, - ipsValidation, - isPending, - isSubmitEnabled, - isSubmitPending, - isChanged, - onAddIpClick, - onChangeUrl, - onChangeAddress, - onChangePort, - onAddPortClick, - onRemovePortClick, - onRemoveIpClick, - onSubmitClick, - onUndoClick, -}) => { - if (isPending) { - return ; - } - if (error) { - return ( - - ); - } - return ( -
-
-
- -
-
- onChangeUrl(value, 0)} - validation={urlsValidation[0]} - /> -
- -
-
-
- - {ips.map((ingressIp, index) => ( - - - - ))} -
- ); -}; - -interface IngressIPProps { - index: number; - state: States; - address?: string; - ports: (string | undefined)[]; - // TODO: Find correct validation - // eslint-disable-next-line - validation: any; - onChangeAddress: (address: string, index: number) => null; - onChangePort: (port: string, portIndex: number, index: number) => null; - onAddPort: (index: number) => null; - onRemovePort: (portIndex: number, index: number) => null; - onRemoveIp: (index: number) => null; -} -const IngressIp: FC = ({ - index, - state, - address, - ports, - validation, - onChangeAddress, - onChangePort, - onAddPort, - onRemovePort, - onRemoveIp, -}) => ( -
-
- onRemoveIp(index)} - disabled={index === 0} - /> -
-
-
-
-
- onChangeAddress(addressValue, index)} - validation={validation[index].address} - /> -
-
- {ports.map((port, portIndex) => ( -
-
- onChangePort(value, portIndex, index)} - validation={validation[index].ports[portIndex]} - /> -
- {portIndex > 0 && ( -
- onRemovePort(portIndex, index)} - disabled={portIndex === 0} - /> -
- )} -
- ))} -
-
- -
-
-
-); - -const MountedIngress = withMount(Ingress, 'onMount'); - -export default connect(stateProps, actionProps)(MountedIngress); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { + AnimateFadeIn, + Button, + ControlIcon, + FormInput, + MessageBox, + Spinner, + Status, +} from 'components'; +import { State, Dispatch } from 'store/types'; +import { withMount } from 'utils/hocs'; +import { States } from '../types'; +import { + getIngressError, + getIngressUrls, + getIngressIps, + getIngressUrlsValidationResult, + getIngressIpsValidationResult, + getIsIngressPending, + getIsIngressSubmitEnabled, + getIsIngressSubmitPending, + getIsIngressChanged, +} from './selectors'; +import { + requestIngressEndpoints, + addIngressIp, + removeIngressIp, + changeIngressUrl, + changeIngressAddress, + changeIngressPort, + addIngressPort, + removeIngressPort, + submitIngressEndpoints, + undoIngressChanges, +} from './actions'; + +import { IngressIP, IngressURL } from './types'; +import './Ingress.css'; + +const stateProps = (state: State) => ({ + error: getIngressError(state), + urls: getIngressUrls(state), + ips: getIngressIps(state), + urlsValidation: getIngressUrlsValidationResult(state), + ipsValidation: getIngressIpsValidationResult(state), + isPending: getIsIngressPending(state), + isSubmitEnabled: getIsIngressSubmitEnabled(state), + isSubmitPending: getIsIngressSubmitPending(state), + isChanged: getIsIngressChanged(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(requestIngressEndpoints()), + onAddIpClick: () => dispatch(addIngressIp()), + onChangeUrl: (url: string, index: number) => dispatch(changeIngressUrl({ url, index })), + onChangeAddress: (address: string, index: number) => + dispatch(changeIngressAddress({ address, index })), + onChangePort: (port: string, portIndex: number, index: number) => + dispatch(changeIngressPort({ port, portIndex, index })), + onAddPortClick: (index: number) => dispatch(addIngressPort({ index })), + onRemovePortClick: (portIndex: number, index: number) => + dispatch(removeIngressPort({ portIndex, index })), + onRemoveIpClick: (index: number) => dispatch(removeIngressIp({ index })), + onSubmitClick: () => dispatch(submitIngressEndpoints()), + onUndoClick: () => dispatch(undoIngressChanges()), +}); + +interface ValidationMessage { + active?: boolean; + message: string; +} + +interface ValidationToken { + value: string | number | undefined; + available: boolean; + isUndefined?: boolean; + replaced: string; +} + +interface ValidationResult { + tokens: ValidationToken[]; + messages: ValidationMessage[]; + isValid: boolean; + isRequired: boolean; +} + +interface IngressProps { + error: boolean; + ips: IngressIP[]; + urls: IngressURL[]; + urlsValidation: ValidationResult[]; + ipsValidation: ValidationResult[]; + isPending: boolean; + isSubmitEnabled: boolean; + isSubmitPending: boolean; + isChanged: boolean; + onMount: () => null; + onAddIpClick: () => null; + onChangeUrl: (url: string, index: number) => null; + onChangeAddress: (address: string, index: number) => null; + onChangePort: (port: string, portIndex: number, index: number) => null; + onAddPortClick: (index: number) => null; + onRemovePortClick: (portIndex: number, index: number) => null; + onRemoveIpClick: (index: number) => null; + onSubmitClick: () => null; + onUndoClick: () => null; +} +const Ingress: FC = ({ + error, + ips, + urls, + urlsValidation, + ipsValidation, + isPending, + isSubmitEnabled, + isSubmitPending, + isChanged, + onAddIpClick, + onChangeUrl, + onChangeAddress, + onChangePort, + onAddPortClick, + onRemovePortClick, + onRemoveIpClick, + onSubmitClick, + onUndoClick, +}) => { + if (isPending) { + return ; + } + if (error) { + return ( + + ); + } + return ( +
+
+
+ +
+
+ onChangeUrl(value, 0)} + validation={urlsValidation[0]} + /> +
+ +
+
+
+ + {ips.map((ingressIp, index) => ( + + + + ))} +
+ ); +}; + +interface IngressIPProps { + index: number; + state: States; + address?: string; + ports: (string | undefined)[]; + // TODO: Find correct validation + // eslint-disable-next-line + validation: any; + onChangeAddress: (address: string, index: number) => null; + onChangePort: (port: string, portIndex: number, index: number) => null; + onAddPort: (index: number) => null; + onRemovePort: (portIndex: number, index: number) => null; + onRemoveIp: (index: number) => null; +} +const IngressIp: FC = ({ + index, + state, + address, + ports, + validation, + onChangeAddress, + onChangePort, + onAddPort, + onRemovePort, + onRemoveIp, +}) => ( +
+
+ onRemoveIp(index)} + disabled={index === 0} + /> +
+
+
+
+
+ onChangeAddress(addressValue, index)} + validation={validation[index].address} + /> +
+
+ {ports.map((port, portIndex) => ( +
+
+ onChangePort(value, portIndex, index)} + validation={validation[index].ports[portIndex]} + /> +
+ {portIndex > 0 && ( +
+ onRemovePort(portIndex, index)} + disabled={portIndex === 0} + /> +
+ )} +
+ ))} +
+
+ +
+
+
+); + +const MountedIngress = withMount(Ingress, 'onMount'); + +export default connect(stateProps, actionProps)(MountedIngress); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/_mockData.js index 2bb6d02..c12ee81 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/_mockData.js @@ -1,21 +1,21 @@ -import { States } from '../types'; - -export const ingressUrls = [ - { - id: '123123', - state: States.New, - value: { - url: 'https://com.gov', - }, - }, -]; -export const ingressIps = [ - { - id: '123123', - state: States.New, - value: { - address: '192.156.22.22', - ports: ['9090'], - }, - }, -]; +import { States } from '../types'; + +export const ingressUrls = [ + { + id: '123123', + state: States.New, + value: { + url: 'https://com.gov', + }, + }, +]; +export const ingressIps = [ + { + id: '123123', + state: States.New, + value: { + address: '192.156.22.22', + ports: ['9090'], + }, + }, +]; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/actions.ts index addde62..f019402 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/actions.ts @@ -1,153 +1,153 @@ -import { ErrorMessage } from 'App/types'; - -import { - RequestIngressEndpointsAction, - SubmitIngressEndpointsAction, - ResetIngressAction, - SetIngressUrlsAction, - SetIngressUrlsErrorAction, - SetIngressIpsAction, - SetIngressIpsErrorAction, - ChangeIngressUrlAction, - ChangeIngressAddressAction, - ChangeIngressPortAction, - AddIngressIpAction, - RemoveIngressIpAction, - AddIngressPortAction, - RemoveIngressPortAction, - UndoIngressChangesAction, - REQUEST_INGRESS_ENDPOINTS, - SUBMIT_INGRESS_ENDPOINTS, - RESET_INGRESS_ENDPOINT, - SET_INGRESS_ENDPOINT_URLS, - SET_INGRESS_ENDPOINT_URLS_ERROR, - SET_INGRESS_ENDPOINT_IPS, - SET_INGRESS_ENDPOINT_IPS_ERROR, - CHANGE_INGRESS_ENDPOINT_URL, - CHANGE_INGRESS_ENDPOINT_ADDRESS, - CHANGE_INGRESS_ENDPOINT_PORT, - ADD_INGRESS_ENDPOINT_IP, - REMOVE_INGRESS_ENDPOINT_IP, - ADD_INGRESS_ENDPOINT_PORT, - REMOVE_INGRESS_ENDPOINT_PORT, - UNDO_INGRESS_ENDPOINT_CHANGES, - IngressURL, - IngressIP, -} from './types'; - -export function requestIngressEndpoints(): RequestIngressEndpointsAction { - return { - type: REQUEST_INGRESS_ENDPOINTS, - }; -} -export function submitIngressEndpoints(): SubmitIngressEndpointsAction { - return { - type: SUBMIT_INGRESS_ENDPOINTS, - }; -} -export function resetIngress(): ResetIngressAction { - return { - type: RESET_INGRESS_ENDPOINT, - }; -} -export function setIngressUrls({ urls }: { urls: IngressURL[] }): SetIngressUrlsAction { - return { - type: SET_INGRESS_ENDPOINT_URLS, - urls, - }; -} -export function setIngressUrlsError({ error }: { error: ErrorMessage }): SetIngressUrlsErrorAction { - return { - type: SET_INGRESS_ENDPOINT_URLS_ERROR, - error, - }; -} -export function setIngressIps({ ips }: { ips: IngressIP[] }): SetIngressIpsAction { - return { - type: SET_INGRESS_ENDPOINT_IPS, - ips, - }; -} -export function setIngressIpsError({ error }: { error: ErrorMessage }): SetIngressIpsErrorAction { - return { - type: SET_INGRESS_ENDPOINT_IPS_ERROR, - error, - }; -} -export function changeIngressUrl({ - url, - index, -}: { - url: string; - index: number; -}): ChangeIngressUrlAction { - return { - type: CHANGE_INGRESS_ENDPOINT_URL, - url, - index, - }; -} -export function changeIngressAddress({ - index, - address, -}: { - address: string; - index: number; -}): ChangeIngressAddressAction { - return { - type: CHANGE_INGRESS_ENDPOINT_ADDRESS, - index, - address, - }; -} -export function changeIngressPort({ - index, - port, - portIndex, -}: { - index: number; - port: string; - portIndex: number; -}): ChangeIngressPortAction { - return { - type: CHANGE_INGRESS_ENDPOINT_PORT, - index, - port, - portIndex, - }; -} -export function addIngressIp(): AddIngressIpAction { - return { - type: ADD_INGRESS_ENDPOINT_IP, - }; -} -export function removeIngressIp({ index }: { index: number }): RemoveIngressIpAction { - return { - type: REMOVE_INGRESS_ENDPOINT_IP, - index, - }; -} -export function addIngressPort({ index }: { index: number }): AddIngressPortAction { - return { - type: ADD_INGRESS_ENDPOINT_PORT, - index, - }; -} -export function removeIngressPort({ - index, - portIndex, -}: { - index: number; - portIndex: number; -}): RemoveIngressPortAction { - return { - type: REMOVE_INGRESS_ENDPOINT_PORT, - index, - portIndex, - }; -} -export function undoIngressChanges(): UndoIngressChangesAction { - return { - type: UNDO_INGRESS_ENDPOINT_CHANGES, - }; -} +import { ErrorMessage } from 'App/types'; + +import { + RequestIngressEndpointsAction, + SubmitIngressEndpointsAction, + ResetIngressAction, + SetIngressUrlsAction, + SetIngressUrlsErrorAction, + SetIngressIpsAction, + SetIngressIpsErrorAction, + ChangeIngressUrlAction, + ChangeIngressAddressAction, + ChangeIngressPortAction, + AddIngressIpAction, + RemoveIngressIpAction, + AddIngressPortAction, + RemoveIngressPortAction, + UndoIngressChangesAction, + REQUEST_INGRESS_ENDPOINTS, + SUBMIT_INGRESS_ENDPOINTS, + RESET_INGRESS_ENDPOINT, + SET_INGRESS_ENDPOINT_URLS, + SET_INGRESS_ENDPOINT_URLS_ERROR, + SET_INGRESS_ENDPOINT_IPS, + SET_INGRESS_ENDPOINT_IPS_ERROR, + CHANGE_INGRESS_ENDPOINT_URL, + CHANGE_INGRESS_ENDPOINT_ADDRESS, + CHANGE_INGRESS_ENDPOINT_PORT, + ADD_INGRESS_ENDPOINT_IP, + REMOVE_INGRESS_ENDPOINT_IP, + ADD_INGRESS_ENDPOINT_PORT, + REMOVE_INGRESS_ENDPOINT_PORT, + UNDO_INGRESS_ENDPOINT_CHANGES, + IngressURL, + IngressIP, +} from './types'; + +export function requestIngressEndpoints(): RequestIngressEndpointsAction { + return { + type: REQUEST_INGRESS_ENDPOINTS, + }; +} +export function submitIngressEndpoints(): SubmitIngressEndpointsAction { + return { + type: SUBMIT_INGRESS_ENDPOINTS, + }; +} +export function resetIngress(): ResetIngressAction { + return { + type: RESET_INGRESS_ENDPOINT, + }; +} +export function setIngressUrls({ urls }: { urls: IngressURL[] }): SetIngressUrlsAction { + return { + type: SET_INGRESS_ENDPOINT_URLS, + urls, + }; +} +export function setIngressUrlsError({ error }: { error: ErrorMessage }): SetIngressUrlsErrorAction { + return { + type: SET_INGRESS_ENDPOINT_URLS_ERROR, + error, + }; +} +export function setIngressIps({ ips }: { ips: IngressIP[] }): SetIngressIpsAction { + return { + type: SET_INGRESS_ENDPOINT_IPS, + ips, + }; +} +export function setIngressIpsError({ error }: { error: ErrorMessage }): SetIngressIpsErrorAction { + return { + type: SET_INGRESS_ENDPOINT_IPS_ERROR, + error, + }; +} +export function changeIngressUrl({ + url, + index, +}: { + url: string; + index: number; +}): ChangeIngressUrlAction { + return { + type: CHANGE_INGRESS_ENDPOINT_URL, + url, + index, + }; +} +export function changeIngressAddress({ + index, + address, +}: { + address: string; + index: number; +}): ChangeIngressAddressAction { + return { + type: CHANGE_INGRESS_ENDPOINT_ADDRESS, + index, + address, + }; +} +export function changeIngressPort({ + index, + port, + portIndex, +}: { + index: number; + port: string; + portIndex: number; +}): ChangeIngressPortAction { + return { + type: CHANGE_INGRESS_ENDPOINT_PORT, + index, + port, + portIndex, + }; +} +export function addIngressIp(): AddIngressIpAction { + return { + type: ADD_INGRESS_ENDPOINT_IP, + }; +} +export function removeIngressIp({ index }: { index: number }): RemoveIngressIpAction { + return { + type: REMOVE_INGRESS_ENDPOINT_IP, + index, + }; +} +export function addIngressPort({ index }: { index: number }): AddIngressPortAction { + return { + type: ADD_INGRESS_ENDPOINT_PORT, + index, + }; +} +export function removeIngressPort({ + index, + portIndex, +}: { + index: number; + portIndex: number; +}): RemoveIngressPortAction { + return { + type: REMOVE_INGRESS_ENDPOINT_PORT, + index, + portIndex, + }; +} +export function undoIngressChanges(): UndoIngressChangesAction { + return { + type: UNDO_INGRESS_ENDPOINT_CHANGES, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/index.ts index 228616f..a22b5e9 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/index.ts @@ -1,9 +1,9 @@ -import Ingress from './Ingress'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default Ingress; -export { actions, reducer, selectors, types, sagas }; +import Ingress from './Ingress'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default Ingress; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/models.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/models.ts index 47e0679..d4b40bb 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/models.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/models.ts @@ -1,29 +1,29 @@ -import { ExternalIngressIP, ExternalIngressURL, IngressIP, IngressURL } from './types'; - -const apiToIpModel = (ip: ExternalIngressIP): IngressIP => ({ - id: ip.id, - state: ip.state, - address: ip.value.address, - ports: ip.value.ports, -}); - -const ipToApiModel = (ip: IngressIP): Partial => ({ - value: { - address: ip.address, - ports: ip.ports, - }, -}); - -const apiToUrlModel = (url: ExternalIngressURL): IngressURL => ({ - id: url.id, - state: url.state, - url: url.value.url, -}); - -const urlToApiModel = (url: IngressURL): Partial => ({ - value: { - url: url.url, - }, -}); - -export { apiToIpModel, apiToUrlModel, ipToApiModel, urlToApiModel }; +import { ExternalIngressIP, ExternalIngressURL, IngressIP, IngressURL } from './types'; + +const apiToIpModel = (ip: ExternalIngressIP): IngressIP => ({ + id: ip.id, + state: ip.state, + address: ip.value.address, + ports: ip.value.ports, +}); + +const ipToApiModel = (ip: IngressIP): Partial => ({ + value: { + address: ip.address, + ports: ip.ports, + }, +}); + +const apiToUrlModel = (url: ExternalIngressURL): IngressURL => ({ + id: url.id, + state: url.state, + url: url.value.url, +}); + +const urlToApiModel = (url: IngressURL): Partial => ({ + value: { + url: url.url, + }, +}); + +export { apiToIpModel, apiToUrlModel, ipToApiModel, urlToApiModel }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/reducers.ts index 85b45c9..79ff0c7 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/reducers.ts @@ -1,193 +1,193 @@ -import isEqual from 'lodash/isEqual'; -import { States } from '../types'; -import { - RESET_INGRESS_ENDPOINT, - SET_INGRESS_ENDPOINT_URLS, - SET_INGRESS_ENDPOINT_URLS_ERROR, - SET_INGRESS_ENDPOINT_IPS, - SET_INGRESS_ENDPOINT_IPS_ERROR, - CHANGE_INGRESS_ENDPOINT_URL, - CHANGE_INGRESS_ENDPOINT_ADDRESS, - CHANGE_INGRESS_ENDPOINT_PORT, - ADD_INGRESS_ENDPOINT_IP, - REMOVE_INGRESS_ENDPOINT_IP, - ADD_INGRESS_ENDPOINT_PORT, - REMOVE_INGRESS_ENDPOINT_PORT, - UNDO_INGRESS_ENDPOINT_CHANGES, - IngressURL, - IngressIP, - IngressActionTypes, - IngressState, -} from './types'; - -const initialIngressIp: IngressIP = { - id: undefined, - state: States.Unset, - address: undefined, - ports: [undefined], -}; -const initialIngressUrl: IngressURL = { - id: undefined, - state: States.Unset, - url: undefined, -}; - -const initialState: IngressState = { - previousIngressUrls: [initialIngressUrl], - ingressUrlsError: null, - ingressUrls: [initialIngressUrl], - previousIngressIps: [initialIngressIp], - ingressIpsError: null, - ingressIps: [initialIngressIp], -}; - -export default function ingressReducer( - state = initialState, - action: IngressActionTypes -): IngressState { - switch (action.type) { - case RESET_INGRESS_ENDPOINT: { - return initialState; - } - case SET_INGRESS_ENDPOINT_URLS: { - // we should set an empty url structure - // if the dfsp has no urls set - let { urls } = action; - if (isEqual(urls, [])) { - urls = [initialIngressUrl]; - } - return { - ...state, - previousIngressUrls: urls, - ingressUrls: urls, - }; - } - case SET_INGRESS_ENDPOINT_URLS_ERROR: { - return { - ...state, - ingressUrlsError: action.error, - }; - } - case SET_INGRESS_ENDPOINT_IPS: { - // we should set an empty ip structure - // if the dfsp has no ips set - let { ips } = action; - if (isEqual(ips, [])) { - ips = [initialIngressIp]; - } - return { - ...state, - previousIngressIps: ips, - ingressIps: ips, - }; - } - case SET_INGRESS_ENDPOINT_IPS_ERROR: { - return { - ...state, - ingressIpsError: action.error, - }; - } - case CHANGE_INGRESS_ENDPOINT_URL: { - const { url, index } = action; - return { - ...state, - ingressUrls: [ - ...state.ingressUrls.slice(0, index), - { - ...state.ingressUrls[index], - url, - }, - ...state.ingressUrls.slice(index + 1), - ], - }; - } - case CHANGE_INGRESS_ENDPOINT_ADDRESS: { - const { address, index } = action; - return { - ...state, - ingressIps: [ - ...state.ingressIps.slice(0, index), - { - ...state.ingressIps[index], - address, - }, - ...state.ingressIps.slice(index + 1), - ], - }; - } - case CHANGE_INGRESS_ENDPOINT_PORT: { - const { port, index, portIndex } = action; - return { - ...state, - ingressIps: [ - ...state.ingressIps.slice(0, index), - { - ...state.ingressIps[index], - ports: [ - ...state.ingressIps[index].ports.slice(0, portIndex), - port, - ...state.ingressIps[index].ports.slice(portIndex + 1), - ], - }, - ...state.ingressIps.slice(index + 1), - ], - }; - } - case ADD_INGRESS_ENDPOINT_IP: { - return { - ...state, - ingressIps: [...state.ingressIps, initialIngressIp], - }; - } - case REMOVE_INGRESS_ENDPOINT_IP: { - const { index } = action; - return { - ...state, - ingressIps: [...state.ingressIps.slice(0, index), ...state.ingressIps.slice(index + 1)], - }; - } - case ADD_INGRESS_ENDPOINT_PORT: { - const { index } = action; - return { - ...state, - ingressIps: [ - ...state.ingressIps.slice(0, index), - { - ...state.ingressIps[index], - ports: [...state.ingressIps[index].ports, undefined], - }, - ...state.ingressIps.slice(index + 1), - ], - }; - } - case REMOVE_INGRESS_ENDPOINT_PORT: { - const { portIndex, index } = action; - return { - ...state, - ingressIps: [ - ...state.ingressIps.slice(0, index), - { - ...state.ingressIps[index], - ports: [ - ...state.ingressIps[index].ports.slice(0, portIndex), - ...state.ingressIps[index].ports.slice(portIndex + 1), - ], - }, - ...state.ingressIps.slice(index + 1), - ], - }; - } - case UNDO_INGRESS_ENDPOINT_CHANGES: { - return { - ...state, - ingressUrls: [...state.previousIngressUrls], - ingressIps: [...state.previousIngressIps], - }; - } - default: { - return state; - } - } -} - -export { initialState, initialIngressIp, initialIngressUrl }; +import isEqual from 'lodash/isEqual'; +import { States } from '../types'; +import { + RESET_INGRESS_ENDPOINT, + SET_INGRESS_ENDPOINT_URLS, + SET_INGRESS_ENDPOINT_URLS_ERROR, + SET_INGRESS_ENDPOINT_IPS, + SET_INGRESS_ENDPOINT_IPS_ERROR, + CHANGE_INGRESS_ENDPOINT_URL, + CHANGE_INGRESS_ENDPOINT_ADDRESS, + CHANGE_INGRESS_ENDPOINT_PORT, + ADD_INGRESS_ENDPOINT_IP, + REMOVE_INGRESS_ENDPOINT_IP, + ADD_INGRESS_ENDPOINT_PORT, + REMOVE_INGRESS_ENDPOINT_PORT, + UNDO_INGRESS_ENDPOINT_CHANGES, + IngressURL, + IngressIP, + IngressActionTypes, + IngressState, +} from './types'; + +const initialIngressIp: IngressIP = { + id: undefined, + state: States.Unset, + address: undefined, + ports: [undefined], +}; +const initialIngressUrl: IngressURL = { + id: undefined, + state: States.Unset, + url: undefined, +}; + +const initialState: IngressState = { + previousIngressUrls: [initialIngressUrl], + ingressUrlsError: null, + ingressUrls: [initialIngressUrl], + previousIngressIps: [initialIngressIp], + ingressIpsError: null, + ingressIps: [initialIngressIp], +}; + +export default function ingressReducer( + state = initialState, + action: IngressActionTypes +): IngressState { + switch (action.type) { + case RESET_INGRESS_ENDPOINT: { + return initialState; + } + case SET_INGRESS_ENDPOINT_URLS: { + // we should set an empty url structure + // if the dfsp has no urls set + let { urls } = action; + if (isEqual(urls, [])) { + urls = [initialIngressUrl]; + } + return { + ...state, + previousIngressUrls: urls, + ingressUrls: urls, + }; + } + case SET_INGRESS_ENDPOINT_URLS_ERROR: { + return { + ...state, + ingressUrlsError: action.error, + }; + } + case SET_INGRESS_ENDPOINT_IPS: { + // we should set an empty ip structure + // if the dfsp has no ips set + let { ips } = action; + if (isEqual(ips, [])) { + ips = [initialIngressIp]; + } + return { + ...state, + previousIngressIps: ips, + ingressIps: ips, + }; + } + case SET_INGRESS_ENDPOINT_IPS_ERROR: { + return { + ...state, + ingressIpsError: action.error, + }; + } + case CHANGE_INGRESS_ENDPOINT_URL: { + const { url, index } = action; + return { + ...state, + ingressUrls: [ + ...state.ingressUrls.slice(0, index), + { + ...state.ingressUrls[index], + url, + }, + ...state.ingressUrls.slice(index + 1), + ], + }; + } + case CHANGE_INGRESS_ENDPOINT_ADDRESS: { + const { address, index } = action; + return { + ...state, + ingressIps: [ + ...state.ingressIps.slice(0, index), + { + ...state.ingressIps[index], + address, + }, + ...state.ingressIps.slice(index + 1), + ], + }; + } + case CHANGE_INGRESS_ENDPOINT_PORT: { + const { port, index, portIndex } = action; + return { + ...state, + ingressIps: [ + ...state.ingressIps.slice(0, index), + { + ...state.ingressIps[index], + ports: [ + ...state.ingressIps[index].ports.slice(0, portIndex), + port, + ...state.ingressIps[index].ports.slice(portIndex + 1), + ], + }, + ...state.ingressIps.slice(index + 1), + ], + }; + } + case ADD_INGRESS_ENDPOINT_IP: { + return { + ...state, + ingressIps: [...state.ingressIps, initialIngressIp], + }; + } + case REMOVE_INGRESS_ENDPOINT_IP: { + const { index } = action; + return { + ...state, + ingressIps: [...state.ingressIps.slice(0, index), ...state.ingressIps.slice(index + 1)], + }; + } + case ADD_INGRESS_ENDPOINT_PORT: { + const { index } = action; + return { + ...state, + ingressIps: [ + ...state.ingressIps.slice(0, index), + { + ...state.ingressIps[index], + ports: [...state.ingressIps[index].ports, undefined], + }, + ...state.ingressIps.slice(index + 1), + ], + }; + } + case REMOVE_INGRESS_ENDPOINT_PORT: { + const { portIndex, index } = action; + return { + ...state, + ingressIps: [ + ...state.ingressIps.slice(0, index), + { + ...state.ingressIps[index], + ports: [ + ...state.ingressIps[index].ports.slice(0, portIndex), + ...state.ingressIps[index].ports.slice(portIndex + 1), + ], + }, + ...state.ingressIps.slice(index + 1), + ], + }; + } + case UNDO_INGRESS_ENDPOINT_CHANGES: { + return { + ...state, + ingressUrls: [...state.previousIngressUrls], + ingressIps: [...state.previousIngressIps], + }; + } + default: { + return state; + } + } +} + +export { initialState, initialIngressIp, initialIngressUrl }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/sagas.ts index af1d560..d17dfc3 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/sagas.ts @@ -1,123 +1,123 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import apis from 'utils/apis'; -import { is20x } from 'utils/http'; -import { showToast, showErrorModal } from 'App/actions'; -import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { - REQUEST_INGRESS_ENDPOINTS, - SUBMIT_INGRESS_ENDPOINTS, - RequestIngressEndpointsAction, - SubmitIngressEndpointsAction, - IngressIP, - IngressURL, -} from './types'; -import { setIngressUrls, setIngressUrlsError, setIngressIps, setIngressIpsError } from './actions'; -import { apiToIpModel, apiToUrlModel, urlToApiModel, ipToApiModel } from './models'; -import { getUrlsOperations, getIpsOperations } from './selectors'; - -function* fetchIngressEndpointsUrls( - action: RequestIngressEndpointsAction | SubmitIngressEndpointsAction -) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.ingressUrls.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setIngressUrls({ urls: response.data.map(apiToUrlModel) })); - } else { - yield put(setIngressUrlsError({ error: 'Error Fetching Ingress Endpoint URLs' })); - } - } catch (e) { - yield put(setIngressUrlsError({ error: e.message })); - } -} - -function* fetchIngressEndpointsIps( - action: RequestIngressEndpointsAction | SubmitIngressEndpointsAction -) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.ingressIps.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setIngressIps({ ips: response.data.map(apiToIpModel) })); - } else { - yield put(setIngressIpsError({ error: 'Error Fetching Ingress Endpoint IPs' })); - } - } catch (e) { - yield put(setIngressIpsError({ error: e.message })); - } -} - -function* fetchIngressEndpoints( - action: RequestIngressEndpointsAction | SubmitIngressEndpointsAction -) { - yield all([call(fetchIngressEndpointsUrls, action), call(fetchIngressEndpointsIps, action)]); -} - -export function* retrieveIngressEndpointsSaga() { - yield takeLatest([REQUEST_INGRESS_ENDPOINTS], fetchIngressEndpoints); -} - -export function* saveIngressEndpoints(action: SubmitIngressEndpointsAction) { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const urlsOperations = getUrlsOperations(state); - const ipsOperations = getIpsOperations(state); - - const createUrlsActions = urlsOperations.create.map((url: IngressURL) => - call(apis.ingressUrls.create, { environmentId, body: urlToApiModel(url) }) - ); - - const updateUrlsActions = urlsOperations.update.map((url: IngressURL) => - call(apis.ingressUrl.update, { environmentId, urlId: url.id, body: urlToApiModel(url) }) - ); - - const deleteUrlsActions = urlsOperations.delete.map((url: IngressURL) => - call(apis.ingressUrl.delete, { environmentId, urlId: url.id }) - ); - - const createIpsActions = ipsOperations.create.map((ip: IngressIP) => - call(apis.ingressIps.create, { environmentId, body: ipToApiModel(ip) }) - ); - - const updateIpsActions = ipsOperations.update.map((ip: IngressIP) => - call(apis.ingressIp.update, { environmentId, ipId: ip.id, body: ipToApiModel(ip) }) - ); - - const deleteIpsActions = ipsOperations.delete.map((ip: IngressIP) => - call(apis.ingressIp.delete, { environmentId, ipId: ip.id }) - ); - - try { - const responses = yield all([ - ...createUrlsActions, - ...updateUrlsActions, - ...deleteUrlsActions, - ...createIpsActions, - ...updateIpsActions, - ...deleteIpsActions, - ]); - - const allSucceeded = responses.every(({ status }: { status: number }) => is20x(status)); - - if (allSucceeded) { - yield put(showToast()); - yield call(fetchIngressEndpoints, action); - } else { - yield put(showErrorModal('There was a problem saving the configuration')); - } - } catch (e) { - yield put(showErrorModal(e.message)); - } -} - -export function* saveIngressEndpointsSaga() { - yield takeLatest([SUBMIT_INGRESS_ENDPOINTS], saveIngressEndpoints); -} - -export default function* rootSaga() { - yield all([retrieveIngressEndpointsSaga(), saveIngressEndpointsSaga()]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import apis from 'utils/apis'; +import { is20x } from 'utils/http'; +import { showToast, showErrorModal } from 'App/actions'; +import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { + REQUEST_INGRESS_ENDPOINTS, + SUBMIT_INGRESS_ENDPOINTS, + RequestIngressEndpointsAction, + SubmitIngressEndpointsAction, + IngressIP, + IngressURL, +} from './types'; +import { setIngressUrls, setIngressUrlsError, setIngressIps, setIngressIpsError } from './actions'; +import { apiToIpModel, apiToUrlModel, urlToApiModel, ipToApiModel } from './models'; +import { getUrlsOperations, getIpsOperations } from './selectors'; + +function* fetchIngressEndpointsUrls( + action: RequestIngressEndpointsAction | SubmitIngressEndpointsAction +) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.ingressUrls.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setIngressUrls({ urls: response.data.map(apiToUrlModel) })); + } else { + yield put(setIngressUrlsError({ error: 'Error Fetching Ingress Endpoint URLs' })); + } + } catch (e) { + yield put(setIngressUrlsError({ error: e.message })); + } +} + +function* fetchIngressEndpointsIps( + action: RequestIngressEndpointsAction | SubmitIngressEndpointsAction +) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.ingressIps.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setIngressIps({ ips: response.data.map(apiToIpModel) })); + } else { + yield put(setIngressIpsError({ error: 'Error Fetching Ingress Endpoint IPs' })); + } + } catch (e) { + yield put(setIngressIpsError({ error: e.message })); + } +} + +function* fetchIngressEndpoints( + action: RequestIngressEndpointsAction | SubmitIngressEndpointsAction +) { + yield all([call(fetchIngressEndpointsUrls, action), call(fetchIngressEndpointsIps, action)]); +} + +export function* retrieveIngressEndpointsSaga() { + yield takeLatest([REQUEST_INGRESS_ENDPOINTS], fetchIngressEndpoints); +} + +export function* saveIngressEndpoints(action: SubmitIngressEndpointsAction) { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const urlsOperations = getUrlsOperations(state); + const ipsOperations = getIpsOperations(state); + + const createUrlsActions = urlsOperations.create.map((url: IngressURL) => + call(apis.ingressUrls.create, { environmentId, body: urlToApiModel(url) }) + ); + + const updateUrlsActions = urlsOperations.update.map((url: IngressURL) => + call(apis.ingressUrl.update, { environmentId, urlId: url.id, body: urlToApiModel(url) }) + ); + + const deleteUrlsActions = urlsOperations.delete.map((url: IngressURL) => + call(apis.ingressUrl.delete, { environmentId, urlId: url.id }) + ); + + const createIpsActions = ipsOperations.create.map((ip: IngressIP) => + call(apis.ingressIps.create, { environmentId, body: ipToApiModel(ip) }) + ); + + const updateIpsActions = ipsOperations.update.map((ip: IngressIP) => + call(apis.ingressIp.update, { environmentId, ipId: ip.id, body: ipToApiModel(ip) }) + ); + + const deleteIpsActions = ipsOperations.delete.map((ip: IngressIP) => + call(apis.ingressIp.delete, { environmentId, ipId: ip.id }) + ); + + try { + const responses = yield all([ + ...createUrlsActions, + ...updateUrlsActions, + ...deleteUrlsActions, + ...createIpsActions, + ...updateIpsActions, + ...deleteIpsActions, + ]); + + const allSucceeded = responses.every(({ status }: { status: number }) => is20x(status)); + + if (allSucceeded) { + yield put(showToast()); + yield call(fetchIngressEndpoints, action); + } else { + yield put(showErrorModal('There was a problem saving the configuration')); + } + } catch (e) { + yield put(showErrorModal(e.message)); + } +} + +export function* saveIngressEndpointsSaga() { + yield takeLatest([SUBMIT_INGRESS_ENDPOINTS], saveIngressEndpoints); +} + +export default function* rootSaga() { + yield all([retrieveIngressEndpointsSaga(), saveIngressEndpointsSaga()]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/selectors.ts index 680710c..7c29717 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/selectors.ts @@ -1,149 +1,149 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import isEqual from 'lodash/isEqual'; -import find from 'lodash/find'; -import { validate, getIsValid } from '@modusbox/modusbox-ui-components/dist/redux-validation'; -import * as testers from 'utils/testers'; -import { States } from '../types'; -import { - getIngressUrlValidation, - getIngressAddressValidation, - getIngressPortValidation, -} from './validators'; - -export const getPreviousIngressUrls = (state: State) => - state.wizard.environment.endpoints.ingress.previousIngressUrls; -export const getPreviousIngressIps = (state: State) => - state.wizard.environment.endpoints.ingress.previousIngressIps; -export const getIngressUrls = (state: State) => - state.wizard.environment.endpoints.ingress.ingressUrls; -export const getIngressIps = (state: State) => - state.wizard.environment.endpoints.ingress.ingressIps; -export const getIngressUrlsError = (state: State) => - state.wizard.environment.endpoints.ingress.ingressUrlsError; -export const getIngressIpsError = (state: State) => - state.wizard.environment.endpoints.ingress.ingressIpsError; - -export const getIngressError = createSelector( - getIngressUrlsError, - getIngressIpsError, - testers.getAnyIsNotNil -); - -export const getIngressUrlsValidationResult = createSelector( - getIngressUrls, - getIngressUrlValidation, - (urls, urlValidation) => urls.map(({ url }) => validate(url, urlValidation)) -); - -export const getIngressIpsValidationResult = createSelector( - getIngressIps, - getIngressAddressValidation, - getIngressPortValidation, - (ips, addressValidation, portValidation) => - ips.map(({ address, ports }) => ({ - address: validate(address, addressValidation), - ports: ports.map((port) => validate(port, portValidation)), - })) -); - -export const getIsIngressUrlsValid = createSelector(getIngressUrlsValidationResult, (results) => - results.every(getIsValid) -); - -export const getIsIngressIpsValid = createSelector(getIngressIpsValidationResult, (results) => - results.every((result) => getIsValid(result.address) && result.ports.every(getIsValid)) -); - -const getIsIngressUrlsChanged = createSelector( - getPreviousIngressUrls, - getIngressUrls, - testers.isNotEqual -); - -const getIsIngressIpsChanged = createSelector( - getPreviousIngressIps, - getIngressIps, - testers.isNotEqual -); - -export const getIsIngressChanged = createSelector( - getIsIngressUrlsChanged, - getIsIngressIpsChanged, - testers.getAnyIs(true) -); - -export const getIsIngressSubmitEnabled = createSelector( - getIsIngressUrlsValid, - getIsIngressIpsValid, - getIsIngressChanged, - testers.getAllAre(true) -); - -export const getIsIngressIpsReadPending = createSelector( - (state: State) => state.api, - isPending('ingressIps.read') -); -export const getIsIngressUrlsReadPending = createSelector( - (state: State) => state.api, - isPending('ingressUrls.read') -); -const getIsIngressUrlCreatePending = createSelector( - (state: State) => state.api, - isPending('ingressUrls.create') -); -const getIsIngressUrlEditPending = createSelector( - (state: State) => state.api, - isPending('ingressUrl.update') -); -const getIsIngressIpCreatePending = createSelector( - (state: State) => state.api, - isPending('ingressIps.create') -); -const getIsIngressIpEditPending = createSelector( - (state: State) => state.api, - isPending('ingressIp.update') -); -const getIsIngressIpDeletePending = createSelector( - (state: State) => state.api, - isPending('ingressIp.delete') -); - -export const getIsIngressPending = createSelector( - getIsIngressIpsReadPending, - getIsIngressUrlsReadPending, - testers.getAnyIs(true) -); -export const getIsIngressSubmitPending = createSelector( - getIsIngressUrlCreatePending, - getIsIngressUrlEditPending, - getIsIngressIpCreatePending, - getIsIngressIpEditPending, - getIsIngressIpDeletePending, - testers.getAnyIs(true) -); - -export const getIpsOperations = createSelector( - getIngressIps, - getPreviousIngressIps, - (ips, previousIps) => ({ - create: ips.filter((ip) => ip.state === States.Unset), - update: ips - .filter((ip) => ip.state !== States.Unset) - .filter((ip) => !isEqual(find(previousIps, { id: ip.id }), ip)), - delete: previousIps.filter((ip) => !find(ips, { id: ip.id })), - }) -); - -export const getUrlsOperations = createSelector( - getIngressUrls, - getPreviousIngressUrls, - (urls, previousUrls) => ({ - create: urls.filter((url) => url.state === States.Unset), - update: urls - .filter((url) => url.state !== States.Unset) - .filter((url) => !isEqual(find(previousUrls, { id: url.id }), url)), - delete: previousUrls.filter((url) => !find(urls, { id: url.id })), - }) -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import isEqual from 'lodash/isEqual'; +import find from 'lodash/find'; +import { validate, getIsValid } from '@modusbox/modusbox-ui-components/dist/redux-validation'; +import * as testers from 'utils/testers'; +import { States } from '../types'; +import { + getIngressUrlValidation, + getIngressAddressValidation, + getIngressPortValidation, +} from './validators'; + +export const getPreviousIngressUrls = (state: State) => + state.wizard.environment.endpoints.ingress.previousIngressUrls; +export const getPreviousIngressIps = (state: State) => + state.wizard.environment.endpoints.ingress.previousIngressIps; +export const getIngressUrls = (state: State) => + state.wizard.environment.endpoints.ingress.ingressUrls; +export const getIngressIps = (state: State) => + state.wizard.environment.endpoints.ingress.ingressIps; +export const getIngressUrlsError = (state: State) => + state.wizard.environment.endpoints.ingress.ingressUrlsError; +export const getIngressIpsError = (state: State) => + state.wizard.environment.endpoints.ingress.ingressIpsError; + +export const getIngressError = createSelector( + getIngressUrlsError, + getIngressIpsError, + testers.getAnyIsNotNil +); + +export const getIngressUrlsValidationResult = createSelector( + getIngressUrls, + getIngressUrlValidation, + (urls, urlValidation) => urls.map(({ url }) => validate(url, urlValidation)) +); + +export const getIngressIpsValidationResult = createSelector( + getIngressIps, + getIngressAddressValidation, + getIngressPortValidation, + (ips, addressValidation, portValidation) => + ips.map(({ address, ports }) => ({ + address: validate(address, addressValidation), + ports: ports.map((port) => validate(port, portValidation)), + })) +); + +export const getIsIngressUrlsValid = createSelector(getIngressUrlsValidationResult, (results) => + results.every(getIsValid) +); + +export const getIsIngressIpsValid = createSelector(getIngressIpsValidationResult, (results) => + results.every((result) => getIsValid(result.address) && result.ports.every(getIsValid)) +); + +const getIsIngressUrlsChanged = createSelector( + getPreviousIngressUrls, + getIngressUrls, + testers.isNotEqual +); + +const getIsIngressIpsChanged = createSelector( + getPreviousIngressIps, + getIngressIps, + testers.isNotEqual +); + +export const getIsIngressChanged = createSelector( + getIsIngressUrlsChanged, + getIsIngressIpsChanged, + testers.getAnyIs(true) +); + +export const getIsIngressSubmitEnabled = createSelector( + getIsIngressUrlsValid, + getIsIngressIpsValid, + getIsIngressChanged, + testers.getAllAre(true) +); + +export const getIsIngressIpsReadPending = createSelector( + (state: State) => state.api, + isPending('ingressIps.read') +); +export const getIsIngressUrlsReadPending = createSelector( + (state: State) => state.api, + isPending('ingressUrls.read') +); +const getIsIngressUrlCreatePending = createSelector( + (state: State) => state.api, + isPending('ingressUrls.create') +); +const getIsIngressUrlEditPending = createSelector( + (state: State) => state.api, + isPending('ingressUrl.update') +); +const getIsIngressIpCreatePending = createSelector( + (state: State) => state.api, + isPending('ingressIps.create') +); +const getIsIngressIpEditPending = createSelector( + (state: State) => state.api, + isPending('ingressIp.update') +); +const getIsIngressIpDeletePending = createSelector( + (state: State) => state.api, + isPending('ingressIp.delete') +); + +export const getIsIngressPending = createSelector( + getIsIngressIpsReadPending, + getIsIngressUrlsReadPending, + testers.getAnyIs(true) +); +export const getIsIngressSubmitPending = createSelector( + getIsIngressUrlCreatePending, + getIsIngressUrlEditPending, + getIsIngressIpCreatePending, + getIsIngressIpEditPending, + getIsIngressIpDeletePending, + testers.getAnyIs(true) +); + +export const getIpsOperations = createSelector( + getIngressIps, + getPreviousIngressIps, + (ips, previousIps) => ({ + create: ips.filter((ip) => ip.state === States.Unset), + update: ips + .filter((ip) => ip.state !== States.Unset) + .filter((ip) => !isEqual(find(previousIps, { id: ip.id }), ip)), + delete: previousIps.filter((ip) => !find(ips, { id: ip.id })), + }) +); + +export const getUrlsOperations = createSelector( + getIngressUrls, + getPreviousIngressUrls, + (urls, previousUrls) => ({ + create: urls.filter((url) => url.state === States.Unset), + update: urls + .filter((url) => url.state !== States.Unset) + .filter((url) => !isEqual(find(previousUrls, { id: url.id }), url)), + delete: previousUrls.filter((url) => !find(urls, { id: url.id })), + }) +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/types.ts index 9fe1602..b4afee7 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/types.ts @@ -1,133 +1,133 @@ -import { States } from '../types'; - -export const REQUEST_INGRESS_ENDPOINTS = 'Ingress Endpoint / Request endpoints'; -export const SUBMIT_INGRESS_ENDPOINTS = 'Ingress Endpoint / Submit endpoints'; -export const RESET_INGRESS_ENDPOINT = 'Ingress Endpoint / Reset'; -export const SET_INGRESS_ENDPOINT_URLS = 'Ingress Endpoint / Set Urls'; -export const SET_INGRESS_ENDPOINT_URLS_ERROR = 'Ingress Endpoint / Set Urls Error'; -export const SET_INGRESS_ENDPOINT_IPS = 'Ingress Endpoint / Set Ips'; -export const SET_INGRESS_ENDPOINT_IPS_ERROR = 'Ingress Endpoint / Set Ips Error'; -export const CHANGE_INGRESS_ENDPOINT_URL = 'Ingress Endpoint / Change URL'; -export const CHANGE_INGRESS_ENDPOINT_ADDRESS = 'Ingress Endpoint / Change IP'; -export const CHANGE_INGRESS_ENDPOINT_PORT = 'Ingress Endpoint / Change Port'; -export const ADD_INGRESS_ENDPOINT_IP = 'Ingress Endpoint / Add Configuration'; -export const REMOVE_INGRESS_ENDPOINT_IP = 'Ingress Endpoint / Remove Configuration'; -export const ADD_INGRESS_ENDPOINT_PORT = 'Ingress Endpoint / Add Port'; -export const REMOVE_INGRESS_ENDPOINT_PORT = 'Ingress Endpoint / Remove Port'; -export const UNDO_INGRESS_ENDPOINT_CHANGES = 'Ingress Endpoint / Undo Changes'; - -export interface ExternalIngressIP { - id?: string; - state: States; - value: { - address?: string; - ports: (string | undefined)[]; - }; -} - -export interface ExternalIngressURL { - id?: string; - state: States; - value: { - url?: string; - }; -} - -export interface IngressIP { - id?: string; - state: States; - address?: string; - ports: (string | undefined)[]; -} - -export interface IngressURL { - id?: string; - state: States; - url?: string; -} - -export interface IngressState { - previousIngressUrls: IngressURL[]; - ingressUrlsError: string | null; - ingressUrls: IngressURL[]; - previousIngressIps: IngressIP[]; - ingressIpsError: string | null; - ingressIps: IngressIP[]; -} - -export interface RequestIngressEndpointsAction { - type: typeof REQUEST_INGRESS_ENDPOINTS; -} -export interface SubmitIngressEndpointsAction { - type: typeof SUBMIT_INGRESS_ENDPOINTS; -} -export interface ResetIngressAction { - type: typeof RESET_INGRESS_ENDPOINT; -} -export interface SetIngressUrlsAction { - type: typeof SET_INGRESS_ENDPOINT_URLS; - urls: IngressURL[]; -} -export interface SetIngressUrlsErrorAction { - type: typeof SET_INGRESS_ENDPOINT_URLS_ERROR; - error: string | null; -} -export interface SetIngressIpsAction { - type: typeof SET_INGRESS_ENDPOINT_IPS; - ips: IngressIP[]; -} -export interface SetIngressIpsErrorAction { - type: typeof SET_INGRESS_ENDPOINT_IPS_ERROR; - error: string | null; -} -export interface ChangeIngressUrlAction { - type: typeof CHANGE_INGRESS_ENDPOINT_URL; - url: string; - index: number; -} -export interface ChangeIngressAddressAction { - type: typeof CHANGE_INGRESS_ENDPOINT_ADDRESS; - address: string; - index: number; -} -export interface ChangeIngressPortAction { - type: typeof CHANGE_INGRESS_ENDPOINT_PORT; - port: string; - index: number; - portIndex: number; -} -export interface AddIngressIpAction { - type: typeof ADD_INGRESS_ENDPOINT_IP; -} -export interface RemoveIngressIpAction { - type: typeof REMOVE_INGRESS_ENDPOINT_IP; - index: number; -} -export interface AddIngressPortAction { - type: typeof ADD_INGRESS_ENDPOINT_PORT; - index: number; -} -export interface RemoveIngressPortAction { - type: typeof REMOVE_INGRESS_ENDPOINT_PORT; - index: number; - portIndex: number; -} -export interface UndoIngressChangesAction { - type: typeof UNDO_INGRESS_ENDPOINT_CHANGES; -} - -export type IngressActionTypes = - | RequestIngressEndpointsAction - | ResetIngressAction - | SetIngressUrlsAction - | SetIngressUrlsErrorAction - | SetIngressIpsAction - | SetIngressIpsErrorAction - | ChangeIngressUrlAction - | ChangeIngressAddressAction - | ChangeIngressPortAction - | AddIngressIpAction - | RemoveIngressIpAction - | AddIngressPortAction - | RemoveIngressPortAction - | UndoIngressChangesAction; +import { States } from '../types'; + +export const REQUEST_INGRESS_ENDPOINTS = 'Ingress Endpoint / Request endpoints'; +export const SUBMIT_INGRESS_ENDPOINTS = 'Ingress Endpoint / Submit endpoints'; +export const RESET_INGRESS_ENDPOINT = 'Ingress Endpoint / Reset'; +export const SET_INGRESS_ENDPOINT_URLS = 'Ingress Endpoint / Set Urls'; +export const SET_INGRESS_ENDPOINT_URLS_ERROR = 'Ingress Endpoint / Set Urls Error'; +export const SET_INGRESS_ENDPOINT_IPS = 'Ingress Endpoint / Set Ips'; +export const SET_INGRESS_ENDPOINT_IPS_ERROR = 'Ingress Endpoint / Set Ips Error'; +export const CHANGE_INGRESS_ENDPOINT_URL = 'Ingress Endpoint / Change URL'; +export const CHANGE_INGRESS_ENDPOINT_ADDRESS = 'Ingress Endpoint / Change IP'; +export const CHANGE_INGRESS_ENDPOINT_PORT = 'Ingress Endpoint / Change Port'; +export const ADD_INGRESS_ENDPOINT_IP = 'Ingress Endpoint / Add Configuration'; +export const REMOVE_INGRESS_ENDPOINT_IP = 'Ingress Endpoint / Remove Configuration'; +export const ADD_INGRESS_ENDPOINT_PORT = 'Ingress Endpoint / Add Port'; +export const REMOVE_INGRESS_ENDPOINT_PORT = 'Ingress Endpoint / Remove Port'; +export const UNDO_INGRESS_ENDPOINT_CHANGES = 'Ingress Endpoint / Undo Changes'; + +export interface ExternalIngressIP { + id?: string; + state: States; + value: { + address?: string; + ports: (string | undefined)[]; + }; +} + +export interface ExternalIngressURL { + id?: string; + state: States; + value: { + url?: string; + }; +} + +export interface IngressIP { + id?: string; + state: States; + address?: string; + ports: (string | undefined)[]; +} + +export interface IngressURL { + id?: string; + state: States; + url?: string; +} + +export interface IngressState { + previousIngressUrls: IngressURL[]; + ingressUrlsError: string | null; + ingressUrls: IngressURL[]; + previousIngressIps: IngressIP[]; + ingressIpsError: string | null; + ingressIps: IngressIP[]; +} + +export interface RequestIngressEndpointsAction { + type: typeof REQUEST_INGRESS_ENDPOINTS; +} +export interface SubmitIngressEndpointsAction { + type: typeof SUBMIT_INGRESS_ENDPOINTS; +} +export interface ResetIngressAction { + type: typeof RESET_INGRESS_ENDPOINT; +} +export interface SetIngressUrlsAction { + type: typeof SET_INGRESS_ENDPOINT_URLS; + urls: IngressURL[]; +} +export interface SetIngressUrlsErrorAction { + type: typeof SET_INGRESS_ENDPOINT_URLS_ERROR; + error: string | null; +} +export interface SetIngressIpsAction { + type: typeof SET_INGRESS_ENDPOINT_IPS; + ips: IngressIP[]; +} +export interface SetIngressIpsErrorAction { + type: typeof SET_INGRESS_ENDPOINT_IPS_ERROR; + error: string | null; +} +export interface ChangeIngressUrlAction { + type: typeof CHANGE_INGRESS_ENDPOINT_URL; + url: string; + index: number; +} +export interface ChangeIngressAddressAction { + type: typeof CHANGE_INGRESS_ENDPOINT_ADDRESS; + address: string; + index: number; +} +export interface ChangeIngressPortAction { + type: typeof CHANGE_INGRESS_ENDPOINT_PORT; + port: string; + index: number; + portIndex: number; +} +export interface AddIngressIpAction { + type: typeof ADD_INGRESS_ENDPOINT_IP; +} +export interface RemoveIngressIpAction { + type: typeof REMOVE_INGRESS_ENDPOINT_IP; + index: number; +} +export interface AddIngressPortAction { + type: typeof ADD_INGRESS_ENDPOINT_PORT; + index: number; +} +export interface RemoveIngressPortAction { + type: typeof REMOVE_INGRESS_ENDPOINT_PORT; + index: number; + portIndex: number; +} +export interface UndoIngressChangesAction { + type: typeof UNDO_INGRESS_ENDPOINT_CHANGES; +} + +export type IngressActionTypes = + | RequestIngressEndpointsAction + | ResetIngressAction + | SetIngressUrlsAction + | SetIngressUrlsErrorAction + | SetIngressIpsAction + | SetIngressIpsErrorAction + | ChangeIngressUrlAction + | ChangeIngressAddressAction + | ChangeIngressPortAction + | AddIngressIpAction + | RemoveIngressIpAction + | AddIngressPortAction + | RemoveIngressPortAction + | UndoIngressChangesAction; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/validators.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/validators.ts index 6a9cdbc..230ddca 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/validators.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/Ingress/validators.ts @@ -1,8 +1,8 @@ -import { createValidation, vd } from '@modusbox/modusbox-ui-components/dist/redux-validation'; -import { URLValidator, portValidator, IPAddressValidator } from '../validators'; - -const getIngressUrlValidation = () => createValidation([vd.isRequired, URLValidator]); -const getIngressPortValidation = () => createValidation([vd.isRequired, portValidator]); -const getIngressAddressValidation = () => createValidation([vd.isRequired, IPAddressValidator]); - -export { getIngressUrlValidation, getIngressAddressValidation, getIngressPortValidation }; +import { createValidation, vd } from '@modusbox/modusbox-ui-components/dist/redux-validation'; +import { URLValidator, portValidator, IPAddressValidator } from '../validators'; + +const getIngressUrlValidation = () => createValidation([vd.isRequired, URLValidator]); +const getIngressPortValidation = () => createValidation([vd.isRequired, portValidator]); +const getIngressAddressValidation = () => createValidation([vd.isRequired, IPAddressValidator]); + +export { getIngressUrlValidation, getIngressAddressValidation, getIngressPortValidation }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/index.ts index 41fa65b..32ede71 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/index.ts @@ -1,7 +1,7 @@ -import Endpoints from './Endpoints'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default Endpoints; -export { reducer, types, sagas }; +import Endpoints from './Endpoints'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default Endpoints; +export { reducer, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/reducers.ts index bccc63f..aff7a10 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/reducers.ts @@ -1,13 +1,13 @@ -import { Reducer, combineReducers } from 'redux'; - -import { reducer as ingressReducer } from './Ingress'; -import { reducer as egressReducer } from './Egress'; -import { reducer as hubReducer } from './Hub'; - -const reducer: Reducer = combineReducers({ - ingress: ingressReducer, - egress: egressReducer, - hub: hubReducer, -}); - -export default reducer; +import { Reducer, combineReducers } from 'redux'; + +import { reducer as ingressReducer } from './Ingress'; +import { reducer as egressReducer } from './Egress'; +import { reducer as hubReducer } from './Hub'; + +const reducer: Reducer = combineReducers({ + ingress: ingressReducer, + egress: egressReducer, + hub: hubReducer, +}); + +export default reducer; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/sagas.ts index 3a0950d..8b6ddf1 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/sagas.ts @@ -1,10 +1,10 @@ -import { all } from 'redux-saga/effects'; -import { sagas as ingressEndpointsSagas } from './Ingress'; -import { sagas as egressEndpointsSagas } from './Egress'; -import { sagas as hubEndpointsSagas } from './Hub'; - -function* rootSaga() { - yield all([ingressEndpointsSagas(), egressEndpointsSagas(), hubEndpointsSagas()]); -} - -export default rootSaga; +import { all } from 'redux-saga/effects'; +import { sagas as ingressEndpointsSagas } from './Ingress'; +import { sagas as egressEndpointsSagas } from './Egress'; +import { sagas as hubEndpointsSagas } from './Hub'; + +function* rootSaga() { + yield all([ingressEndpointsSagas(), egressEndpointsSagas(), hubEndpointsSagas()]); +} + +export default rootSaga; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/types.ts index 04df3aa..138a12a 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/types.ts @@ -1,20 +1,20 @@ -export enum States { - Unset = 'UNSET', - New = 'NEW', - Confirmed = 'CONFIRMED', -} - -export enum Directions { - Ingress = 'INGRESS', - Egress = 'EGRESS', -} - -export enum Types { - IP = 'IP', - URL = 'URL', -} - -export enum ValidationStates { - Valid = 'VALID', - Invalid = 'INVALID', -} +export enum States { + Unset = 'UNSET', + New = 'NEW', + Confirmed = 'CONFIRMED', +} + +export enum Directions { + Ingress = 'INGRESS', + Egress = 'EGRESS', +} + +export enum Types { + IP = 'IP', + URL = 'URL', +} + +export enum ValidationStates { + Valid = 'VALID', + Invalid = 'INVALID', +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/validators.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/validators.ts index 644214f..3419d8d 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/validators.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/Endpoints/validators.ts @@ -1,63 +1,63 @@ -import { createValidator } from '@modusbox/modusbox-ui-components/dist/redux-validation'; - -const isNumberBetween = (lower: number, higher: number) => (value: string | number) => - value !== '' && !isNaN(value as number) && value >= lower && value <= higher; -const isSubnet = isNumberBetween(0, 32); -const isPort = isNumberBetween(0, 65535); - -// Tests for a valida Host -// eslint-disable-next-line max-len -const hostRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/; -const hostValidator = createValidator( - 'It must be a valid Host', - (value: string | undefined) => value !== undefined && hostRegex.test(value) -); - -// Tests for a valid DNS address -// eslint-disable-next-line max-len -const DNSRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/; -const DNSValidator = createValidator( - 'It must be a valid DNS', - (value: string | undefined) => value !== undefined && DNSRegex.test(value) -); - -// Tests for a valid HTTP / HTTPS URL -// eslint-disable-next-line max-len -const URLRegex = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/; -const URLValidator = createValidator( - 'It must be a valid URL', - (value: string | undefined) => value !== undefined && URLRegex.test(value) -); - -// Tests for a valid IPv4 Address -// eslint-disable-next-line max-len -const IPRegex = /^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$/; -const IPAddressValidator = createValidator( - 'It must be a valid IP Address', - (value: string | undefined) => { - if (!value) { - return false; - } - const [address, subnet] = value.split('/'); - const isValidAddress = IPRegex.test(address); - const isValidSubnet = subnet === undefined || isSubnet(subnet); - return isValidAddress && isValidSubnet; - } -); - -const portValidator = createValidator( - 'It must be a valid port / ports range', - (value: string | undefined) => { - if (!value) { - return false; - } - const ports = value.split('-'); - const isValidPortCount = ports.length === 1 || ports.length === 2; - const isValidPortNum = ports.every(isPort); - const isValidPortRange = - ports.length === 2 ? parseInt(ports[1], 10) > parseInt(ports[0], 10) : true; - return isValidPortCount && isValidPortNum && isValidPortRange; - } -); - -export { hostValidator, DNSValidator, URLValidator, IPAddressValidator, portValidator }; +import { createValidator } from '@modusbox/modusbox-ui-components/dist/redux-validation'; + +const isNumberBetween = (lower: number, higher: number) => (value: string | number) => + value !== '' && !isNaN(value as number) && value >= lower && value <= higher; +const isSubnet = isNumberBetween(0, 32); +const isPort = isNumberBetween(0, 65535); + +// Tests for a valida Host +// eslint-disable-next-line max-len +const hostRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/; +const hostValidator = createValidator( + 'It must be a valid Host', + (value: string | undefined) => value !== undefined && hostRegex.test(value) +); + +// Tests for a valid DNS address +// eslint-disable-next-line max-len +const DNSRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/; +const DNSValidator = createValidator( + 'It must be a valid DNS', + (value: string | undefined) => value !== undefined && DNSRegex.test(value) +); + +// Tests for a valid HTTP / HTTPS URL +// eslint-disable-next-line max-len +const URLRegex = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/; +const URLValidator = createValidator( + 'It must be a valid URL', + (value: string | undefined) => value !== undefined && URLRegex.test(value) +); + +// Tests for a valid IPv4 Address +// eslint-disable-next-line max-len +const IPRegex = /^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$/; +const IPAddressValidator = createValidator( + 'It must be a valid IP Address', + (value: string | undefined) => { + if (!value) { + return false; + } + const [address, subnet] = value.split('/'); + const isValidAddress = IPRegex.test(address); + const isValidSubnet = subnet === undefined || isSubnet(subnet); + return isValidAddress && isValidSubnet; + } +); + +const portValidator = createValidator( + 'It must be a valid port / ports range', + (value: string | undefined) => { + if (!value) { + return false; + } + const ports = value.split('-'); + const isValidPortCount = ports.length === 1 || ports.length === 2; + const isValidPortNum = ports.every(isPort); + const isValidPortRange = + ports.length === 2 ? parseInt(ports[1], 10) > parseInt(ports[0], 10) : true; + return isValidPortCount && isValidPortNum && isValidPortRange; + } +); + +export { hostValidator, DNSValidator, URLValidator, IPAddressValidator, portValidator }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/DFSPJWS.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/DFSPJWS.tsx index 362acd7..b317260 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/DFSPJWS.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/DFSPJWS.tsx @@ -1,221 +1,221 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { - Button, - CertificateInfo, - CertificateModal, - CertificateValidation, - FileControls, - FormInput, - MessageBox, -} from 'components'; -import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; -import { State, Dispatch } from 'store/types'; - -import { AnyAction } from 'redux'; -import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; -import { withMount } from 'utils/hocs'; -import { - changeDfspJWSCertificate, - downloadDfspJWSCertificate, - showDfspJWSCertificateModal, - hideDfspJWSCertificateModal, - changeDfspJWSIntermediateChain, - downloadDfspJWSIntermediateChain, - showDfspJWSIntermediateChainModal, - hideDfspJWSIntermediateChainModal, - submitDfspJWSCertificates, - storeDfspJWSCertificate, -} from './actions'; -import { - getDfspJWSError, - getDfspJWSCertificate, - getDfspJWSIntermediateChain, - getDfspJWSCertificateInfo, - getDfspJWSIntermediateChainInfo, - getDfspJWSValidations, - getDfspJWSValidationState, - getIsDfspJWSCertificateModalVisible, - getIsDfspJWSIntermediateChainModalVisible, - getIsDfspJWSSubmitEnabled, - getIsDfspJWSSubmitPending, -} from './selectors'; - -import './index.css'; - -const stateProps = (state: State) => ({ - environmentName: getEnvironmentName(state), - error: getDfspJWSError(state), - jwsCertificate: getDfspJWSCertificate(state), - intermediateChain: getDfspJWSIntermediateChain(state), - jwsCertificateInfo: getDfspJWSCertificateInfo(state), - intermediateChainInfo: getDfspJWSIntermediateChainInfo(state), - validations: getDfspJWSValidations(state), - validationState: getDfspJWSValidationState(state), - isJwsCertificateModalVisible: getIsDfspJWSCertificateModalVisible(state), - isIntermediateChainModalVisible: getIsDfspJWSIntermediateChainModalVisible(state), - isSubmitEnabled: getIsDfspJWSSubmitEnabled(state), - isSubmitPending: getIsDfspJWSSubmitPending(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(storeDfspJWSCertificate()), - onJwsCertificateChange: (cert: string) => - dispatch(changeDfspJWSCertificate({ certificate: cert })), - onJwsCertificateViewClick: () => dispatch(showDfspJWSCertificateModal()), - onJwsCertificateDownloadClick: () => dispatch(downloadDfspJWSCertificate()), - onJwsCertificateModalCloseClick: () => dispatch(hideDfspJWSCertificateModal()), - onIntermediateChainChange: (cert: string) => - dispatch(changeDfspJWSIntermediateChain({ certificate: cert })), - onIntermediateChainDownloadClick: () => dispatch(downloadDfspJWSIntermediateChain()), - onIntermediateChainViewClick: () => dispatch(showDfspJWSIntermediateChainModal()), - onIntermediateChainModalCloseClick: () => dispatch(hideDfspJWSIntermediateChainModal()), - onCreateCertificateClick: () => dispatch(submitDfspJWSCertificates()), -}); - -interface DfspJWSProps { - environmentName: string; - error: ErrorMessage; - jwsCertificate: string; - intermediateChain: string; - jwsCertificateInfo?: CertInfo; - intermediateChainInfo?: CertInfo; - validations: CertificateValidationResults[]; - validationState?: string; - isJwsCertificateModalVisible: boolean; - isIntermediateChainModalVisible: boolean; - isSubmitEnabled: boolean; - isSubmitPending: boolean; - isReadPending?: boolean; - onJwsCertificateChange: (certificate: string) => void; - onJwsCertificateViewClick: () => void; - onJwsCertificateDownloadClick: () => AnyAction; - onJwsCertificateModalCloseClick: () => void; - onIntermediateChainChange: (certificate: string) => void; - onIntermediateChainViewClick: () => void; - onIntermediateChainDownloadClick: () => AnyAction; - onIntermediateChainModalCloseClick: () => void; - onCreateCertificateClick: () => void; -} - -const DfspJWS: FC = ({ - environmentName, - error, - jwsCertificate, - intermediateChain, - jwsCertificateInfo, - intermediateChainInfo, - validations, - validationState, - isJwsCertificateModalVisible, - isIntermediateChainModalVisible, - isSubmitEnabled, - isSubmitPending, - onJwsCertificateChange, - onJwsCertificateViewClick, - onJwsCertificateDownloadClick, - onJwsCertificateModalCloseClick, - onIntermediateChainChange, - onIntermediateChainViewClick, - onIntermediateChainDownloadClick, - onIntermediateChainModalCloseClick, - onCreateCertificateClick, -}) => { - if (error) { - return ( - - ); - } - - return ( -
-
-
- -
- -
- -
-
- - {jwsCertificate && ( - - )} -
- {jwsCertificateInfo && } -
- -
-
- - {intermediateChain && ( - - )} -
- {intermediateChainInfo && } -
- - {isJwsCertificateModalVisible && ( - - )} - {isIntermediateChainModalVisible && ( - - )} -
- ); -}; - -const MountedDfspJWS = withMount(DfspJWS, 'onMount'); - -export default connect(stateProps, actionProps)(MountedDfspJWS); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { + Button, + CertificateInfo, + CertificateModal, + CertificateValidation, + FileControls, + FormInput, + MessageBox, +} from 'components'; +import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; +import { State, Dispatch } from 'store/types'; + +import { AnyAction } from 'redux'; +import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; +import { withMount } from 'utils/hocs'; +import { + changeDfspJWSCertificate, + downloadDfspJWSCertificate, + showDfspJWSCertificateModal, + hideDfspJWSCertificateModal, + changeDfspJWSIntermediateChain, + downloadDfspJWSIntermediateChain, + showDfspJWSIntermediateChainModal, + hideDfspJWSIntermediateChainModal, + submitDfspJWSCertificates, + storeDfspJWSCertificate, +} from './actions'; +import { + getDfspJWSError, + getDfspJWSCertificate, + getDfspJWSIntermediateChain, + getDfspJWSCertificateInfo, + getDfspJWSIntermediateChainInfo, + getDfspJWSValidations, + getDfspJWSValidationState, + getIsDfspJWSCertificateModalVisible, + getIsDfspJWSIntermediateChainModalVisible, + getIsDfspJWSSubmitEnabled, + getIsDfspJWSSubmitPending, +} from './selectors'; + +import './index.css'; + +const stateProps = (state: State) => ({ + environmentName: getEnvironmentName(state), + error: getDfspJWSError(state), + jwsCertificate: getDfspJWSCertificate(state), + intermediateChain: getDfspJWSIntermediateChain(state), + jwsCertificateInfo: getDfspJWSCertificateInfo(state), + intermediateChainInfo: getDfspJWSIntermediateChainInfo(state), + validations: getDfspJWSValidations(state), + validationState: getDfspJWSValidationState(state), + isJwsCertificateModalVisible: getIsDfspJWSCertificateModalVisible(state), + isIntermediateChainModalVisible: getIsDfspJWSIntermediateChainModalVisible(state), + isSubmitEnabled: getIsDfspJWSSubmitEnabled(state), + isSubmitPending: getIsDfspJWSSubmitPending(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(storeDfspJWSCertificate()), + onJwsCertificateChange: (cert: string) => + dispatch(changeDfspJWSCertificate({ certificate: cert })), + onJwsCertificateViewClick: () => dispatch(showDfspJWSCertificateModal()), + onJwsCertificateDownloadClick: () => dispatch(downloadDfspJWSCertificate()), + onJwsCertificateModalCloseClick: () => dispatch(hideDfspJWSCertificateModal()), + onIntermediateChainChange: (cert: string) => + dispatch(changeDfspJWSIntermediateChain({ certificate: cert })), + onIntermediateChainDownloadClick: () => dispatch(downloadDfspJWSIntermediateChain()), + onIntermediateChainViewClick: () => dispatch(showDfspJWSIntermediateChainModal()), + onIntermediateChainModalCloseClick: () => dispatch(hideDfspJWSIntermediateChainModal()), + onCreateCertificateClick: () => dispatch(submitDfspJWSCertificates()), +}); + +interface DfspJWSProps { + environmentName: string; + error: ErrorMessage; + jwsCertificate: string; + intermediateChain: string; + jwsCertificateInfo?: CertInfo; + intermediateChainInfo?: CertInfo; + validations: CertificateValidationResults[]; + validationState?: string; + isJwsCertificateModalVisible: boolean; + isIntermediateChainModalVisible: boolean; + isSubmitEnabled: boolean; + isSubmitPending: boolean; + isReadPending?: boolean; + onJwsCertificateChange: (certificate: string) => void; + onJwsCertificateViewClick: () => void; + onJwsCertificateDownloadClick: () => AnyAction; + onJwsCertificateModalCloseClick: () => void; + onIntermediateChainChange: (certificate: string) => void; + onIntermediateChainViewClick: () => void; + onIntermediateChainDownloadClick: () => AnyAction; + onIntermediateChainModalCloseClick: () => void; + onCreateCertificateClick: () => void; +} + +const DfspJWS: FC = ({ + environmentName, + error, + jwsCertificate, + intermediateChain, + jwsCertificateInfo, + intermediateChainInfo, + validations, + validationState, + isJwsCertificateModalVisible, + isIntermediateChainModalVisible, + isSubmitEnabled, + isSubmitPending, + onJwsCertificateChange, + onJwsCertificateViewClick, + onJwsCertificateDownloadClick, + onJwsCertificateModalCloseClick, + onIntermediateChainChange, + onIntermediateChainViewClick, + onIntermediateChainDownloadClick, + onIntermediateChainModalCloseClick, + onCreateCertificateClick, +}) => { + if (error) { + return ( + + ); + } + + return ( +
+
+
+ +
+ +
+ +
+
+ + {jwsCertificate && ( + + )} +
+ {jwsCertificateInfo && } +
+ +
+
+ + {intermediateChain && ( + + )} +
+ {intermediateChainInfo && } +
+ + {isJwsCertificateModalVisible && ( + + )} + {isIntermediateChainModalVisible && ( + + )} +
+ ); +}; + +const MountedDfspJWS = withMount(DfspJWS, 'onMount'); + +export default connect(stateProps, actionProps)(MountedDfspJWS); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/_mockData.js index 33ecd3b..5503495 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/_mockData.js @@ -1,49 +1,49 @@ -export const dfspCaHubCertMock = - '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhjxSZnE0qnsHhfTuvcqdFuhOWKU4Z0BqYBvQ3lBetoxi6PrABDJXWKTUgNX31EGDk-----END CERTIFICATE-----'; - -const Validation = { - validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', - performed: true, - result: 'VALID', - message: 'Validation Test Message', - messageTemplate: 'Textual description of the validation result', - data: {}, - details: 'Test Details', -}; - -const CertInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - issuer: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - subjectAlternativeNames: ['alt1', 'alt2'], - serialNumber: '17159976289428250189079625547205715159', - notBefore: '2019-02-04T00:00:00Z', - notAfter: '2020-02-12T12:00:00Z', - signatureAlgorithm: 'SHA256WithRSA', -}; - -export const dfspJWSMock = { - jwsCertificate: - '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', - intermediateChain: - '-----BEGIN CERTIFICATE-----MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', - validations: [Validation], - validationState: 'VALID', - jwsCertificateInfo: CertInfo, - intermediateChainInfo: [CertInfo], -}; +export const dfspCaHubCertMock = + '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhjxSZnE0qnsHhfTuvcqdFuhOWKU4Z0BqYBvQ3lBetoxi6PrABDJXWKTUgNX31EGDk-----END CERTIFICATE-----'; + +const Validation = { + validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', + performed: true, + result: 'VALID', + message: 'Validation Test Message', + messageTemplate: 'Textual description of the validation result', + data: {}, + details: 'Test Details', +}; + +const CertInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + issuer: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + subjectAlternativeNames: ['alt1', 'alt2'], + serialNumber: '17159976289428250189079625547205715159', + notBefore: '2019-02-04T00:00:00Z', + notAfter: '2020-02-12T12:00:00Z', + signatureAlgorithm: 'SHA256WithRSA', +}; + +export const dfspJWSMock = { + jwsCertificate: + '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', + intermediateChain: + '-----BEGIN CERTIFICATE-----MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', + validations: [Validation], + validationState: 'VALID', + jwsCertificateInfo: CertInfo, + intermediateChainInfo: [CertInfo], +}; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/actions.ts index f639f0a..16eabc6 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/actions.ts @@ -1,188 +1,188 @@ -import { CertificateValidationResults, CertInfo } from 'App/types'; -import { - RESET_DFSP_JWS, - SET_DFSP_JWS_ERROR, - SET_DFSP_JWS_CERTIFICATE, - SET_DFSP_JWS_INTERMEDIATE_CHAIN, - SET_DFSP_JWS_CERTIFICATE_INFO, - SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO, - SET_DFSP_JWS_VALIDATIONS, - SET_DFSP_JWS_VALIDATION_STATE, - SHOW_DFSP_JWS_CERTIFICATE_MODAL, - CHANGE_DFSP_JWS_CERTIFICATE, - CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN, - HIDE_DFSP_JWS_CERTIFICATE_MODAL, - HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, - SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, - ResetDfspJWSAction, - SetDfspJWSErrorAction, - SetDfspJWSCertificateAction, - SetDfspJWSIntermediateChainAction, - SetDfspJWSCertificateInfoAction, - SetDfspJWSIntermediateChainInfoAction, - SetDfspJWSValidationsAction, - SetDfspJWSValidationStateAction, - ShowDfspJWSCertificateModalAction, - ChangeDfspJWSCertificateAction, - ChangeDfspJWSIntermediateChainAction, - HideDfspJWSCertificateModalAction, - ShowDfspJWSIntermediateChainModalAction, - HideDfspJWSIntermediateChainModalAction, - SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, - DOWNLOAD_DFSP_JWS_CERTIFICATE, - DownloadDfspJWSCertificateAction, - SubmitDfspJWSCertificatesAction, - DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, - DownloadDfspJWSIntermediateChainAction, - STORE_DFSP_JWS_SERVER_CERTIFICATE, - StoreDfspJWSCertificateAction, -} from './types'; - -export function resetDfspJWS(): ResetDfspJWSAction { - return { - type: RESET_DFSP_JWS, - }; -} - -export function setDfspJWSError({ error }: { error: string }): SetDfspJWSErrorAction { - return { - type: SET_DFSP_JWS_ERROR, - error, - }; -} - -export function setDfspJWSCertificate({ - certificate, -}: { - certificate: string; -}): SetDfspJWSCertificateAction { - return { - type: SET_DFSP_JWS_CERTIFICATE, - certificate, - }; -} - -export function setDfspJWSIntermediateChain({ - certificate, -}: { - certificate: string; -}): SetDfspJWSIntermediateChainAction { - return { - type: SET_DFSP_JWS_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function setDfspJWSCertificateInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspJWSCertificateInfoAction { - return { - type: SET_DFSP_JWS_CERTIFICATE_INFO, - certInfo, - }; -} - -export function setDfspJWSIntermediateChainInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspJWSIntermediateChainInfoAction { - return { - type: SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO, - certInfo, - }; -} - -export function setDfspJWSValidations({ - validations, -}: { - validations: CertificateValidationResults[]; -}): SetDfspJWSValidationsAction { - return { - type: SET_DFSP_JWS_VALIDATIONS, - validations, - }; -} - -export function setDfspJWSValidationState({ - validationState, -}: { - validationState: string | undefined; -}): SetDfspJWSValidationStateAction { - return { - type: SET_DFSP_JWS_VALIDATION_STATE, - validationState, - }; -} - -export function showDfspJWSCertificateModal(): ShowDfspJWSCertificateModalAction { - return { - type: SHOW_DFSP_JWS_CERTIFICATE_MODAL, - }; -} - -export function changeDfspJWSCertificate({ - certificate, -}: { - certificate: string; -}): ChangeDfspJWSCertificateAction { - return { - type: CHANGE_DFSP_JWS_CERTIFICATE, - certificate, - }; -} - -export function changeDfspJWSIntermediateChain({ - certificate, -}: { - certificate: string; -}): ChangeDfspJWSIntermediateChainAction { - return { - type: CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function hideDfspJWSCertificateModal(): HideDfspJWSCertificateModalAction { - return { - type: HIDE_DFSP_JWS_CERTIFICATE_MODAL, - }; -} - -export function showDfspJWSIntermediateChainModal(): ShowDfspJWSIntermediateChainModalAction { - return { - type: SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function hideDfspJWSIntermediateChainModal(): HideDfspJWSIntermediateChainModalAction { - return { - type: HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function submitDfspJWSCertificates(): SubmitDfspJWSCertificatesAction { - return { - type: SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, - }; -} - -export function downloadDfspJWSCertificate(): DownloadDfspJWSCertificateAction { - return { - type: DOWNLOAD_DFSP_JWS_CERTIFICATE, - }; -} - -export function downloadDfspJWSIntermediateChain(): DownloadDfspJWSIntermediateChainAction { - return { - type: DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, - }; -} - -export function storeDfspJWSCertificate(): StoreDfspJWSCertificateAction { - return { - type: STORE_DFSP_JWS_SERVER_CERTIFICATE, - }; -} +import { CertificateValidationResults, CertInfo } from 'App/types'; +import { + RESET_DFSP_JWS, + SET_DFSP_JWS_ERROR, + SET_DFSP_JWS_CERTIFICATE, + SET_DFSP_JWS_INTERMEDIATE_CHAIN, + SET_DFSP_JWS_CERTIFICATE_INFO, + SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO, + SET_DFSP_JWS_VALIDATIONS, + SET_DFSP_JWS_VALIDATION_STATE, + SHOW_DFSP_JWS_CERTIFICATE_MODAL, + CHANGE_DFSP_JWS_CERTIFICATE, + CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN, + HIDE_DFSP_JWS_CERTIFICATE_MODAL, + HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, + SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, + ResetDfspJWSAction, + SetDfspJWSErrorAction, + SetDfspJWSCertificateAction, + SetDfspJWSIntermediateChainAction, + SetDfspJWSCertificateInfoAction, + SetDfspJWSIntermediateChainInfoAction, + SetDfspJWSValidationsAction, + SetDfspJWSValidationStateAction, + ShowDfspJWSCertificateModalAction, + ChangeDfspJWSCertificateAction, + ChangeDfspJWSIntermediateChainAction, + HideDfspJWSCertificateModalAction, + ShowDfspJWSIntermediateChainModalAction, + HideDfspJWSIntermediateChainModalAction, + SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, + DOWNLOAD_DFSP_JWS_CERTIFICATE, + DownloadDfspJWSCertificateAction, + SubmitDfspJWSCertificatesAction, + DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, + DownloadDfspJWSIntermediateChainAction, + STORE_DFSP_JWS_SERVER_CERTIFICATE, + StoreDfspJWSCertificateAction, +} from './types'; + +export function resetDfspJWS(): ResetDfspJWSAction { + return { + type: RESET_DFSP_JWS, + }; +} + +export function setDfspJWSError({ error }: { error: string }): SetDfspJWSErrorAction { + return { + type: SET_DFSP_JWS_ERROR, + error, + }; +} + +export function setDfspJWSCertificate({ + certificate, +}: { + certificate: string; +}): SetDfspJWSCertificateAction { + return { + type: SET_DFSP_JWS_CERTIFICATE, + certificate, + }; +} + +export function setDfspJWSIntermediateChain({ + certificate, +}: { + certificate: string; +}): SetDfspJWSIntermediateChainAction { + return { + type: SET_DFSP_JWS_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function setDfspJWSCertificateInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspJWSCertificateInfoAction { + return { + type: SET_DFSP_JWS_CERTIFICATE_INFO, + certInfo, + }; +} + +export function setDfspJWSIntermediateChainInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspJWSIntermediateChainInfoAction { + return { + type: SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO, + certInfo, + }; +} + +export function setDfspJWSValidations({ + validations, +}: { + validations: CertificateValidationResults[]; +}): SetDfspJWSValidationsAction { + return { + type: SET_DFSP_JWS_VALIDATIONS, + validations, + }; +} + +export function setDfspJWSValidationState({ + validationState, +}: { + validationState: string | undefined; +}): SetDfspJWSValidationStateAction { + return { + type: SET_DFSP_JWS_VALIDATION_STATE, + validationState, + }; +} + +export function showDfspJWSCertificateModal(): ShowDfspJWSCertificateModalAction { + return { + type: SHOW_DFSP_JWS_CERTIFICATE_MODAL, + }; +} + +export function changeDfspJWSCertificate({ + certificate, +}: { + certificate: string; +}): ChangeDfspJWSCertificateAction { + return { + type: CHANGE_DFSP_JWS_CERTIFICATE, + certificate, + }; +} + +export function changeDfspJWSIntermediateChain({ + certificate, +}: { + certificate: string; +}): ChangeDfspJWSIntermediateChainAction { + return { + type: CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function hideDfspJWSCertificateModal(): HideDfspJWSCertificateModalAction { + return { + type: HIDE_DFSP_JWS_CERTIFICATE_MODAL, + }; +} + +export function showDfspJWSIntermediateChainModal(): ShowDfspJWSIntermediateChainModalAction { + return { + type: SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function hideDfspJWSIntermediateChainModal(): HideDfspJWSIntermediateChainModalAction { + return { + type: HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function submitDfspJWSCertificates(): SubmitDfspJWSCertificatesAction { + return { + type: SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, + }; +} + +export function downloadDfspJWSCertificate(): DownloadDfspJWSCertificateAction { + return { + type: DOWNLOAD_DFSP_JWS_CERTIFICATE, + }; +} + +export function downloadDfspJWSIntermediateChain(): DownloadDfspJWSIntermediateChainAction { + return { + type: DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, + }; +} + +export function storeDfspJWSCertificate(): StoreDfspJWSCertificateAction { + return { + type: STORE_DFSP_JWS_SERVER_CERTIFICATE, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.css index ec0afc6..e75df72 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.css @@ -1,29 +1,29 @@ -.dfsp-jws { - margin-top: 10px; -} - -.dfsp-jws__submit__container { - margin: 10px 0px; -} - -.dfsp-jws__submit { - width: 200px; -} - -.dfsp-jws__certificate-validation { - width: 400px; - margin: 10px 0px; -} - -.dfsp-jws__certificate-item { - margin-bottom: 20px; -} - -.dfsp-jws__jws-certificate, -.dfsp-jws__intermediate-chain { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; - margin-bottom: 20px; -} +.dfsp-jws { + margin-top: 10px; +} + +.dfsp-jws__submit__container { + margin: 10px 0px; +} + +.dfsp-jws__submit { + width: 200px; +} + +.dfsp-jws__certificate-validation { + width: 400px; + margin: 10px 0px; +} + +.dfsp-jws__certificate-item { + margin-bottom: 20px; +} + +.dfsp-jws__jws-certificate, +.dfsp-jws__intermediate-chain { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; + margin-bottom: 20px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.ts index 511af7d..fd6e6fd 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/index.ts @@ -1,9 +1,9 @@ -import DFSPJWS from './DFSPJWS'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default DFSPJWS; -export { actions, reducer, selectors, types, sagas }; +import DFSPJWS from './DFSPJWS'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default DFSPJWS; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/reducers.ts index 33eae09..5968e8d 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/reducers.ts @@ -1,150 +1,150 @@ -import { - RESET_DFSP_JWS, - SET_DFSP_JWS_ERROR, - SET_DFSP_JWS_CERTIFICATE, - SET_DFSP_JWS_INTERMEDIATE_CHAIN, - SET_DFSP_JWS_CERTIFICATE_INFO, - SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO, - SET_DFSP_JWS_VALIDATIONS, - SET_DFSP_JWS_VALIDATION_STATE, - CHANGE_DFSP_JWS_CERTIFICATE, - CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN, - SHOW_DFSP_JWS_CERTIFICATE_MODAL, - HIDE_DFSP_JWS_CERTIFICATE_MODAL, - SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, - HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, - DFSPJWSActionTypes, - DFSPJWSState, -} from './types'; - -const initialState = { - dfspJWSError: '', - previousDfspJWSCertificate: undefined, - previousDfspJWSIntermediateChain: undefined, - dfspJWSCertificate: '', - dfspJWSIntermediateChain: '', - dfspJWSCertificateInfo: undefined, - dfspJWSIntermediateChainInfo: undefined, - dfspJWSValidations: [], - dfspJWSValidationState: undefined, - isDfspJWSCertificateModalVisible: false, - isDfspJWSIntermediateChainModalVisible: false, -}; - -export default function dfspJWSReducer( - state = initialState, - action: DFSPJWSActionTypes -): DFSPJWSState { - switch (action.type) { - case RESET_DFSP_JWS: { - return initialState; - } - - case SET_DFSP_JWS_ERROR: { - return { - ...state, - dfspJWSError: action.error, - }; - } - - case SET_DFSP_JWS_CERTIFICATE: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspJWSCertificate: action.certificate, - dfspJWSCertificate: action.certificate, - }; - } - - case SET_DFSP_JWS_INTERMEDIATE_CHAIN: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspJWSIntermediateChain: action.certificate, - dfspJWSIntermediateChain: action.certificate, - }; - } - - case SET_DFSP_JWS_CERTIFICATE_INFO: { - return { - ...state, - dfspJWSCertificateInfo: action.certInfo, - }; - } - - case SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO: { - return { - ...state, - dfspJWSIntermediateChainInfo: action.certInfo, - }; - } - - case SET_DFSP_JWS_VALIDATIONS: { - return { - ...state, - dfspJWSValidations: action.validations, - }; - } - - case SET_DFSP_JWS_VALIDATION_STATE: { - return { - ...state, - dfspJWSValidationState: action.validationState, - }; - } - - case CHANGE_DFSP_JWS_CERTIFICATE: { - return { - ...state, - dfspJWSCertificate: action.certificate, - dfspJWSCertificateInfo: initialState.dfspJWSCertificateInfo, - dfspJWSValidationState: initialState.dfspJWSValidationState, - dfspJWSValidations: initialState.dfspJWSValidations, - }; - } - - case CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN: { - return { - ...state, - dfspJWSIntermediateChain: action.certificate, - dfspJWSIntermediateChainInfo: initialState.dfspJWSIntermediateChainInfo, - dfspJWSValidationState: initialState.dfspJWSValidationState, - dfspJWSValidations: initialState.dfspJWSValidations, - }; - } - - case SHOW_DFSP_JWS_CERTIFICATE_MODAL: { - return { - ...state, - isDfspJWSCertificateModalVisible: true, - }; - } - - case HIDE_DFSP_JWS_CERTIFICATE_MODAL: { - return { - ...state, - isDfspJWSCertificateModalVisible: false, - }; - } - - case SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isDfspJWSIntermediateChainModalVisible: true, - }; - } - case HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isDfspJWSIntermediateChainModalVisible: false, - }; - } - - default: - return state; - } -} +import { + RESET_DFSP_JWS, + SET_DFSP_JWS_ERROR, + SET_DFSP_JWS_CERTIFICATE, + SET_DFSP_JWS_INTERMEDIATE_CHAIN, + SET_DFSP_JWS_CERTIFICATE_INFO, + SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO, + SET_DFSP_JWS_VALIDATIONS, + SET_DFSP_JWS_VALIDATION_STATE, + CHANGE_DFSP_JWS_CERTIFICATE, + CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN, + SHOW_DFSP_JWS_CERTIFICATE_MODAL, + HIDE_DFSP_JWS_CERTIFICATE_MODAL, + SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, + HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL, + DFSPJWSActionTypes, + DFSPJWSState, +} from './types'; + +const initialState = { + dfspJWSError: '', + previousDfspJWSCertificate: undefined, + previousDfspJWSIntermediateChain: undefined, + dfspJWSCertificate: '', + dfspJWSIntermediateChain: '', + dfspJWSCertificateInfo: undefined, + dfspJWSIntermediateChainInfo: undefined, + dfspJWSValidations: [], + dfspJWSValidationState: undefined, + isDfspJWSCertificateModalVisible: false, + isDfspJWSIntermediateChainModalVisible: false, +}; + +export default function dfspJWSReducer( + state = initialState, + action: DFSPJWSActionTypes +): DFSPJWSState { + switch (action.type) { + case RESET_DFSP_JWS: { + return initialState; + } + + case SET_DFSP_JWS_ERROR: { + return { + ...state, + dfspJWSError: action.error, + }; + } + + case SET_DFSP_JWS_CERTIFICATE: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspJWSCertificate: action.certificate, + dfspJWSCertificate: action.certificate, + }; + } + + case SET_DFSP_JWS_INTERMEDIATE_CHAIN: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspJWSIntermediateChain: action.certificate, + dfspJWSIntermediateChain: action.certificate, + }; + } + + case SET_DFSP_JWS_CERTIFICATE_INFO: { + return { + ...state, + dfspJWSCertificateInfo: action.certInfo, + }; + } + + case SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO: { + return { + ...state, + dfspJWSIntermediateChainInfo: action.certInfo, + }; + } + + case SET_DFSP_JWS_VALIDATIONS: { + return { + ...state, + dfspJWSValidations: action.validations, + }; + } + + case SET_DFSP_JWS_VALIDATION_STATE: { + return { + ...state, + dfspJWSValidationState: action.validationState, + }; + } + + case CHANGE_DFSP_JWS_CERTIFICATE: { + return { + ...state, + dfspJWSCertificate: action.certificate, + dfspJWSCertificateInfo: initialState.dfspJWSCertificateInfo, + dfspJWSValidationState: initialState.dfspJWSValidationState, + dfspJWSValidations: initialState.dfspJWSValidations, + }; + } + + case CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN: { + return { + ...state, + dfspJWSIntermediateChain: action.certificate, + dfspJWSIntermediateChainInfo: initialState.dfspJWSIntermediateChainInfo, + dfspJWSValidationState: initialState.dfspJWSValidationState, + dfspJWSValidations: initialState.dfspJWSValidations, + }; + } + + case SHOW_DFSP_JWS_CERTIFICATE_MODAL: { + return { + ...state, + isDfspJWSCertificateModalVisible: true, + }; + } + + case HIDE_DFSP_JWS_CERTIFICATE_MODAL: { + return { + ...state, + isDfspJWSCertificateModalVisible: false, + }; + } + + case SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isDfspJWSIntermediateChainModalVisible: true, + }; + } + case HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isDfspJWSIntermediateChainModalVisible: false, + }; + } + + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/sagas.ts index d3733ce..4a3a245 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/sagas.ts @@ -1,120 +1,120 @@ -import { all, put, select, takeLatest, call } from 'redux-saga/effects'; -import { is20x, is404 } from 'utils/http'; -import { downloadFile } from 'utils/html'; -import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { showToast, showErrorModal } from 'App/actions'; -import apis from 'utils/apis'; -import { - setDfspJWSCertificate, - setDfspJWSIntermediateChain, - setDfspJWSCertificateInfo, - setDfspJWSIntermediateChainInfo, - setDfspJWSValidations, - setDfspJWSValidationState, -} from './actions'; -import { - getDfspJWSCertificate, - getDfspJWSIntermediateChain, - getIsDfspJWSEditingExistingModel, -} from './selectors'; -import { - SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, - DOWNLOAD_DFSP_JWS_CERTIFICATE, - DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, - STORE_DFSP_JWS_SERVER_CERTIFICATE, -} from './types'; - -function* storeDfspJWSCertificates() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.dfspJWSCerts.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setDfspJWSCertificate({ certificate: response.data.jwsCertificate })); - yield put(setDfspJWSIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDfspJWSCertificateInfo({ certInfo: response.data.jwsCertificateInfo })); - yield put( - setDfspJWSIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) - ); - yield put(setDfspJWSValidations({ validations: response.data.validations })); - yield put(setDfspJWSValidationState({ validationState: response.data.validationState })); - } else if (!is404(response.status)) { - yield put(showErrorModal('Error Loading JWS Certificate')); - } - } catch (error) { - yield put(showErrorModal(error.message)); - } -} - -export function* StoreDfspJWSCertificatesSaga() { - yield takeLatest(STORE_DFSP_JWS_SERVER_CERTIFICATE, storeDfspJWSCertificates); -} - -function* submitDfspJWSCertificates() { - try { - const environmentId = yield select(getEnvironmentId); - const jwsCertificate = yield select(getDfspJWSCertificate); - const intermediateChain = yield select(getDfspJWSIntermediateChain); - const body = { jwsCertificate, intermediateChain }; - - let response; - - if (yield select(getIsDfspJWSEditingExistingModel)) { - response = yield call(apis.dfspJWSCerts.update, { environmentId, body }); - } else { - response = yield call(apis.dfspJWSCerts.create, { environmentId, body }); - } - - if (is20x(response.status)) { - yield put(showToast()); - yield put(setDfspJWSCertificate({ certificate: response.data.jwsCertificate })); - yield put(setDfspJWSIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDfspJWSCertificateInfo({ certInfo: response.data.jwsCertificateInfo })); - yield put( - setDfspJWSIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) - ); - yield put(setDfspJWSValidations({ validations: response.data.validations })); - yield put(setDfspJWSValidationState({ validationState: response.data.validationState })); - } else { - yield put(showErrorModal('Error Submitting JWS Certificate')); - } - } catch (error) { - yield put(showErrorModal(error.message)); - } -} - -export function* SubmitDfspJWSCertificatesSaga() { - yield takeLatest(SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, submitDfspJWSCertificates); -} - -export function* downloadDfspJWSCertificate() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const jwsCertificate = getDfspJWSCertificate(state); - downloadFile(jwsCertificate, `${environmentName}-root.pem`); -} - -export function* DownloadDfspJWSCertificateSaga() { - yield takeLatest(DOWNLOAD_DFSP_JWS_CERTIFICATE, downloadDfspJWSCertificate); -} - -export function* downloadDfspJWSIntermediateChain() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const intermediateChain = getDfspJWSIntermediateChain(state); - downloadFile(intermediateChain, `${environmentName}-intermediates.pem`); -} - -export function* DownloadDfspJWSIntermediateChainSaga() { - yield takeLatest(DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, downloadDfspJWSIntermediateChain); -} - -export default function* rootSaga() { - yield all([ - StoreDfspJWSCertificatesSaga(), - SubmitDfspJWSCertificatesSaga(), - DownloadDfspJWSCertificateSaga(), - DownloadDfspJWSIntermediateChainSaga(), - ]); -} +import { all, put, select, takeLatest, call } from 'redux-saga/effects'; +import { is20x, is404 } from 'utils/http'; +import { downloadFile } from 'utils/html'; +import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { showToast, showErrorModal } from 'App/actions'; +import apis from 'utils/apis'; +import { + setDfspJWSCertificate, + setDfspJWSIntermediateChain, + setDfspJWSCertificateInfo, + setDfspJWSIntermediateChainInfo, + setDfspJWSValidations, + setDfspJWSValidationState, +} from './actions'; +import { + getDfspJWSCertificate, + getDfspJWSIntermediateChain, + getIsDfspJWSEditingExistingModel, +} from './selectors'; +import { + SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, + DOWNLOAD_DFSP_JWS_CERTIFICATE, + DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, + STORE_DFSP_JWS_SERVER_CERTIFICATE, +} from './types'; + +function* storeDfspJWSCertificates() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.dfspJWSCerts.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setDfspJWSCertificate({ certificate: response.data.jwsCertificate })); + yield put(setDfspJWSIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDfspJWSCertificateInfo({ certInfo: response.data.jwsCertificateInfo })); + yield put( + setDfspJWSIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) + ); + yield put(setDfspJWSValidations({ validations: response.data.validations })); + yield put(setDfspJWSValidationState({ validationState: response.data.validationState })); + } else if (!is404(response.status)) { + yield put(showErrorModal('Error Loading JWS Certificate')); + } + } catch (error) { + yield put(showErrorModal(error.message)); + } +} + +export function* StoreDfspJWSCertificatesSaga() { + yield takeLatest(STORE_DFSP_JWS_SERVER_CERTIFICATE, storeDfspJWSCertificates); +} + +function* submitDfspJWSCertificates() { + try { + const environmentId = yield select(getEnvironmentId); + const jwsCertificate = yield select(getDfspJWSCertificate); + const intermediateChain = yield select(getDfspJWSIntermediateChain); + const body = { jwsCertificate, intermediateChain }; + + let response; + + if (yield select(getIsDfspJWSEditingExistingModel)) { + response = yield call(apis.dfspJWSCerts.update, { environmentId, body }); + } else { + response = yield call(apis.dfspJWSCerts.create, { environmentId, body }); + } + + if (is20x(response.status)) { + yield put(showToast()); + yield put(setDfspJWSCertificate({ certificate: response.data.jwsCertificate })); + yield put(setDfspJWSIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDfspJWSCertificateInfo({ certInfo: response.data.jwsCertificateInfo })); + yield put( + setDfspJWSIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) + ); + yield put(setDfspJWSValidations({ validations: response.data.validations })); + yield put(setDfspJWSValidationState({ validationState: response.data.validationState })); + } else { + yield put(showErrorModal('Error Submitting JWS Certificate')); + } + } catch (error) { + yield put(showErrorModal(error.message)); + } +} + +export function* SubmitDfspJWSCertificatesSaga() { + yield takeLatest(SUBMIT_DFSP_JWS_SERVER_CERTIFICATE, submitDfspJWSCertificates); +} + +export function* downloadDfspJWSCertificate() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const jwsCertificate = getDfspJWSCertificate(state); + downloadFile(jwsCertificate, `${environmentName}-root.pem`); +} + +export function* DownloadDfspJWSCertificateSaga() { + yield takeLatest(DOWNLOAD_DFSP_JWS_CERTIFICATE, downloadDfspJWSCertificate); +} + +export function* downloadDfspJWSIntermediateChain() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const intermediateChain = getDfspJWSIntermediateChain(state); + downloadFile(intermediateChain, `${environmentName}-intermediates.pem`); +} + +export function* DownloadDfspJWSIntermediateChainSaga() { + yield takeLatest(DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN, downloadDfspJWSIntermediateChain); +} + +export default function* rootSaga() { + yield all([ + StoreDfspJWSCertificatesSaga(), + SubmitDfspJWSCertificatesSaga(), + DownloadDfspJWSCertificateSaga(), + DownloadDfspJWSIntermediateChainSaga(), + ]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/selectors.ts index be809c2..2315a45 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/selectors.ts @@ -1,78 +1,78 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; - -import * as testers from 'utils/testers'; - -export const getDfspJWSError = (state: State) => state.wizard.environment.jws.dfspjws.dfspJWSError; -export const getPreviousDfspJWSCertificate = (state: State) => - state.wizard.environment.jws.dfspjws.previousDfspJWSCertificate; -export const getPreviousDfspJWSIntermediateChain = (state: State) => - state.wizard.environment.jws.dfspjws.previousDfspJWSIntermediateChain; -export const getDfspJWSCertificate = (state: State) => - state.wizard.environment.jws.dfspjws.dfspJWSCertificate; -export const getDfspJWSIntermediateChain = (state: State) => - state.wizard.environment.jws.dfspjws.dfspJWSIntermediateChain; -export const getDfspJWSCertificateInfo = (state: State) => - state.wizard.environment.jws.dfspjws.dfspJWSCertificateInfo; -export const getDfspJWSIntermediateChainInfo = (state: State) => - state.wizard.environment.jws.dfspjws.dfspJWSIntermediateChainInfo; -export const getDfspJWSValidations = (state: State) => - state.wizard.environment.jws.dfspjws.dfspJWSValidations; -export const getDfspJWSValidationState = (state: State) => - state.wizard.environment.jws.dfspjws.dfspJWSValidationState; -export const getIsDfspJWSCertificateModalVisible = (state: State) => - state.wizard.environment.jws.dfspjws.isDfspJWSCertificateModalVisible; -export const getIsDfspJWSIntermediateChainModalVisible = (state: State) => - state.wizard.environment.jws.dfspjws.isDfspJWSIntermediateChainModalVisible; - -const buildDfspJWSModel = ( - jwsCertificate: string | undefined, - intermediateChain: string | undefined - // serverCertificate: string | undefined -) => ({ - jwsCertificate, - intermediateChain, -}); -const getPreviousDfspJWSModel = createSelector( - getPreviousDfspJWSCertificate, - getPreviousDfspJWSIntermediateChain, - buildDfspJWSModel -); -export const getDfspJWSModel = createSelector( - getDfspJWSCertificate, - getDfspJWSIntermediateChain, - buildDfspJWSModel -); -const getIsDfspJWSModelChanged = createSelector( - getPreviousDfspJWSModel, - getDfspJWSModel, - testers.isNotEqual -); -const getIsDfspJWSCertificateValid = createSelector(getDfspJWSCertificate, testers.isNotNil); - -export const getIsDfspJWSEditingExistingModel = createSelector( - getPreviousDfspJWSCertificate, - testers.isNotNil -); -export const getIsDfspJWSSubmitEnabled = createSelector( - getIsDfspJWSCertificateValid, - getIsDfspJWSModelChanged, - testers.getAllAre(true) -); - -export const getIsDfspJWSCreatePending = createSelector( - (state: State) => state.api, - isPending('dfspJWSCerts.create') -); - -export const getIsDfspJWSUpdatePending = createSelector( - (state: State) => state.api, - isPending('dfspJWSCerts.update') -); - -export const getIsDfspJWSSubmitPending = createSelector( - getIsDfspJWSCreatePending, - getIsDfspJWSUpdatePending, - testers.getAnyIs(true) -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; + +import * as testers from 'utils/testers'; + +export const getDfspJWSError = (state: State) => state.wizard.environment.jws.dfspjws.dfspJWSError; +export const getPreviousDfspJWSCertificate = (state: State) => + state.wizard.environment.jws.dfspjws.previousDfspJWSCertificate; +export const getPreviousDfspJWSIntermediateChain = (state: State) => + state.wizard.environment.jws.dfspjws.previousDfspJWSIntermediateChain; +export const getDfspJWSCertificate = (state: State) => + state.wizard.environment.jws.dfspjws.dfspJWSCertificate; +export const getDfspJWSIntermediateChain = (state: State) => + state.wizard.environment.jws.dfspjws.dfspJWSIntermediateChain; +export const getDfspJWSCertificateInfo = (state: State) => + state.wizard.environment.jws.dfspjws.dfspJWSCertificateInfo; +export const getDfspJWSIntermediateChainInfo = (state: State) => + state.wizard.environment.jws.dfspjws.dfspJWSIntermediateChainInfo; +export const getDfspJWSValidations = (state: State) => + state.wizard.environment.jws.dfspjws.dfspJWSValidations; +export const getDfspJWSValidationState = (state: State) => + state.wizard.environment.jws.dfspjws.dfspJWSValidationState; +export const getIsDfspJWSCertificateModalVisible = (state: State) => + state.wizard.environment.jws.dfspjws.isDfspJWSCertificateModalVisible; +export const getIsDfspJWSIntermediateChainModalVisible = (state: State) => + state.wizard.environment.jws.dfspjws.isDfspJWSIntermediateChainModalVisible; + +const buildDfspJWSModel = ( + jwsCertificate: string | undefined, + intermediateChain: string | undefined + // serverCertificate: string | undefined +) => ({ + jwsCertificate, + intermediateChain, +}); +const getPreviousDfspJWSModel = createSelector( + getPreviousDfspJWSCertificate, + getPreviousDfspJWSIntermediateChain, + buildDfspJWSModel +); +export const getDfspJWSModel = createSelector( + getDfspJWSCertificate, + getDfspJWSIntermediateChain, + buildDfspJWSModel +); +const getIsDfspJWSModelChanged = createSelector( + getPreviousDfspJWSModel, + getDfspJWSModel, + testers.isNotEqual +); +const getIsDfspJWSCertificateValid = createSelector(getDfspJWSCertificate, testers.isNotNil); + +export const getIsDfspJWSEditingExistingModel = createSelector( + getPreviousDfspJWSCertificate, + testers.isNotNil +); +export const getIsDfspJWSSubmitEnabled = createSelector( + getIsDfspJWSCertificateValid, + getIsDfspJWSModelChanged, + testers.getAllAre(true) +); + +export const getIsDfspJWSCreatePending = createSelector( + (state: State) => state.api, + isPending('dfspJWSCerts.create') +); + +export const getIsDfspJWSUpdatePending = createSelector( + (state: State) => state.api, + isPending('dfspJWSCerts.update') +); + +export const getIsDfspJWSSubmitPending = createSelector( + getIsDfspJWSCreatePending, + getIsDfspJWSUpdatePending, + testers.getAnyIs(true) +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/types.ts index 529be5e..36ebc8c 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWS/types.ts @@ -1,134 +1,134 @@ -import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; - -export const RESET_DFSP_JWS = 'DFSP JWS / Reset'; -export const SET_DFSP_JWS_ERROR = 'DFSP JWS / Set JWS Cert Error'; -export const SET_DFSP_JWS_CERTIFICATE = 'DFSP JWS / Set JWS Certificate'; -export const SET_DFSP_JWS_INTERMEDIATE_CHAIN = 'DFSP JWS / Set Intermediate Chain'; -export const SET_DFSP_JWS_CERTIFICATE_INFO = 'DFSP JWS / Set JWS Certificate Info'; -export const SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO = 'DFSP JWS / Set Intermediate Chain Info'; -export const SET_DFSP_JWS_VALIDATIONS = 'DFSP JWS / Set Validations'; -export const SET_DFSP_JWS_VALIDATION_STATE = 'DFSP JWS / Set Validation State'; -export const CHANGE_DFSP_JWS_CERTIFICATE = 'DFSP JWS / Change JWS Certificate'; -export const CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN = 'DFSP JWS / Change Intermediate Chain'; -export const SHOW_DFSP_JWS_CERTIFICATE_MODAL = 'DFSP JWS / Show JWS Certificate Modal'; -export const HIDE_DFSP_JWS_CERTIFICATE_MODAL = 'DFSP JWS / Hide JWS Certificate Modal'; -export const SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL = 'DFSP JWS / Show Intermediate Chain Modal'; -export const HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL = 'DFSP JWS / Hide Intermediate Chain Modal'; -export const SUBMIT_DFSP_JWS_SERVER_CERTIFICATE = 'DFSP JWS / Submit Server Certificate'; -export const STORE_DFSP_JWS_SERVER_CERTIFICATE = 'DFSP JWS / Store Server Certificate'; -export const DOWNLOAD_DFSP_JWS_CERTIFICATE = 'DFSP JWS / Download Certificate'; -export const DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN = 'DFSP JWS / Download Intermediate Chain'; - -export interface ResetDfspJWSAction { - type: typeof RESET_DFSP_JWS; -} - -export interface SetDfspJWSErrorAction { - type: typeof SET_DFSP_JWS_ERROR; - error: string; -} - -export interface SetDfspJWSCertificateAction { - type: typeof SET_DFSP_JWS_CERTIFICATE; - certificate: string; -} - -export interface SetDfspJWSIntermediateChainAction { - type: typeof SET_DFSP_JWS_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface SetDfspJWSCertificateInfoAction { - type: typeof SET_DFSP_JWS_CERTIFICATE_INFO; - certInfo: CertInfo; -} - -export interface SetDfspJWSIntermediateChainInfoAction { - type: typeof SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO; - certInfo: CertInfo; -} - -export interface SetDfspJWSValidationsAction { - type: typeof SET_DFSP_JWS_VALIDATIONS; - validations: CertificateValidationResults[]; -} - -export interface SetDfspJWSValidationStateAction { - type: typeof SET_DFSP_JWS_VALIDATION_STATE; - validationState: string | undefined; -} - -export interface ShowDfspJWSCertificateModalAction { - type: typeof SHOW_DFSP_JWS_CERTIFICATE_MODAL; -} - -export interface ChangeDfspJWSCertificateAction { - type: typeof CHANGE_DFSP_JWS_CERTIFICATE; - certificate: string; -} - -export interface ChangeDfspJWSIntermediateChainAction { - type: typeof CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface HideDfspJWSCertificateModalAction { - type: typeof HIDE_DFSP_JWS_CERTIFICATE_MODAL; -} - -export interface ShowDfspJWSIntermediateChainModalAction { - type: typeof SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL; -} - -export interface HideDfspJWSIntermediateChainModalAction { - type: typeof HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL; -} - -export interface SubmitDfspJWSCertificatesAction { - type: typeof SUBMIT_DFSP_JWS_SERVER_CERTIFICATE; -} - -export interface DownloadDfspJWSCertificateAction { - type: typeof DOWNLOAD_DFSP_JWS_CERTIFICATE; -} - -export interface DownloadDfspJWSIntermediateChainAction { - type: typeof DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN; -} - -export interface StoreDfspJWSCertificateAction { - type: typeof STORE_DFSP_JWS_SERVER_CERTIFICATE; -} - -export type DFSPJWSActionTypes = - | ResetDfspJWSAction - | SetDfspJWSErrorAction - | SetDfspJWSCertificateAction - | SetDfspJWSIntermediateChainAction - | SetDfspJWSIntermediateChainAction - | SetDfspJWSCertificateInfoAction - | SetDfspJWSIntermediateChainInfoAction - | SetDfspJWSValidationsAction - | SetDfspJWSValidationStateAction - | ShowDfspJWSCertificateModalAction - | HideDfspJWSCertificateModalAction - | ChangeDfspJWSCertificateAction - | ChangeDfspJWSIntermediateChainAction - | HideDfspJWSCertificateModalAction - | ShowDfspJWSIntermediateChainModalAction - | HideDfspJWSIntermediateChainModalAction - | StoreDfspJWSCertificateAction; - -export interface DFSPJWSState { - dfspJWSError: ErrorMessage; - previousDfspJWSCertificate?: string; - previousDfspJWSIntermediateChain?: string; - dfspJWSCertificate: string; - dfspJWSIntermediateChain: string; - dfspJWSCertificateInfo?: CertInfo; - dfspJWSIntermediateChainInfo?: CertInfo; - dfspJWSValidations: CertificateValidationResults[]; - dfspJWSValidationState?: string; - isDfspJWSCertificateModalVisible: boolean; - isDfspJWSIntermediateChainModalVisible: boolean; -} +import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; + +export const RESET_DFSP_JWS = 'DFSP JWS / Reset'; +export const SET_DFSP_JWS_ERROR = 'DFSP JWS / Set JWS Cert Error'; +export const SET_DFSP_JWS_CERTIFICATE = 'DFSP JWS / Set JWS Certificate'; +export const SET_DFSP_JWS_INTERMEDIATE_CHAIN = 'DFSP JWS / Set Intermediate Chain'; +export const SET_DFSP_JWS_CERTIFICATE_INFO = 'DFSP JWS / Set JWS Certificate Info'; +export const SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO = 'DFSP JWS / Set Intermediate Chain Info'; +export const SET_DFSP_JWS_VALIDATIONS = 'DFSP JWS / Set Validations'; +export const SET_DFSP_JWS_VALIDATION_STATE = 'DFSP JWS / Set Validation State'; +export const CHANGE_DFSP_JWS_CERTIFICATE = 'DFSP JWS / Change JWS Certificate'; +export const CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN = 'DFSP JWS / Change Intermediate Chain'; +export const SHOW_DFSP_JWS_CERTIFICATE_MODAL = 'DFSP JWS / Show JWS Certificate Modal'; +export const HIDE_DFSP_JWS_CERTIFICATE_MODAL = 'DFSP JWS / Hide JWS Certificate Modal'; +export const SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL = 'DFSP JWS / Show Intermediate Chain Modal'; +export const HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL = 'DFSP JWS / Hide Intermediate Chain Modal'; +export const SUBMIT_DFSP_JWS_SERVER_CERTIFICATE = 'DFSP JWS / Submit Server Certificate'; +export const STORE_DFSP_JWS_SERVER_CERTIFICATE = 'DFSP JWS / Store Server Certificate'; +export const DOWNLOAD_DFSP_JWS_CERTIFICATE = 'DFSP JWS / Download Certificate'; +export const DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN = 'DFSP JWS / Download Intermediate Chain'; + +export interface ResetDfspJWSAction { + type: typeof RESET_DFSP_JWS; +} + +export interface SetDfspJWSErrorAction { + type: typeof SET_DFSP_JWS_ERROR; + error: string; +} + +export interface SetDfspJWSCertificateAction { + type: typeof SET_DFSP_JWS_CERTIFICATE; + certificate: string; +} + +export interface SetDfspJWSIntermediateChainAction { + type: typeof SET_DFSP_JWS_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface SetDfspJWSCertificateInfoAction { + type: typeof SET_DFSP_JWS_CERTIFICATE_INFO; + certInfo: CertInfo; +} + +export interface SetDfspJWSIntermediateChainInfoAction { + type: typeof SET_DFSP_JWS_INTERMEDIATE_CHAIN_INFO; + certInfo: CertInfo; +} + +export interface SetDfspJWSValidationsAction { + type: typeof SET_DFSP_JWS_VALIDATIONS; + validations: CertificateValidationResults[]; +} + +export interface SetDfspJWSValidationStateAction { + type: typeof SET_DFSP_JWS_VALIDATION_STATE; + validationState: string | undefined; +} + +export interface ShowDfspJWSCertificateModalAction { + type: typeof SHOW_DFSP_JWS_CERTIFICATE_MODAL; +} + +export interface ChangeDfspJWSCertificateAction { + type: typeof CHANGE_DFSP_JWS_CERTIFICATE; + certificate: string; +} + +export interface ChangeDfspJWSIntermediateChainAction { + type: typeof CHANGE_DFSP_JWS_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface HideDfspJWSCertificateModalAction { + type: typeof HIDE_DFSP_JWS_CERTIFICATE_MODAL; +} + +export interface ShowDfspJWSIntermediateChainModalAction { + type: typeof SHOW_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL; +} + +export interface HideDfspJWSIntermediateChainModalAction { + type: typeof HIDE_DFSP_JWS_INTERMEDIATE_CHAIN_MODAL; +} + +export interface SubmitDfspJWSCertificatesAction { + type: typeof SUBMIT_DFSP_JWS_SERVER_CERTIFICATE; +} + +export interface DownloadDfspJWSCertificateAction { + type: typeof DOWNLOAD_DFSP_JWS_CERTIFICATE; +} + +export interface DownloadDfspJWSIntermediateChainAction { + type: typeof DOWNLOAD_DFSP_JWS_INTERMEDIATE_CHAIN; +} + +export interface StoreDfspJWSCertificateAction { + type: typeof STORE_DFSP_JWS_SERVER_CERTIFICATE; +} + +export type DFSPJWSActionTypes = + | ResetDfspJWSAction + | SetDfspJWSErrorAction + | SetDfspJWSCertificateAction + | SetDfspJWSIntermediateChainAction + | SetDfspJWSIntermediateChainAction + | SetDfspJWSCertificateInfoAction + | SetDfspJWSIntermediateChainInfoAction + | SetDfspJWSValidationsAction + | SetDfspJWSValidationStateAction + | ShowDfspJWSCertificateModalAction + | HideDfspJWSCertificateModalAction + | ChangeDfspJWSCertificateAction + | ChangeDfspJWSIntermediateChainAction + | HideDfspJWSCertificateModalAction + | ShowDfspJWSIntermediateChainModalAction + | HideDfspJWSIntermediateChainModalAction + | StoreDfspJWSCertificateAction; + +export interface DFSPJWSState { + dfspJWSError: ErrorMessage; + previousDfspJWSCertificate?: string; + previousDfspJWSIntermediateChain?: string; + dfspJWSCertificate: string; + dfspJWSIntermediateChain: string; + dfspJWSCertificateInfo?: CertInfo; + dfspJWSIntermediateChainInfo?: CertInfo; + dfspJWSValidations: CertificateValidationResults[]; + dfspJWSValidationState?: string; + isDfspJWSCertificateModalVisible: boolean; + isDfspJWSIntermediateChainModalVisible: boolean; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWSCertificates.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWSCertificates.tsx index 2a02378..fc5ed86 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWSCertificates.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/DFSPJWSCertificates.tsx @@ -1,25 +1,25 @@ -import React from 'react'; -import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; -import OtherDFSPsJWS from './OtherDFSPsJWS/OtherDFSPsJWS'; -import DFSPJWS from './DFSPJWS/DFSPJWS'; - -const DFSPJWSCertificates = () => ( -
- - - DFSP JWS Certificates - Other DFSPs JWS Certificates - - - - - - - - - - -
-); - -export default DFSPJWSCertificates; +import React from 'react'; +import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; +import OtherDFSPsJWS from './OtherDFSPsJWS/OtherDFSPsJWS'; +import DFSPJWS from './DFSPJWS/DFSPJWS'; + +const DFSPJWSCertificates = () => ( +
+ + + DFSP JWS Certificates + Other DFSPs JWS Certificates + + + + + + + + + + +
+); + +export default DFSPJWSCertificates; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/OtherDFSPsJWS.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/OtherDFSPsJWS.tsx index bd25774..862bf85 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/OtherDFSPsJWS.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/OtherDFSPsJWS.tsx @@ -1,306 +1,306 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { - CertificateInfo, - CertificateModal, - CertificateValidation, - Checkbox, - FileControls, - FormInput, - MessageBox, - TextField, -} from 'components'; -import { withMount } from 'utils/hocs'; -import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; -import { State, Dispatch } from 'store/types'; - -import { - getIsSameMonetaryZoneFilterEnabled, - getOtherDfspsJWSError, - getOtherDfspsJWSFilter, - getOtherDfspsJWSSameMonetaryZone, - getIsOtherDfspsJWSCertificateModalVisible, - getOtherDfspsJWSCertificateModalContent, - getIsOtherDfspsJWSIntermediateChainModalVisible, - getOtherDfspsJWSIntermediateChainModalContent, - getIsOtherDfspsJWSPending, - getFilteredOtherDfspsJWSCertificatesByDfsp, -} from './selectors'; - -import './index.css'; -import { - storeOtherDfspsJWSCertificates, - setOtherDfspsJWSFilter, - setOtherDfspsJWSSameMonetaryZone, - showOtherDfspsJWSCertificateModal, - downloadOtherDfspsJWSCertificate, - hideOtherDfspsJWSCertificateModal, - downloadOtherDfspsJWSIntermediateChain, - showOtherDfspsJWSIntermediateChainModal, - hideOtherDfspsJWSIntermediateChainModal, -} from './actions'; -import { OtherCertificates } from '../types'; - -const stateProps = (state: State) => ({ - environmentName: getEnvironmentName(state), - error: getOtherDfspsJWSError(state), - filter: getOtherDfspsJWSFilter(state), - sameMonetaryZone: getOtherDfspsJWSSameMonetaryZone(state), - certificatesByDfsp: getFilteredOtherDfspsJWSCertificatesByDfsp(state), - isJwsCertificateModalVisible: getIsOtherDfspsJWSCertificateModalVisible(state), - jwsCertificateModalContent: getOtherDfspsJWSCertificateModalContent(state), - isIntermediateChainModalVisible: getIsOtherDfspsJWSIntermediateChainModalVisible(state), - isSameMonetaryZoneFilterEnabled: getIsSameMonetaryZoneFilterEnabled(state), - intermediateChainModalContent: getOtherDfspsJWSIntermediateChainModalContent(state), - isDfspsJWSPending: getIsOtherDfspsJWSPending(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(storeOtherDfspsJWSCertificates()), - onFilterChange: (value: string) => dispatch(setOtherDfspsJWSFilter({ value })), - onSameMonetaryZoneChange: (value: boolean) => - dispatch(setOtherDfspsJWSSameMonetaryZone({ value })), - onJwsCertificateViewClick: (cert: string) => - dispatch(showOtherDfspsJWSCertificateModal({ cert })), - onJwsCertificateDownloadClick: (cert: string) => - dispatch(downloadOtherDfspsJWSCertificate({ cert })), - onJwsCertificateModalCloseClick: () => dispatch(hideOtherDfspsJWSCertificateModal()), - onIntermediateChainDownloadClick: (cert: string) => - dispatch(downloadOtherDfspsJWSIntermediateChain({ cert })), - onIntermediateChainViewClick: (cert: string) => - dispatch(showOtherDfspsJWSIntermediateChainModal({ cert })), - onIntermediateChainModalCloseClick: () => dispatch(hideOtherDfspsJWSIntermediateChainModal()), -}); - -interface OtherDFSPsJWSProps { - environmentName: string; - error: string; - filter: string; - sameMonetaryZone: string; - certificatesByDfsp: OtherCertificates[]; - jwsCertificateModalContent: string; - intermediateChainModalContent: string; - isJwsCertificateModalVisible: boolean; - isIntermediateChainModalVisible: boolean; - isSameMonetaryZoneFilterEnabled: boolean; - isDfspsJWSPending: boolean; - onFilterChange: (value: string) => void; - onSameMonetaryZoneChange: (value: string) => void; - onJwsCertificateViewClick: (cert: string) => void; - onJwsCertificateDownloadClick: (cert: string, dfspName: string) => void; - onJwsCertificateModalCloseClick: () => void; - onIntermediateChainViewClick: (cert: string) => void; - onIntermediateChainDownloadClick: (cert: string, dfspName: string) => void; - onIntermediateChainModalCloseClick: () => void; -} - -const OtherDFSPsJWS: FC = ({ - environmentName, - error, - filter, - sameMonetaryZone, - certificatesByDfsp, - jwsCertificateModalContent, - intermediateChainModalContent, - isJwsCertificateModalVisible, - isIntermediateChainModalVisible, - isSameMonetaryZoneFilterEnabled, - isDfspsJWSPending, - onFilterChange, - onSameMonetaryZoneChange, - onJwsCertificateViewClick, - onJwsCertificateDownloadClick, - onJwsCertificateModalCloseClick, - onIntermediateChainViewClick, - onIntermediateChainDownloadClick, - onIntermediateChainModalCloseClick, -}) => { - if (error) { - return ( - - ); - } - - return ( -
-
- -
-
- -
- - - - {isJwsCertificateModalVisible && ( - - )} - {isIntermediateChainModalVisible && ( - - )} -
- ); -}; - -interface OtherDFSPsCertificatesProps { - environmentName: string; - certificates: OtherCertificates[]; - isDfspsJWSPending: boolean; - onJwsCertificateViewClick: (cert: string) => void; - onJwsCertificateDownloadClick: (cert: string, dfspName: string) => void; - onIntermediateChainViewClick: (cert: string) => void; - onIntermediateChainDownloadClick: (cert: string, dfspName: string) => void; -} - -const OtherDFSPsCertificates: FC = ({ - environmentName, - certificates, - isDfspsJWSPending, - onJwsCertificateViewClick, - onJwsCertificateDownloadClick, - onIntermediateChainViewClick, - onIntermediateChainDownloadClick, -}) => { - if (!certificates.length) { - return ( - - ); - } - - const certsComponent = certificates.map((certificate: OtherCertificates) => { - const { - dfspId, - dfspName, - error, - jwsCertificate, - intermediateChain, - jwsCertificateInfo, - intermediateChainInfo, - validations, - validationState, - isDownloadEnabled, - } = certificate; - - const header = ( -
- {dfspName} - - - {environmentName} -
- ); - - return ( -
- {header} - {error ? ( - - ) : ( - [ -
- {validations && ( - - )} -
, -
-
- - {jwsCertificate && ( - onJwsCertificateViewClick(jwsCertificate)} - onDownloadClick={() => onJwsCertificateDownloadClick(jwsCertificate, dfspName)} - downloadDisabled={!isDownloadEnabled} - /> - )} -
- {jwsCertificateInfo && } -
, -
-
- - {intermediateChain && ( - onIntermediateChainViewClick(intermediateChain)} - onDownloadClick={ - () => onIntermediateChainDownloadClick(intermediateChain, dfspName) - // eslint-disable-next-line react/jsx-curly-newline - } - /> - )} -
- {intermediateChainInfo && } -
, - ] - )} -
- ); - }); - - return <>{certsComponent}; -}; - -const MountedOtherDFSPsJWS = withMount(OtherDFSPsJWS, 'onMount'); - -export default connect(stateProps, actionProps)(MountedOtherDFSPsJWS); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { + CertificateInfo, + CertificateModal, + CertificateValidation, + Checkbox, + FileControls, + FormInput, + MessageBox, + TextField, +} from 'components'; +import { withMount } from 'utils/hocs'; +import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; +import { State, Dispatch } from 'store/types'; + +import { + getIsSameMonetaryZoneFilterEnabled, + getOtherDfspsJWSError, + getOtherDfspsJWSFilter, + getOtherDfspsJWSSameMonetaryZone, + getIsOtherDfspsJWSCertificateModalVisible, + getOtherDfspsJWSCertificateModalContent, + getIsOtherDfspsJWSIntermediateChainModalVisible, + getOtherDfspsJWSIntermediateChainModalContent, + getIsOtherDfspsJWSPending, + getFilteredOtherDfspsJWSCertificatesByDfsp, +} from './selectors'; + +import './index.css'; +import { + storeOtherDfspsJWSCertificates, + setOtherDfspsJWSFilter, + setOtherDfspsJWSSameMonetaryZone, + showOtherDfspsJWSCertificateModal, + downloadOtherDfspsJWSCertificate, + hideOtherDfspsJWSCertificateModal, + downloadOtherDfspsJWSIntermediateChain, + showOtherDfspsJWSIntermediateChainModal, + hideOtherDfspsJWSIntermediateChainModal, +} from './actions'; +import { OtherCertificates } from '../types'; + +const stateProps = (state: State) => ({ + environmentName: getEnvironmentName(state), + error: getOtherDfspsJWSError(state), + filter: getOtherDfspsJWSFilter(state), + sameMonetaryZone: getOtherDfspsJWSSameMonetaryZone(state), + certificatesByDfsp: getFilteredOtherDfspsJWSCertificatesByDfsp(state), + isJwsCertificateModalVisible: getIsOtherDfspsJWSCertificateModalVisible(state), + jwsCertificateModalContent: getOtherDfspsJWSCertificateModalContent(state), + isIntermediateChainModalVisible: getIsOtherDfspsJWSIntermediateChainModalVisible(state), + isSameMonetaryZoneFilterEnabled: getIsSameMonetaryZoneFilterEnabled(state), + intermediateChainModalContent: getOtherDfspsJWSIntermediateChainModalContent(state), + isDfspsJWSPending: getIsOtherDfspsJWSPending(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(storeOtherDfspsJWSCertificates()), + onFilterChange: (value: string) => dispatch(setOtherDfspsJWSFilter({ value })), + onSameMonetaryZoneChange: (value: boolean) => + dispatch(setOtherDfspsJWSSameMonetaryZone({ value })), + onJwsCertificateViewClick: (cert: string) => + dispatch(showOtherDfspsJWSCertificateModal({ cert })), + onJwsCertificateDownloadClick: (cert: string) => + dispatch(downloadOtherDfspsJWSCertificate({ cert })), + onJwsCertificateModalCloseClick: () => dispatch(hideOtherDfspsJWSCertificateModal()), + onIntermediateChainDownloadClick: (cert: string) => + dispatch(downloadOtherDfspsJWSIntermediateChain({ cert })), + onIntermediateChainViewClick: (cert: string) => + dispatch(showOtherDfspsJWSIntermediateChainModal({ cert })), + onIntermediateChainModalCloseClick: () => dispatch(hideOtherDfspsJWSIntermediateChainModal()), +}); + +interface OtherDFSPsJWSProps { + environmentName: string; + error: string; + filter: string; + sameMonetaryZone: string; + certificatesByDfsp: OtherCertificates[]; + jwsCertificateModalContent: string; + intermediateChainModalContent: string; + isJwsCertificateModalVisible: boolean; + isIntermediateChainModalVisible: boolean; + isSameMonetaryZoneFilterEnabled: boolean; + isDfspsJWSPending: boolean; + onFilterChange: (value: string) => void; + onSameMonetaryZoneChange: (value: string) => void; + onJwsCertificateViewClick: (cert: string) => void; + onJwsCertificateDownloadClick: (cert: string, dfspName: string) => void; + onJwsCertificateModalCloseClick: () => void; + onIntermediateChainViewClick: (cert: string) => void; + onIntermediateChainDownloadClick: (cert: string, dfspName: string) => void; + onIntermediateChainModalCloseClick: () => void; +} + +const OtherDFSPsJWS: FC = ({ + environmentName, + error, + filter, + sameMonetaryZone, + certificatesByDfsp, + jwsCertificateModalContent, + intermediateChainModalContent, + isJwsCertificateModalVisible, + isIntermediateChainModalVisible, + isSameMonetaryZoneFilterEnabled, + isDfspsJWSPending, + onFilterChange, + onSameMonetaryZoneChange, + onJwsCertificateViewClick, + onJwsCertificateDownloadClick, + onJwsCertificateModalCloseClick, + onIntermediateChainViewClick, + onIntermediateChainDownloadClick, + onIntermediateChainModalCloseClick, +}) => { + if (error) { + return ( + + ); + } + + return ( +
+
+ +
+
+ +
+ + + + {isJwsCertificateModalVisible && ( + + )} + {isIntermediateChainModalVisible && ( + + )} +
+ ); +}; + +interface OtherDFSPsCertificatesProps { + environmentName: string; + certificates: OtherCertificates[]; + isDfspsJWSPending: boolean; + onJwsCertificateViewClick: (cert: string) => void; + onJwsCertificateDownloadClick: (cert: string, dfspName: string) => void; + onIntermediateChainViewClick: (cert: string) => void; + onIntermediateChainDownloadClick: (cert: string, dfspName: string) => void; +} + +const OtherDFSPsCertificates: FC = ({ + environmentName, + certificates, + isDfspsJWSPending, + onJwsCertificateViewClick, + onJwsCertificateDownloadClick, + onIntermediateChainViewClick, + onIntermediateChainDownloadClick, +}) => { + if (!certificates.length) { + return ( + + ); + } + + const certsComponent = certificates.map((certificate: OtherCertificates) => { + const { + dfspId, + dfspName, + error, + jwsCertificate, + intermediateChain, + jwsCertificateInfo, + intermediateChainInfo, + validations, + validationState, + isDownloadEnabled, + } = certificate; + + const header = ( +
+ {dfspName} + - + {environmentName} +
+ ); + + return ( +
+ {header} + {error ? ( + + ) : ( + [ +
+ {validations && ( + + )} +
, +
+
+ + {jwsCertificate && ( + onJwsCertificateViewClick(jwsCertificate)} + onDownloadClick={() => onJwsCertificateDownloadClick(jwsCertificate, dfspName)} + downloadDisabled={!isDownloadEnabled} + /> + )} +
+ {jwsCertificateInfo && } +
, +
+
+ + {intermediateChain && ( + onIntermediateChainViewClick(intermediateChain)} + onDownloadClick={ + () => onIntermediateChainDownloadClick(intermediateChain, dfspName) + // eslint-disable-next-line react/jsx-curly-newline + } + /> + )} +
+ {intermediateChainInfo && } +
, + ] + )} +
+ ); + }); + + return <>{certsComponent}; +}; + +const MountedOtherDFSPsJWS = withMount(OtherDFSPsJWS, 'onMount'); + +export default connect(stateProps, actionProps)(MountedOtherDFSPsJWS); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/_mockData.js index b479694..34292c4 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/_mockData.js @@ -1,62 +1,62 @@ -const Validation = { - validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', - performed: true, - result: 'VALID', - message: 'Validation Test Message', - messageTemplate: 'Textual description of the validation result', - data: {}, - details: 'Test Details', -}; - -const CertInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - issuer: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - subjectAlternativeNames: ['alt1', 'alt2'], - serialNumber: '17159976289428250189079625547205715159', - notBefore: '2019-02-04T00:00:00Z', - notAfter: '2020-02-12T12:00:00Z', - signatureAlgorithm: 'SHA256WithRSA', -}; - -export const otherDfspsJWSMock = [ - { - dfspId: 1, - dfspName: '1st DFSP Name', - jwsCertificate: - '-----BEGIN CERTIFICATE-----1stDataMIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', - intermediateChain: - '-----BEGIN CERTIFICATE-----1stDataMIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', - validations: [Validation], - validationState: 'VALID', - jwsCertificateInfo: CertInfo, - intermediateChainInfo: CertInfo, - }, - { - dfspId: 2, - dfspName: '2nd DFSP Name', - jwsCertificate: - '-----BEGIN CERTIFICATE-----2DataMIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', - intermediateChain: - '-----BEGIN CERTIFICATE-----2DataMIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', - validations: [Validation], - validationState: 'VALID', - jwsCertificateInfo: CertInfo, - intermediateChainInfo: CertInfo, - }, -]; +const Validation = { + validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', + performed: true, + result: 'VALID', + message: 'Validation Test Message', + messageTemplate: 'Textual description of the validation result', + data: {}, + details: 'Test Details', +}; + +const CertInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + issuer: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + subjectAlternativeNames: ['alt1', 'alt2'], + serialNumber: '17159976289428250189079625547205715159', + notBefore: '2019-02-04T00:00:00Z', + notAfter: '2020-02-12T12:00:00Z', + signatureAlgorithm: 'SHA256WithRSA', +}; + +export const otherDfspsJWSMock = [ + { + dfspId: 1, + dfspName: '1st DFSP Name', + jwsCertificate: + '-----BEGIN CERTIFICATE-----1stDataMIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', + intermediateChain: + '-----BEGIN CERTIFICATE-----1stDataMIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', + validations: [Validation], + validationState: 'VALID', + jwsCertificateInfo: CertInfo, + intermediateChainInfo: CertInfo, + }, + { + dfspId: 2, + dfspName: '2nd DFSP Name', + jwsCertificate: + '-----BEGIN CERTIFICATE-----2DataMIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', + intermediateChain: + '-----BEGIN CERTIFICATE-----2DataMIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', + validations: [Validation], + validationState: 'VALID', + jwsCertificateInfo: CertInfo, + intermediateChainInfo: CertInfo, + }, +]; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/actions.ts index ca8c526..7fbdeca 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/actions.ts @@ -1,132 +1,132 @@ -import { - SET_OTHER_DFSPS_JWS_ERROR, - SET_OTHER_DFSPS_JWS_CERTIFICATES, - SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, - HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, - SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, - HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, - ResetOtherDfspsJWSAction, - SetOtherDfspsJWSErrorAction, - SetOtherDfspsJWSFilterAction, - SetOtherDfspsJWSCertificatesAction, - ShowOtherDfspsJWSCertificateModalAction, - HideOtherDfspsJWSCertificateModalAction, - ShowOtherDfspsJWSIntermediateChainModalAction, - HideOtherDfspsJWSIntermediateChainModalAction, - RESET_OTHER_DFSPS_JWS, - SET_OTHER_DFSPS_JWS_FILTER, - SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE, - SetOtherDfspsJWSSameMonetaryZoneAction, - STORE_OTHER_DFSPS_JWS_CERTIFICATE, - StoreOtherDfspsJWSCertificatesAction, - DownloadOtherDfspsJWSCertificateAction, - DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, - DownloadDfspsJWSIntermediateChainAction, - DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, -} from './types'; -import { OtherCertificates } from '../types'; - -export function storeOtherDfspsJWSCertificates(): StoreOtherDfspsJWSCertificatesAction { - return { - type: STORE_OTHER_DFSPS_JWS_CERTIFICATE, - }; -} - -export function downloadOtherDfspsJWSCertificate({ - cert, -}: { - cert: string; -}): DownloadOtherDfspsJWSCertificateAction { - return { - type: DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, - cert, - }; -} - -export function downloadOtherDfspsJWSIntermediateChain({ - cert, -}: { - cert: string; -}): DownloadDfspsJWSIntermediateChainAction { - return { - type: DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, - cert, - }; -} - -export function resetOtherDfspsJWS(): ResetOtherDfspsJWSAction { - return { - type: RESET_OTHER_DFSPS_JWS, - }; -} - -export function setOtherDfspsJWSError({ error }: { error: string }): SetOtherDfspsJWSErrorAction { - return { - type: SET_OTHER_DFSPS_JWS_ERROR, - error, - }; -} - -export function setOtherDfspsJWSFilter({ value }: { value: string }): SetOtherDfspsJWSFilterAction { - return { - type: SET_OTHER_DFSPS_JWS_FILTER, - value, - }; -} - -export function setOtherDfspsJWSSameMonetaryZone({ - value, -}: { - value: boolean; -}): SetOtherDfspsJWSSameMonetaryZoneAction { - return { - type: SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE, - value, - }; -} - -export function setOtherDfspsJWSCertificates({ - certificates, -}: { - certificates: OtherCertificates[]; -}): SetOtherDfspsJWSCertificatesAction { - return { - type: SET_OTHER_DFSPS_JWS_CERTIFICATES, - certificates, - }; -} - -export function showOtherDfspsJWSCertificateModal({ - cert, -}: { - cert: string; -}): ShowOtherDfspsJWSCertificateModalAction { - return { - type: SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, - cert, - }; -} - -export function hideOtherDfspsJWSCertificateModal(): HideOtherDfspsJWSCertificateModalAction { - return { - type: HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, - }; -} - -export function showOtherDfspsJWSIntermediateChainModal({ - cert, -}: { - cert: string; -}): ShowOtherDfspsJWSIntermediateChainModalAction { - return { - type: SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, - cert, - }; -} - -// eslint-disable-next-line max-len -export function hideOtherDfspsJWSIntermediateChainModal(): HideOtherDfspsJWSIntermediateChainModalAction { - return { - type: HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, - }; -} +import { + SET_OTHER_DFSPS_JWS_ERROR, + SET_OTHER_DFSPS_JWS_CERTIFICATES, + SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, + HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, + SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, + HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, + ResetOtherDfspsJWSAction, + SetOtherDfspsJWSErrorAction, + SetOtherDfspsJWSFilterAction, + SetOtherDfspsJWSCertificatesAction, + ShowOtherDfspsJWSCertificateModalAction, + HideOtherDfspsJWSCertificateModalAction, + ShowOtherDfspsJWSIntermediateChainModalAction, + HideOtherDfspsJWSIntermediateChainModalAction, + RESET_OTHER_DFSPS_JWS, + SET_OTHER_DFSPS_JWS_FILTER, + SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE, + SetOtherDfspsJWSSameMonetaryZoneAction, + STORE_OTHER_DFSPS_JWS_CERTIFICATE, + StoreOtherDfspsJWSCertificatesAction, + DownloadOtherDfspsJWSCertificateAction, + DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, + DownloadDfspsJWSIntermediateChainAction, + DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, +} from './types'; +import { OtherCertificates } from '../types'; + +export function storeOtherDfspsJWSCertificates(): StoreOtherDfspsJWSCertificatesAction { + return { + type: STORE_OTHER_DFSPS_JWS_CERTIFICATE, + }; +} + +export function downloadOtherDfspsJWSCertificate({ + cert, +}: { + cert: string; +}): DownloadOtherDfspsJWSCertificateAction { + return { + type: DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, + cert, + }; +} + +export function downloadOtherDfspsJWSIntermediateChain({ + cert, +}: { + cert: string; +}): DownloadDfspsJWSIntermediateChainAction { + return { + type: DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, + cert, + }; +} + +export function resetOtherDfspsJWS(): ResetOtherDfspsJWSAction { + return { + type: RESET_OTHER_DFSPS_JWS, + }; +} + +export function setOtherDfspsJWSError({ error }: { error: string }): SetOtherDfspsJWSErrorAction { + return { + type: SET_OTHER_DFSPS_JWS_ERROR, + error, + }; +} + +export function setOtherDfspsJWSFilter({ value }: { value: string }): SetOtherDfspsJWSFilterAction { + return { + type: SET_OTHER_DFSPS_JWS_FILTER, + value, + }; +} + +export function setOtherDfspsJWSSameMonetaryZone({ + value, +}: { + value: boolean; +}): SetOtherDfspsJWSSameMonetaryZoneAction { + return { + type: SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE, + value, + }; +} + +export function setOtherDfspsJWSCertificates({ + certificates, +}: { + certificates: OtherCertificates[]; +}): SetOtherDfspsJWSCertificatesAction { + return { + type: SET_OTHER_DFSPS_JWS_CERTIFICATES, + certificates, + }; +} + +export function showOtherDfspsJWSCertificateModal({ + cert, +}: { + cert: string; +}): ShowOtherDfspsJWSCertificateModalAction { + return { + type: SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, + cert, + }; +} + +export function hideOtherDfspsJWSCertificateModal(): HideOtherDfspsJWSCertificateModalAction { + return { + type: HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, + }; +} + +export function showOtherDfspsJWSIntermediateChainModal({ + cert, +}: { + cert: string; +}): ShowOtherDfspsJWSIntermediateChainModalAction { + return { + type: SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, + cert, + }; +} + +// eslint-disable-next-line max-len +export function hideOtherDfspsJWSIntermediateChainModal(): HideOtherDfspsJWSIntermediateChainModalAction { + return { + type: HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.css index cad4853..5e293ff 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.css @@ -1,48 +1,48 @@ -.dfsps-jws { - margin-top: 10px; -} - -.dfsps-jws__filter { - margin-bottom: 20px; -} - -.dfsps-jws__dfsp { - border-bottom: 2px solid #eee; - padding: 20px 0px; -} -.dfsps-jws__title { - display: flex; - flex-direction: row; - align-items: center; - font-family: ubuntu; - font-size: 1.2rem; - margin-bottom: 20px; -} -.dfsps-jws__name { - font-weight: bold; -} -.dfsps-jws__spacing { - width: 15px; - text-align: center; -} -.dfsps-jws__environment { - font-size: 1.2rem; -} - -.dfsps-jws__certificate-validation { - width: 400px; - margin: 10px 0px; -} - -.dfsps-jws__certificate-item { - margin-bottom: 20px; -} - -.dfsps-jws__jws-certificate, -.dfsps-jws__intermediate-chain { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; - margin-bottom: 20px; -} +.dfsps-jws { + margin-top: 10px; +} + +.dfsps-jws__filter { + margin-bottom: 20px; +} + +.dfsps-jws__dfsp { + border-bottom: 2px solid #eee; + padding: 20px 0px; +} +.dfsps-jws__title { + display: flex; + flex-direction: row; + align-items: center; + font-family: ubuntu; + font-size: 1.2rem; + margin-bottom: 20px; +} +.dfsps-jws__name { + font-weight: bold; +} +.dfsps-jws__spacing { + width: 15px; + text-align: center; +} +.dfsps-jws__environment { + font-size: 1.2rem; +} + +.dfsps-jws__certificate-validation { + width: 400px; + margin: 10px 0px; +} + +.dfsps-jws__certificate-item { + margin-bottom: 20px; +} + +.dfsps-jws__jws-certificate, +.dfsps-jws__intermediate-chain { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; + margin-bottom: 20px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.ts index 7da46a5..14a23fe 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/index.ts @@ -1,9 +1,9 @@ -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; -import OtherDFSPsJWS from './OtherDFSPsJWS'; - -export default OtherDFSPsJWS; -export { actions, reducer, selectors, types, sagas }; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; +import OtherDFSPsJWS from './OtherDFSPsJWS'; + +export default OtherDFSPsJWS; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/reducers.ts index 5e78ba5..3bc619d 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/reducers.ts @@ -1,107 +1,107 @@ -import { - OtherDFSPsJWSActionTypes, - OtherDFSPsJWSState, - RESET_OTHER_DFSPS_JWS, - SET_OTHER_DFSPS_JWS_ERROR, - SET_OTHER_DFSPS_JWS_FILTER, - SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE, - SET_OTHER_DFSPS_JWS_CERTIFICATES, - SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, - HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, - SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, - HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, -} from './types'; - -const initialState = { - otherDfspsJWSError: undefined, - otherDfspsJWSFilter: '', - otherDfspsSameMonetaryZone: false, - otherDfspsJWSCertificates: [], - otherDfspsJWSCertificateModalContent: undefined, - isOtherDfspsJWSCertificateModalVisible: false, - OtherDfspsJWSIntermediateChainModalContent: undefined, - isOtherDfspsJWSIntermediateChainModalVisible: false, -}; - -export default function OtherDfspsJWSReducer( - state = initialState, - action: OtherDFSPsJWSActionTypes -): OtherDFSPsJWSState { - switch (action.type) { - case RESET_OTHER_DFSPS_JWS: { - return initialState; - } - - case SET_OTHER_DFSPS_JWS_ERROR: { - return { - ...state, - otherDfspsJWSError: action.error, - }; - } - - case SET_OTHER_DFSPS_JWS_FILTER: { - return { - ...state, - otherDfspsJWSFilter: action.value || '', - }; - } - - case SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE: { - return { - ...state, - otherDfspsSameMonetaryZone: action.value, - }; - } - - case SET_OTHER_DFSPS_JWS_CERTIFICATES: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - otherDfspsJWSCertificates: - action.certificates.map(({ intermediateChainInfo, ...certData }) => ({ - ...certData, - intermediateChainInfo, - // TODO Array check - // intermediateChainInfo: intermediateChainInfo && intermediateChainInfo[0], - })) || [], - }; - } - - case SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL: { - return { - ...state, - isOtherDfspsJWSCertificateModalVisible: true, - otherDfspsJWSCertificateModalContent: action.cert, - }; - } - - case HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL: { - return { - ...state, - isOtherDfspsJWSCertificateModalVisible: false, - otherDfspsJWSCertificateModalContent: undefined, - }; - } - - case SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isOtherDfspsJWSIntermediateChainModalVisible: true, - OtherDfspsJWSIntermediateChainModalContent: action.cert, - }; - } - - case HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isOtherDfspsJWSIntermediateChainModalVisible: false, - OtherDfspsJWSIntermediateChainModalContent: undefined, - }; - } - - default: - return state; - } -} +import { + OtherDFSPsJWSActionTypes, + OtherDFSPsJWSState, + RESET_OTHER_DFSPS_JWS, + SET_OTHER_DFSPS_JWS_ERROR, + SET_OTHER_DFSPS_JWS_FILTER, + SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE, + SET_OTHER_DFSPS_JWS_CERTIFICATES, + SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, + HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL, + SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, + HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL, +} from './types'; + +const initialState = { + otherDfspsJWSError: undefined, + otherDfspsJWSFilter: '', + otherDfspsSameMonetaryZone: false, + otherDfspsJWSCertificates: [], + otherDfspsJWSCertificateModalContent: undefined, + isOtherDfspsJWSCertificateModalVisible: false, + OtherDfspsJWSIntermediateChainModalContent: undefined, + isOtherDfspsJWSIntermediateChainModalVisible: false, +}; + +export default function OtherDfspsJWSReducer( + state = initialState, + action: OtherDFSPsJWSActionTypes +): OtherDFSPsJWSState { + switch (action.type) { + case RESET_OTHER_DFSPS_JWS: { + return initialState; + } + + case SET_OTHER_DFSPS_JWS_ERROR: { + return { + ...state, + otherDfspsJWSError: action.error, + }; + } + + case SET_OTHER_DFSPS_JWS_FILTER: { + return { + ...state, + otherDfspsJWSFilter: action.value || '', + }; + } + + case SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE: { + return { + ...state, + otherDfspsSameMonetaryZone: action.value, + }; + } + + case SET_OTHER_DFSPS_JWS_CERTIFICATES: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + otherDfspsJWSCertificates: + action.certificates.map(({ intermediateChainInfo, ...certData }) => ({ + ...certData, + intermediateChainInfo, + // TODO Array check + // intermediateChainInfo: intermediateChainInfo && intermediateChainInfo[0], + })) || [], + }; + } + + case SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL: { + return { + ...state, + isOtherDfspsJWSCertificateModalVisible: true, + otherDfspsJWSCertificateModalContent: action.cert, + }; + } + + case HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL: { + return { + ...state, + isOtherDfspsJWSCertificateModalVisible: false, + otherDfspsJWSCertificateModalContent: undefined, + }; + } + + case SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isOtherDfspsJWSIntermediateChainModalVisible: true, + OtherDfspsJWSIntermediateChainModalContent: action.cert, + }; + } + + case HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isOtherDfspsJWSIntermediateChainModalVisible: false, + OtherDfspsJWSIntermediateChainModalContent: undefined, + }; + } + + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/sagas.ts index e8c9251..bb90c51 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/sagas.ts @@ -1,70 +1,70 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import { is20x } from 'utils/http'; -import { downloadFile } from 'utils/html'; -import find from 'lodash/find'; -import apis from 'utils/apis'; -import { getDfspName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { setOtherDfspsJWSCertificates, setOtherDfspsJWSError } from './actions'; -import { getOtherDfsps } from './selectors'; -import { - DownloadOtherDfspsJWSCertificateAction, - DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, - DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, - STORE_OTHER_DFSPS_JWS_CERTIFICATE, -} from './types'; -import { OtherCertificates } from '../types'; - -function* storeOtherDfspsJWSCertificates() { - const state = yield select(); - const otherDfsps = getOtherDfsps(state); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.otherDfspJWSCerts.read, { environmentId }); - - if (is20x(response.status)) { - const certificates = response.data.filter((certificate: OtherCertificates) => { - return find(otherDfsps, { id: certificate.dfspId }); - }); - - yield put(setOtherDfspsJWSCertificates({ certificates })); - } else { - yield put(setOtherDfspsJWSError({ error: 'Generic' })); - } -} - -function* downloadOtherDfspsJWSCertificate(action: DownloadOtherDfspsJWSCertificateAction) { - const state = yield select(); - const dfspName = getDfspName(state); - - downloadFile(action.cert, `${dfspName}-root.pem`); -} - -function* downloadOtherDfspsJWSIntermediateChain(action: DownloadOtherDfspsJWSCertificateAction) { - const state = yield select(); - - const dfspName = getDfspName(state); - - downloadFile(action.cert, `${dfspName}-intermediates.pem`); -} - -export function* StoreOtherDfspsJWSCertificatesSaga() { - yield takeLatest(STORE_OTHER_DFSPS_JWS_CERTIFICATE, storeOtherDfspsJWSCertificates); -} - -export function* DownloadOtherDfspsJWSCertificateSaga() { - yield takeLatest(DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, downloadOtherDfspsJWSCertificate); -} - -export function* DownloadOtherDfspsJWSIntermediateChainSaga() { - yield takeLatest( - DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, - downloadOtherDfspsJWSIntermediateChain - ); -} - -export default function* rootSaga() { - yield all([ - StoreOtherDfspsJWSCertificatesSaga(), - DownloadOtherDfspsJWSCertificateSaga(), - DownloadOtherDfspsJWSIntermediateChainSaga(), - ]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import { is20x } from 'utils/http'; +import { downloadFile } from 'utils/html'; +import find from 'lodash/find'; +import apis from 'utils/apis'; +import { getDfspName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { setOtherDfspsJWSCertificates, setOtherDfspsJWSError } from './actions'; +import { getOtherDfsps } from './selectors'; +import { + DownloadOtherDfspsJWSCertificateAction, + DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, + DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, + STORE_OTHER_DFSPS_JWS_CERTIFICATE, +} from './types'; +import { OtherCertificates } from '../types'; + +function* storeOtherDfspsJWSCertificates() { + const state = yield select(); + const otherDfsps = getOtherDfsps(state); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.otherDfspJWSCerts.read, { environmentId }); + + if (is20x(response.status)) { + const certificates = response.data.filter((certificate: OtherCertificates) => { + return find(otherDfsps, { id: certificate.dfspId }); + }); + + yield put(setOtherDfspsJWSCertificates({ certificates })); + } else { + yield put(setOtherDfspsJWSError({ error: 'Generic' })); + } +} + +function* downloadOtherDfspsJWSCertificate(action: DownloadOtherDfspsJWSCertificateAction) { + const state = yield select(); + const dfspName = getDfspName(state); + + downloadFile(action.cert, `${dfspName}-root.pem`); +} + +function* downloadOtherDfspsJWSIntermediateChain(action: DownloadOtherDfspsJWSCertificateAction) { + const state = yield select(); + + const dfspName = getDfspName(state); + + downloadFile(action.cert, `${dfspName}-intermediates.pem`); +} + +export function* StoreOtherDfspsJWSCertificatesSaga() { + yield takeLatest(STORE_OTHER_DFSPS_JWS_CERTIFICATE, storeOtherDfspsJWSCertificates); +} + +export function* DownloadOtherDfspsJWSCertificateSaga() { + yield takeLatest(DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE, downloadOtherDfspsJWSCertificate); +} + +export function* DownloadOtherDfspsJWSIntermediateChainSaga() { + yield takeLatest( + DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN, + downloadOtherDfspsJWSIntermediateChain + ); +} + +export default function* rootSaga() { + yield all([ + StoreOtherDfspsJWSCertificatesSaga(), + DownloadOtherDfspsJWSCertificateSaga(), + DownloadOtherDfspsJWSIntermediateChainSaga(), + ]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/selectors.ts index 9648090..cef28bf 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/selectors.ts @@ -1,77 +1,77 @@ -import { createSelector } from 'reselect'; -import find from 'lodash/find'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import { getDfspMonetaryZoneId, getDfspId, getDfsps } from 'App/ConnectionWizard/selectors'; -import { DFSP } from 'App/ConnectionWizard/Environment/Main/types'; -import { OtherCertificates } from '../types'; - -export const getOtherDfsps = createSelector(getDfsps, getDfspId, (dfsps, dfspId) => - dfsps.filter((dfsp: DFSP) => dfsp.id !== dfspId) -); - -export const getOtherDfspsJWSError = (state: State) => - state.wizard.environment.jws.otherdfspjws.otherDfspsJWSError; -export const getOtherDfspsJWSFilter = (state: State) => - state.wizard.environment.jws.otherdfspjws.otherDfspsJWSFilter; -export const getOtherDfspsJWSSameMonetaryZone = (state: State) => - state.wizard.environment.jws.otherdfspjws.otherDfspsSameMonetaryZone; -export const getOtherDfspsJWSCertificates = (state: State) => - state.wizard.environment.jws.otherdfspjws.otherDfspsJWSCertificates; -export const getOtherDfspsJWSCertificateModalContent = (state: State) => - state.wizard.environment.jws.otherdfspjws.otherDfspsJWSCertificateModalContent; -export const getIsOtherDfspsJWSCertificateModalVisible = (state: State) => - state.wizard.environment.jws.otherdfspjws.isOtherDfspsJWSCertificateModalVisible; -export const getOtherDfspsJWSIntermediateChainModalContent = (state: State) => - state.wizard.environment.jws.otherdfspjws.OtherDfspsJWSIntermediateChainModalContent; -export const getIsOtherDfspsJWSIntermediateChainModalVisible = (state: State) => - state.wizard.environment.jws.otherdfspjws.isOtherDfspsJWSIntermediateChainModalVisible; - -export const getIsOtherDfspsJWSPending = createSelector( - (state: State) => state.api, - isPending('otherDfspJWSCerts.read') -); - -export const getIsSameMonetaryZoneFilterEnabled = createSelector( - getDfspMonetaryZoneId, - (monetaryZoneId) => monetaryZoneId !== undefined -); - -const getDfspCertificatesByDfsp = createSelector( - getOtherDfspsJWSCertificates, - getOtherDfsps, - getDfspMonetaryZoneId, - (certificates, otherDfsps, monetaryZoneId) => { - return otherDfsps.map((dfsp: DFSP) => { - const cert = find(certificates, { dfspId: dfsp.id }) as OtherCertificates; - return { - ...cert, - dfspId: dfsp.id, - dfspName: dfsp.name, - dfspMonetaryZone: dfsp.monetaryZoneId, - isDownloadEnabled: dfsp.monetaryZoneId === monetaryZoneId || !monetaryZoneId, - }; - }); - } -); - -export const getFilteredOtherDfspsJWSCertificatesByDfsp = createSelector( - getDfspCertificatesByDfsp, - getOtherDfspsJWSFilter, - getOtherDfspsJWSSameMonetaryZone, - getDfspMonetaryZoneId, - (certificates, filter, filterBySameZone, zoneId) => { - const lowerCaseFilter = filter && filter.toLowerCase(); - return ( - certificates && - certificates - .filter((cert) => cert.dfspName.toLowerCase().includes(lowerCaseFilter)) - .filter((cert) => { - if (filterBySameZone) { - return cert.dfspMonetaryZone === zoneId; - } - return true; - }) - ); - } -); +import { createSelector } from 'reselect'; +import find from 'lodash/find'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import { getDfspMonetaryZoneId, getDfspId, getDfsps } from 'App/ConnectionWizard/selectors'; +import { DFSP } from 'App/ConnectionWizard/Environment/Main/types'; +import { OtherCertificates } from '../types'; + +export const getOtherDfsps = createSelector(getDfsps, getDfspId, (dfsps, dfspId) => + dfsps.filter((dfsp: DFSP) => dfsp.id !== dfspId) +); + +export const getOtherDfspsJWSError = (state: State) => + state.wizard.environment.jws.otherdfspjws.otherDfspsJWSError; +export const getOtherDfspsJWSFilter = (state: State) => + state.wizard.environment.jws.otherdfspjws.otherDfspsJWSFilter; +export const getOtherDfspsJWSSameMonetaryZone = (state: State) => + state.wizard.environment.jws.otherdfspjws.otherDfspsSameMonetaryZone; +export const getOtherDfspsJWSCertificates = (state: State) => + state.wizard.environment.jws.otherdfspjws.otherDfspsJWSCertificates; +export const getOtherDfspsJWSCertificateModalContent = (state: State) => + state.wizard.environment.jws.otherdfspjws.otherDfspsJWSCertificateModalContent; +export const getIsOtherDfspsJWSCertificateModalVisible = (state: State) => + state.wizard.environment.jws.otherdfspjws.isOtherDfspsJWSCertificateModalVisible; +export const getOtherDfspsJWSIntermediateChainModalContent = (state: State) => + state.wizard.environment.jws.otherdfspjws.OtherDfspsJWSIntermediateChainModalContent; +export const getIsOtherDfspsJWSIntermediateChainModalVisible = (state: State) => + state.wizard.environment.jws.otherdfspjws.isOtherDfspsJWSIntermediateChainModalVisible; + +export const getIsOtherDfspsJWSPending = createSelector( + (state: State) => state.api, + isPending('otherDfspJWSCerts.read') +); + +export const getIsSameMonetaryZoneFilterEnabled = createSelector( + getDfspMonetaryZoneId, + (monetaryZoneId) => monetaryZoneId !== undefined +); + +const getDfspCertificatesByDfsp = createSelector( + getOtherDfspsJWSCertificates, + getOtherDfsps, + getDfspMonetaryZoneId, + (certificates, otherDfsps, monetaryZoneId) => { + return otherDfsps.map((dfsp: DFSP) => { + const cert = find(certificates, { dfspId: dfsp.id }) as OtherCertificates; + return { + ...cert, + dfspId: dfsp.id, + dfspName: dfsp.name, + dfspMonetaryZone: dfsp.monetaryZoneId, + isDownloadEnabled: dfsp.monetaryZoneId === monetaryZoneId || !monetaryZoneId, + }; + }); + } +); + +export const getFilteredOtherDfspsJWSCertificatesByDfsp = createSelector( + getDfspCertificatesByDfsp, + getOtherDfspsJWSFilter, + getOtherDfspsJWSSameMonetaryZone, + getDfspMonetaryZoneId, + (certificates, filter, filterBySameZone, zoneId) => { + const lowerCaseFilter = filter && filter.toLowerCase(); + return ( + certificates && + certificates + .filter((cert) => cert.dfspName.toLowerCase().includes(lowerCaseFilter)) + .filter((cert) => { + if (filterBySameZone) { + return cert.dfspMonetaryZone === zoneId; + } + return true; + }) + ); + } +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/types.ts index 23a500f..3895f71 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/OtherDFSPsJWS/types.ts @@ -1,98 +1,98 @@ -import { OtherCertificates } from '../types'; - -export const RESET_OTHER_DFSPS_JWS = 'Other DFSPs JWS / Reset'; -export const SET_OTHER_DFSPS_JWS_ERROR = 'Other DFSPs JWS / Set JWS Cert Error'; -export const SET_OTHER_DFSPS_JWS_FILTER = 'Other DFSPs JWS / Set Filter'; -export const SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE = 'Other DFSPs JWS / Set Same Monetary Zone'; -export const SET_OTHER_DFSPS_JWS_CERTIFICATES = 'Other DFSPs JWS / Set Other Certificates'; -export const SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL = - 'Other DFSPs JWS / Show JWS Certificate Modal'; -export const HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL = - 'Other DFSPs JWS / Hide JWS Certificate Modal'; -export const SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL = - 'Other DFSPs JWS / Show Intermediate Chain Modal'; -export const HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL = - 'Other DFSPs JWS / Hide Intermediate Chain Modal'; -export const DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE = - 'Other DFSPs JWS / Download Other JWS Certificate'; -export const DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN = - 'Other DFSPs JWS / Download Other JWS Intermediate Chain'; -export const STORE_OTHER_DFSPS_JWS_CERTIFICATE = 'Other DFSPs JWS / Store Other JWS Certificate'; - -export interface StoreOtherDfspsJWSCertificatesAction { - type: typeof STORE_OTHER_DFSPS_JWS_CERTIFICATE; -} - -export interface ResetOtherDfspsJWSAction { - type: typeof RESET_OTHER_DFSPS_JWS; -} - -export interface SetOtherDfspsJWSErrorAction { - type: typeof SET_OTHER_DFSPS_JWS_ERROR; - error: string; -} - -export interface DownloadOtherDfspsJWSCertificateAction { - type: typeof DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE; - cert: string; -} - -export interface DownloadDfspsJWSIntermediateChainAction { - type: typeof DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN; - cert: string; -} - -export interface SetOtherDfspsJWSFilterAction { - type: typeof SET_OTHER_DFSPS_JWS_FILTER; - value: string; -} - -export interface SetOtherDfspsJWSSameMonetaryZoneAction { - type: typeof SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE; - value: boolean; -} - -export interface SetOtherDfspsJWSCertificatesAction { - type: typeof SET_OTHER_DFSPS_JWS_CERTIFICATES; - certificates: OtherCertificates[]; -} - -export interface ShowOtherDfspsJWSCertificateModalAction { - type: typeof SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL; - cert: string; -} - -export interface HideOtherDfspsJWSCertificateModalAction { - type: typeof HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL; -} - -export interface ShowOtherDfspsJWSIntermediateChainModalAction { - type: typeof SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL; - cert: string; -} - -export interface HideOtherDfspsJWSIntermediateChainModalAction { - type: typeof HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL; -} - -export type OtherDFSPsJWSActionTypes = - | ResetOtherDfspsJWSAction - | SetOtherDfspsJWSErrorAction - | SetOtherDfspsJWSFilterAction - | SetOtherDfspsJWSSameMonetaryZoneAction - | SetOtherDfspsJWSCertificatesAction - | ShowOtherDfspsJWSCertificateModalAction - | HideOtherDfspsJWSCertificateModalAction - | ShowOtherDfspsJWSIntermediateChainModalAction - | HideOtherDfspsJWSIntermediateChainModalAction; - -export interface OtherDFSPsJWSState { - otherDfspsJWSError?: string; - otherDfspsJWSFilter: string; - otherDfspsSameMonetaryZone: boolean; - otherDfspsJWSCertificates: OtherCertificates[]; - otherDfspsJWSCertificateModalContent?: string; - isOtherDfspsJWSCertificateModalVisible: boolean; - OtherDfspsJWSIntermediateChainModalContent?: string; - isOtherDfspsJWSIntermediateChainModalVisible: boolean; -} +import { OtherCertificates } from '../types'; + +export const RESET_OTHER_DFSPS_JWS = 'Other DFSPs JWS / Reset'; +export const SET_OTHER_DFSPS_JWS_ERROR = 'Other DFSPs JWS / Set JWS Cert Error'; +export const SET_OTHER_DFSPS_JWS_FILTER = 'Other DFSPs JWS / Set Filter'; +export const SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE = 'Other DFSPs JWS / Set Same Monetary Zone'; +export const SET_OTHER_DFSPS_JWS_CERTIFICATES = 'Other DFSPs JWS / Set Other Certificates'; +export const SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL = + 'Other DFSPs JWS / Show JWS Certificate Modal'; +export const HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL = + 'Other DFSPs JWS / Hide JWS Certificate Modal'; +export const SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL = + 'Other DFSPs JWS / Show Intermediate Chain Modal'; +export const HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL = + 'Other DFSPs JWS / Hide Intermediate Chain Modal'; +export const DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE = + 'Other DFSPs JWS / Download Other JWS Certificate'; +export const DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN = + 'Other DFSPs JWS / Download Other JWS Intermediate Chain'; +export const STORE_OTHER_DFSPS_JWS_CERTIFICATE = 'Other DFSPs JWS / Store Other JWS Certificate'; + +export interface StoreOtherDfspsJWSCertificatesAction { + type: typeof STORE_OTHER_DFSPS_JWS_CERTIFICATE; +} + +export interface ResetOtherDfspsJWSAction { + type: typeof RESET_OTHER_DFSPS_JWS; +} + +export interface SetOtherDfspsJWSErrorAction { + type: typeof SET_OTHER_DFSPS_JWS_ERROR; + error: string; +} + +export interface DownloadOtherDfspsJWSCertificateAction { + type: typeof DOWNLOAD_OTHER_DFSPS_JWS_CERTIFICATE; + cert: string; +} + +export interface DownloadDfspsJWSIntermediateChainAction { + type: typeof DOWNLOAD_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN; + cert: string; +} + +export interface SetOtherDfspsJWSFilterAction { + type: typeof SET_OTHER_DFSPS_JWS_FILTER; + value: string; +} + +export interface SetOtherDfspsJWSSameMonetaryZoneAction { + type: typeof SET_OTHER_DFSPS_JWS_SAME_MONETARY_ZONE; + value: boolean; +} + +export interface SetOtherDfspsJWSCertificatesAction { + type: typeof SET_OTHER_DFSPS_JWS_CERTIFICATES; + certificates: OtherCertificates[]; +} + +export interface ShowOtherDfspsJWSCertificateModalAction { + type: typeof SHOW_OTHER_DFSPS_JWS_CERTIFICATE_MODAL; + cert: string; +} + +export interface HideOtherDfspsJWSCertificateModalAction { + type: typeof HIDE_OTHER_DFSPS_JWS_CERTIFICATE_MODAL; +} + +export interface ShowOtherDfspsJWSIntermediateChainModalAction { + type: typeof SHOW_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL; + cert: string; +} + +export interface HideOtherDfspsJWSIntermediateChainModalAction { + type: typeof HIDE_OTHER_DFSPS_JWS_INTERMEDIATE_CHAIN_MODAL; +} + +export type OtherDFSPsJWSActionTypes = + | ResetOtherDfspsJWSAction + | SetOtherDfspsJWSErrorAction + | SetOtherDfspsJWSFilterAction + | SetOtherDfspsJWSSameMonetaryZoneAction + | SetOtherDfspsJWSCertificatesAction + | ShowOtherDfspsJWSCertificateModalAction + | HideOtherDfspsJWSCertificateModalAction + | ShowOtherDfspsJWSIntermediateChainModalAction + | HideOtherDfspsJWSIntermediateChainModalAction; + +export interface OtherDFSPsJWSState { + otherDfspsJWSError?: string; + otherDfspsJWSFilter: string; + otherDfspsSameMonetaryZone: boolean; + otherDfspsJWSCertificates: OtherCertificates[]; + otherDfspsJWSCertificateModalContent?: string; + isOtherDfspsJWSCertificateModalVisible: boolean; + OtherDfspsJWSIntermediateChainModalContent?: string; + isOtherDfspsJWSIntermediateChainModalVisible: boolean; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/index.ts index be91e79..66d7710 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/index.ts @@ -1,7 +1,7 @@ -import DFSPJWSCertificates from './DFSPJWSCertificates'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default DFSPJWSCertificates; -export { reducer, types, sagas }; +import DFSPJWSCertificates from './DFSPJWSCertificates'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default DFSPJWSCertificates; +export { reducer, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/reducers.ts index a28a6bf..bd0b159 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/reducers.ts @@ -1,11 +1,11 @@ -import { Reducer, combineReducers } from 'redux'; - -import { reducer as DfspJWSReducer } from './DFSPJWS'; -import { reducer as otherDFSPsJWSReducer } from './OtherDFSPsJWS'; - -const reducer: Reducer = combineReducers({ - dfspjws: DfspJWSReducer, - otherdfspjws: otherDFSPsJWSReducer, -}); - -export default reducer; +import { Reducer, combineReducers } from 'redux'; + +import { reducer as DfspJWSReducer } from './DFSPJWS'; +import { reducer as otherDFSPsJWSReducer } from './OtherDFSPsJWS'; + +const reducer: Reducer = combineReducers({ + dfspjws: DfspJWSReducer, + otherdfspjws: otherDFSPsJWSReducer, +}); + +export default reducer; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/sagas.ts index a83575a..09f71c9 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/sagas.ts @@ -1,10 +1,10 @@ -import { all } from 'redux-saga/effects'; - -import { sagas as DfspJWSSagas } from './DFSPJWS'; -import { sagas as otherDFSPsJWSSagas } from './OtherDFSPsJWS'; - -function* rootSaga() { - yield all([DfspJWSSagas(), otherDFSPsJWSSagas()]); -} - -export default rootSaga; +import { all } from 'redux-saga/effects'; + +import { sagas as DfspJWSSagas } from './DFSPJWS'; +import { sagas as otherDFSPsJWSSagas } from './OtherDFSPsJWS'; + +function* rootSaga() { + yield all([DfspJWSSagas(), otherDFSPsJWSSagas()]); +} + +export default rootSaga; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/types.ts index ebbe81f..3e73ac1 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/JWSCertificates/types.ts @@ -1,19 +1,19 @@ -import { CertificateValidationResults, CertInfo } from 'App/types'; - -export interface OtherCertificates { - dfspId: string; - dfspName: string; - error?: string; - monetaryZoneId?: string; - jwsCertificate: string; - jwsCertificateInfo: CertInfo; - rootCertificate?: string; - rootCertificateInfo?: CertInfo; - intermediateChain: string; - intermediateChainInfo: CertInfo; - serverCertificate?: string; - serverCertificateInfo?: CertInfo; - validations: CertificateValidationResults[]; - validationState: string; - isDownloadEnabled?: boolean | EventTarget; -} +import { CertificateValidationResults, CertInfo } from 'App/types'; + +export interface OtherCertificates { + dfspId: string; + dfspName: string; + error?: string; + monetaryZoneId?: string; + jwsCertificate: string; + jwsCertificateInfo: CertInfo; + rootCertificate?: string; + rootCertificateInfo?: CertInfo; + intermediateChain: string; + intermediateChainInfo: CertInfo; + serverCertificate?: string; + serverCertificateInfo?: CertInfo; + validations: CertificateValidationResults[]; + validationState: string; + isDownloadEnabled?: boolean | EventTarget; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/CSR.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/CSR.tsx index e575c3a..39863d5 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/CSR.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/CSR.tsx @@ -1,73 +1,73 @@ -import React, { FC } from 'react'; -import { Button, CertificateModal, FileControls, FormInput } from 'components'; -import connectors from './connectors'; - -import './index.css'; - -interface CSRProps { - certificate?: string | null; - isModalVisible: boolean; - isSubmitEnabled: boolean; - isSubmitPending: boolean; - isAutogeneratePending: boolean; - onChange: (value: string) => void; - onSubmit: () => void; - onAutogenerateClick: () => void; - onViewClick: () => void; - onModalCloseClick: () => void; -} - -const CSR: FC = ({ - certificate, - isModalVisible, - isSubmitEnabled, - isSubmitPending, - isAutogeneratePending, - onChange, - onAutogenerateClick, - onSubmit, - onViewClick, - onModalCloseClick, -}) => { - return ( -
-
-
- -
- - {certificate && } -
- - {isModalVisible && ( - - )} -
- ); -}; - -export default connectors(CSR); +import React, { FC } from 'react'; +import { Button, CertificateModal, FileControls, FormInput } from 'components'; +import connectors from './connectors'; + +import './index.css'; + +interface CSRProps { + certificate?: string | null; + isModalVisible: boolean; + isSubmitEnabled: boolean; + isSubmitPending: boolean; + isAutogeneratePending: boolean; + onChange: (value: string) => void; + onSubmit: () => void; + onAutogenerateClick: () => void; + onViewClick: () => void; + onModalCloseClick: () => void; +} + +const CSR: FC = ({ + certificate, + isModalVisible, + isSubmitEnabled, + isSubmitPending, + isAutogeneratePending, + onChange, + onAutogenerateClick, + onSubmit, + onViewClick, + onModalCloseClick, +}) => { + return ( +
+
+
+ +
+ + {certificate && } +
+ + {isModalVisible && ( + + )} +
+ ); +}; + +export default connectors(CSR); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/actions.ts index b4b2009..e7df0c6 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/actions.ts @@ -1,53 +1,53 @@ -// import { getDfspCsrCertificate } from './selectors'; - -import { - RESET_DFSP_CSR, - SET_DFSP_CSR_CERTIFICATE, - SHOW_DFSP_CSR_CERTIFICATE_MODAL, - HIDE_DFSP_CSR_CERTIFICATE_MODAL, - SUBMIT_DFSP_CSR_CERTIFICATE, - AUTOGENERATE_DFSP_CSR_CERTIFICATE, - ResetDfspCsrAction, - SetDfspCsrCertificateAction, - ShowDfspCsrCertificateModalAction, - HideDfspCsrCertificateModalAction, - SubmitDfspCsrCertificateAction, - AutogenerateDfspCsrCertificateAction, -} from './types'; - -export function resetDfspCsr(): ResetDfspCsrAction { - return { - type: RESET_DFSP_CSR, - }; -} - -export function setDfspCsrCertificate({ cert }: { cert: string }): SetDfspCsrCertificateAction { - return { - type: SET_DFSP_CSR_CERTIFICATE, - cert, - }; -} - -export function showDfspCsrCertificateModal(): ShowDfspCsrCertificateModalAction { - return { - type: SHOW_DFSP_CSR_CERTIFICATE_MODAL, - }; -} - -export function hideDfspCsrCertificateModal(): HideDfspCsrCertificateModalAction { - return { - type: HIDE_DFSP_CSR_CERTIFICATE_MODAL, - }; -} - -export function submitDfspCsrCertificate(): SubmitDfspCsrCertificateAction { - return { - type: SUBMIT_DFSP_CSR_CERTIFICATE, - }; -} - -export function autogenerateDfspCsrCertificate(): AutogenerateDfspCsrCertificateAction { - return { - type: AUTOGENERATE_DFSP_CSR_CERTIFICATE, - }; -} +// import { getDfspCsrCertificate } from './selectors'; + +import { + RESET_DFSP_CSR, + SET_DFSP_CSR_CERTIFICATE, + SHOW_DFSP_CSR_CERTIFICATE_MODAL, + HIDE_DFSP_CSR_CERTIFICATE_MODAL, + SUBMIT_DFSP_CSR_CERTIFICATE, + AUTOGENERATE_DFSP_CSR_CERTIFICATE, + ResetDfspCsrAction, + SetDfspCsrCertificateAction, + ShowDfspCsrCertificateModalAction, + HideDfspCsrCertificateModalAction, + SubmitDfspCsrCertificateAction, + AutogenerateDfspCsrCertificateAction, +} from './types'; + +export function resetDfspCsr(): ResetDfspCsrAction { + return { + type: RESET_DFSP_CSR, + }; +} + +export function setDfspCsrCertificate({ cert }: { cert: string }): SetDfspCsrCertificateAction { + return { + type: SET_DFSP_CSR_CERTIFICATE, + cert, + }; +} + +export function showDfspCsrCertificateModal(): ShowDfspCsrCertificateModalAction { + return { + type: SHOW_DFSP_CSR_CERTIFICATE_MODAL, + }; +} + +export function hideDfspCsrCertificateModal(): HideDfspCsrCertificateModalAction { + return { + type: HIDE_DFSP_CSR_CERTIFICATE_MODAL, + }; +} + +export function submitDfspCsrCertificate(): SubmitDfspCsrCertificateAction { + return { + type: SUBMIT_DFSP_CSR_CERTIFICATE, + }; +} + +export function autogenerateDfspCsrCertificate(): AutogenerateDfspCsrCertificateAction { + return { + type: AUTOGENERATE_DFSP_CSR_CERTIFICATE, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/connectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/connectors.ts index 89e9a0d..511878a 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/connectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/connectors.ts @@ -1,36 +1,36 @@ -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { - setDfspCsrCertificate, - submitDfspCsrCertificate, - autogenerateDfspCsrCertificate, - showDfspCsrCertificateModal, - hideDfspCsrCertificateModal, -} from './actions'; -import { - getDfspCsrCertificate, - getIsDfspCsrModalVisible, - getIsDfspCsrSubmitEnabled, - getIsDfspCsrSubmitPending, - getIsDfspCsrAutogeneratePending, -} from './selectors'; - -import './index.css'; - -const stateProps = (state: State) => ({ - certificate: getDfspCsrCertificate(state), - isModalVisible: getIsDfspCsrModalVisible(state), - isSubmitEnabled: getIsDfspCsrSubmitEnabled(state), - isSubmitPending: getIsDfspCsrSubmitPending(state), - isAutogeneratePending: getIsDfspCsrAutogeneratePending(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onChange: (cert: string) => dispatch(setDfspCsrCertificate({ cert })), - onSubmit: () => dispatch(submitDfspCsrCertificate()), - onAutogenerateClick: () => dispatch(autogenerateDfspCsrCertificate()), - onViewClick: () => dispatch(showDfspCsrCertificateModal()), - onModalCloseClick: () => dispatch(hideDfspCsrCertificateModal()), -}); - -export default connect(stateProps, actionProps); +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { + setDfspCsrCertificate, + submitDfspCsrCertificate, + autogenerateDfspCsrCertificate, + showDfspCsrCertificateModal, + hideDfspCsrCertificateModal, +} from './actions'; +import { + getDfspCsrCertificate, + getIsDfspCsrModalVisible, + getIsDfspCsrSubmitEnabled, + getIsDfspCsrSubmitPending, + getIsDfspCsrAutogeneratePending, +} from './selectors'; + +import './index.css'; + +const stateProps = (state: State) => ({ + certificate: getDfspCsrCertificate(state), + isModalVisible: getIsDfspCsrModalVisible(state), + isSubmitEnabled: getIsDfspCsrSubmitEnabled(state), + isSubmitPending: getIsDfspCsrSubmitPending(state), + isAutogeneratePending: getIsDfspCsrAutogeneratePending(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onChange: (cert: string) => dispatch(setDfspCsrCertificate({ cert })), + onSubmit: () => dispatch(submitDfspCsrCertificate()), + onAutogenerateClick: () => dispatch(autogenerateDfspCsrCertificate()), + onViewClick: () => dispatch(showDfspCsrCertificateModal()), + onModalCloseClick: () => dispatch(hideDfspCsrCertificateModal()), +}); + +export default connect(stateProps, actionProps); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.css index de1a5cb..8c4241d 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.css @@ -1,27 +1,27 @@ -.csr { - margin-top: 10px; -} -.csr__submit { - width: 200px; - margin-bottom: 20px; -} - -.csr__autogenerate { - width: 200px; - margin-bottom: 20px; - margin-left: 20px; -} - -.csr__csr { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; - margin-bottom: 20px; -} -.csr__intermediate-chain { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; -} +.csr { + margin-top: 10px; +} +.csr__submit { + width: 200px; + margin-bottom: 20px; +} + +.csr__autogenerate { + width: 200px; + margin-bottom: 20px; + margin-left: 20px; +} + +.csr__csr { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; + margin-bottom: 20px; +} +.csr__intermediate-chain { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.ts index 16f5a85..2d18b33 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/index.ts @@ -1,9 +1,9 @@ -import CSR from './CSR'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default CSR; -export { actions, reducer, selectors, types, sagas }; +import CSR from './CSR'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default CSR; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/reducers.ts index 75c27ab..1decf26 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/reducers.ts @@ -1,45 +1,45 @@ -import { - RESET_DFSP_CSR, - SET_DFSP_CSR_CERTIFICATE, - SHOW_DFSP_CSR_CERTIFICATE_MODAL, - HIDE_DFSP_CSR_CERTIFICATE_MODAL, - DfspCSRActionTypes, - CSRState, -} from './types'; - -const initialState = { - dfspCsrCertificate: undefined, - isDfspCsrModalVisible: false, -}; - -export default function csrReducer(state = initialState, action: DfspCSRActionTypes): CSRState { - switch (action.type) { - case RESET_DFSP_CSR: - return initialState; - case SET_DFSP_CSR_CERTIFICATE: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - dfspCsrCertificate: action.cert || null, - }; - } - case SHOW_DFSP_CSR_CERTIFICATE_MODAL: { - return { - ...state, - isDfspCsrModalVisible: true, - }; - } - case HIDE_DFSP_CSR_CERTIFICATE_MODAL: { - return { - ...state, - isDfspCsrModalVisible: false, - }; - } - default: - return state; - } -} - -export { initialState }; +import { + RESET_DFSP_CSR, + SET_DFSP_CSR_CERTIFICATE, + SHOW_DFSP_CSR_CERTIFICATE_MODAL, + HIDE_DFSP_CSR_CERTIFICATE_MODAL, + DfspCSRActionTypes, + CSRState, +} from './types'; + +const initialState = { + dfspCsrCertificate: undefined, + isDfspCsrModalVisible: false, +}; + +export default function csrReducer(state = initialState, action: DfspCSRActionTypes): CSRState { + switch (action.type) { + case RESET_DFSP_CSR: + return initialState; + case SET_DFSP_CSR_CERTIFICATE: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + dfspCsrCertificate: action.cert || null, + }; + } + case SHOW_DFSP_CSR_CERTIFICATE_MODAL: { + return { + ...state, + isDfspCsrModalVisible: true, + }; + } + case HIDE_DFSP_CSR_CERTIFICATE_MODAL: { + return { + ...state, + isDfspCsrModalVisible: false, + }; + } + default: + return state; + } +} + +export { initialState }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/sagas.ts index 3a439b6..3a2c296 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/sagas.ts @@ -1,61 +1,61 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import apis from 'utils/apis'; -import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { showToast, showErrorModal } from 'App/actions'; -import { is20x } from 'utils/http'; -import { getDfspCsrCertificate } from './selectors'; -import { - SUBMIT_DFSP_CSR_CERTIFICATE, - SubmitDfspCsrCertificateAction, - AUTOGENERATE_DFSP_CSR_CERTIFICATE, - AutogenerateDfspCsrCertificateAction, -} from './types'; - -import { resetDfspCsr } from './actions'; - -function* submitDfspCSRCertificate(action: SubmitDfspCsrCertificateAction) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const clientCSR = getDfspCsrCertificate(state); - const body = { clientCSR }; - - const response = yield call(apis.inboundEnrollments.create, { environmentId, body }); - if (is20x(response.status)) { - yield put(showToast()); - yield put(resetDfspCsr()); - } else { - yield put(showErrorModal('Error Submitting CSR')); - } - } catch (e) { - yield put(showErrorModal(e.message)); - } -} - -export function* SubmitCSRSSaga() { - yield takeLatest(SUBMIT_DFSP_CSR_CERTIFICATE, submitDfspCSRCertificate); -} - -function* autogenerataeDfspCSRCertificate(action: AutogenerateDfspCsrCertificateAction) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - - const response = yield call(apis.inboundEnrollmentsCsr.create, { environmentId }); - if (is20x(response.status)) { - yield put(showToast()); - } else { - yield put(showErrorModal('Error Auto Generating CSR')); - } - } catch (e) { - yield put(showErrorModal(e.message)); - } -} - -export function* AutogenerateCSRSSaga() { - yield takeLatest(AUTOGENERATE_DFSP_CSR_CERTIFICATE, autogenerataeDfspCSRCertificate); -} - -export default function* rootSaga() { - yield all([SubmitCSRSSaga(), AutogenerateCSRSSaga()]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import apis from 'utils/apis'; +import { getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { showToast, showErrorModal } from 'App/actions'; +import { is20x } from 'utils/http'; +import { getDfspCsrCertificate } from './selectors'; +import { + SUBMIT_DFSP_CSR_CERTIFICATE, + SubmitDfspCsrCertificateAction, + AUTOGENERATE_DFSP_CSR_CERTIFICATE, + AutogenerateDfspCsrCertificateAction, +} from './types'; + +import { resetDfspCsr } from './actions'; + +function* submitDfspCSRCertificate(action: SubmitDfspCsrCertificateAction) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const clientCSR = getDfspCsrCertificate(state); + const body = { clientCSR }; + + const response = yield call(apis.inboundEnrollments.create, { environmentId, body }); + if (is20x(response.status)) { + yield put(showToast()); + yield put(resetDfspCsr()); + } else { + yield put(showErrorModal('Error Submitting CSR')); + } + } catch (e) { + yield put(showErrorModal(e.message)); + } +} + +export function* SubmitCSRSSaga() { + yield takeLatest(SUBMIT_DFSP_CSR_CERTIFICATE, submitDfspCSRCertificate); +} + +function* autogenerataeDfspCSRCertificate(action: AutogenerateDfspCsrCertificateAction) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + + const response = yield call(apis.inboundEnrollmentsCsr.create, { environmentId }); + if (is20x(response.status)) { + yield put(showToast()); + } else { + yield put(showErrorModal('Error Auto Generating CSR')); + } + } catch (e) { + yield put(showErrorModal(e.message)); + } +} + +export function* AutogenerateCSRSSaga() { + yield takeLatest(AUTOGENERATE_DFSP_CSR_CERTIFICATE, autogenerataeDfspCSRCertificate); +} + +export default function* rootSaga() { + yield all([SubmitCSRSSaga(), AutogenerateCSRSSaga()]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/selectors.ts index 177b7d0..c985ef3 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/selectors.ts @@ -1,20 +1,20 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import * as testers from 'utils/testers'; - -export const getDfspCsrCertificate = (state: State) => - state.wizard.environment.tls.tlsclient.csr.dfspCsrCertificate; -export const getIsDfspCsrModalVisible = (state: State) => - state.wizard.environment.tls.tlsclient.csr.isDfspCsrModalVisible; - -export const getIsDfspCsrSubmitPending = createSelector( - (state: State) => state.api, - isPending('inboundEnrollments.create') -); - -export const getIsDfspCsrSubmitEnabled = createSelector(getDfspCsrCertificate, testers.isNotNil); -export const getIsDfspCsrAutogeneratePending = createSelector( - (state: State) => state.api, - isPending('inboundEnrollmentsCsr.create') -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import * as testers from 'utils/testers'; + +export const getDfspCsrCertificate = (state: State) => + state.wizard.environment.tls.tlsclient.csr.dfspCsrCertificate; +export const getIsDfspCsrModalVisible = (state: State) => + state.wizard.environment.tls.tlsclient.csr.isDfspCsrModalVisible; + +export const getIsDfspCsrSubmitPending = createSelector( + (state: State) => state.api, + isPending('inboundEnrollments.create') +); + +export const getIsDfspCsrSubmitEnabled = createSelector(getDfspCsrCertificate, testers.isNotNil); +export const getIsDfspCsrAutogeneratePending = createSelector( + (state: State) => state.api, + isPending('inboundEnrollmentsCsr.create') +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/types.ts index ac68ff0..568bd52 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/CSR/types.ts @@ -1,39 +1,39 @@ -export const RESET_DFSP_CSR = 'DFSP CSR / Reset'; -export const SET_DFSP_CSR_CERTIFICATE = 'DFSP CSR / Set Certificate'; -export const SHOW_DFSP_CSR_CERTIFICATE_MODAL = 'DFSP CSR / Show Certificate Modal'; -export const HIDE_DFSP_CSR_CERTIFICATE_MODAL = 'DFSP CSR / Hide Certificate Modal'; -export const SUBMIT_DFSP_CSR_CERTIFICATE = 'DFSP CSR / Submit CSR'; -export const AUTOGENERATE_DFSP_CSR_CERTIFICATE = 'DFSP CSR / Autogenerate CSR'; - -export interface CSRState { - dfspCsrCertificate?: string | null; - isDfspCsrModalVisible: boolean; -} - -export interface ResetDfspCsrAction { - type: typeof RESET_DFSP_CSR; -} -export interface SetDfspCsrCertificateAction { - type: typeof SET_DFSP_CSR_CERTIFICATE; - cert: string; -} -export interface ShowDfspCsrCertificateModalAction { - type: typeof SHOW_DFSP_CSR_CERTIFICATE_MODAL; -} -export interface HideDfspCsrCertificateModalAction { - type: typeof HIDE_DFSP_CSR_CERTIFICATE_MODAL; -} -export interface SubmitDfspCsrCertificateAction { - type: typeof SUBMIT_DFSP_CSR_CERTIFICATE; -} -export interface AutogenerateDfspCsrCertificateAction { - type: typeof AUTOGENERATE_DFSP_CSR_CERTIFICATE; -} - -export type DfspCSRActionTypes = - | ResetDfspCsrAction - | SetDfspCsrCertificateAction - | ShowDfspCsrCertificateModalAction - | HideDfspCsrCertificateModalAction - | SubmitDfspCsrCertificateAction - | AutogenerateDfspCsrCertificateAction; +export const RESET_DFSP_CSR = 'DFSP CSR / Reset'; +export const SET_DFSP_CSR_CERTIFICATE = 'DFSP CSR / Set Certificate'; +export const SHOW_DFSP_CSR_CERTIFICATE_MODAL = 'DFSP CSR / Show Certificate Modal'; +export const HIDE_DFSP_CSR_CERTIFICATE_MODAL = 'DFSP CSR / Hide Certificate Modal'; +export const SUBMIT_DFSP_CSR_CERTIFICATE = 'DFSP CSR / Submit CSR'; +export const AUTOGENERATE_DFSP_CSR_CERTIFICATE = 'DFSP CSR / Autogenerate CSR'; + +export interface CSRState { + dfspCsrCertificate?: string | null; + isDfspCsrModalVisible: boolean; +} + +export interface ResetDfspCsrAction { + type: typeof RESET_DFSP_CSR; +} +export interface SetDfspCsrCertificateAction { + type: typeof SET_DFSP_CSR_CERTIFICATE; + cert: string; +} +export interface ShowDfspCsrCertificateModalAction { + type: typeof SHOW_DFSP_CSR_CERTIFICATE_MODAL; +} +export interface HideDfspCsrCertificateModalAction { + type: typeof HIDE_DFSP_CSR_CERTIFICATE_MODAL; +} +export interface SubmitDfspCsrCertificateAction { + type: typeof SUBMIT_DFSP_CSR_CERTIFICATE; +} +export interface AutogenerateDfspCsrCertificateAction { + type: typeof AUTOGENERATE_DFSP_CSR_CERTIFICATE; +} + +export type DfspCSRActionTypes = + | ResetDfspCsrAction + | SetDfspCsrCertificateAction + | ShowDfspCsrCertificateModalAction + | HideDfspCsrCertificateModalAction + | SubmitDfspCsrCertificateAction + | AutogenerateDfspCsrCertificateAction; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/HubCSRs.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/HubCSRs.tsx index 52138df..eb528af 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/HubCSRs.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/HubCSRs.tsx @@ -1,238 +1,238 @@ -import React, { FC } from 'react'; -import { - AnimateFadeIn, - CertificateCard, - CertificateInfo, - CertificateModal, - CertificateValidation, - MessageBox, - Spinner, - Status, -} from 'components'; -import { withMount } from 'utils/hocs'; -import { isNil, isNotNil } from 'utils/testers'; -import { ErrorMessage, CertificateValidationResults, CertInfo } from 'App/types'; - -import connectors from './connectors'; -import { ValidationStates } from './types'; -import { CSR, CSRInfo } from '../types'; - -import './index.css'; - -interface HubCSRsProps { - dfspName: string; - error: ErrorMessage; - csrs: CSR[]; - filter: string; - certificateModalContent?: string; - certificateModalTitle?: string; - isCertificateModalVisible: boolean; - isPending: boolean; - isCertificateSigningPendingByEnrollmentId: { - [id: string]: boolean; - }; - isCertificateAutoSigningPendingByEnrollmentId: { - [id: string]: boolean; - }; - onSignCSRClick: (enrollmentId: number) => void; - onAutoSignCSRClick: (enrollmentId: number) => void; - onCertificateViewClick: (certificate: string, title: string) => void; - onCertificateDownloadClick: (certificate: string, cn: string, extension: string) => void; - onCertificateModalCloseClick: () => void; -} - -const HubCSRs: FC = ({ - error, - csrs, - isCertificateModalVisible, - certificateModalTitle, - certificateModalContent, - isPending, - isCertificateSigningPendingByEnrollmentId, - isCertificateAutoSigningPendingByEnrollmentId, - onSignCSRClick, - onAutoSignCSRClick, - onCertificateViewClick, - onCertificateDownloadClick, - onCertificateModalCloseClick, -}) => { - if (error) { - return ( - - ); - } - if (!csrs.length) { - return ( - - ); - } - if (isPending) { - return ; - } - return ( -
- - {csrs.map( - ( - { certificate, certInfo, csr, csrInfo, state, validations, validationState, id }, - index - ) => ( - - ) - )} - - - {isCertificateModalVisible && ( - - )} -
- ); -}; - -interface HubCSRProps { - enrollmentId: number; - certificate?: string; - certInfo?: CertInfo; - csr: string; - csrInfo: CSRInfo; - state: string; - validations: CertificateValidationResults[]; - validationState: string; - isCertificateSigningPending: boolean; - isCertificateAutoSigningPending: boolean; - onAutoSignCSRClick: (enrollmentId: number) => void; - onSignCSRClick: (enrollmentId: number) => void; - onViewClick: (certificate: string, title: string) => void; - onDownloadClick: (certificate: string, cn: string, extension: string) => void; -} - -const HubCSR: FC = ({ - enrollmentId, - certificate, - certInfo, - csr, - csrInfo, - state, - validations, - validationState, - isCertificateSigningPending, - isCertificateAutoSigningPending, - onAutoSignCSRClick, - onSignCSRClick, - onViewClick, - onDownloadClick, -}) => ( - - - - - {csrInfo.subject.CN || 'Common Name'} - - - - - onAutoSignCSRClick(enrollmentId)} - pending={isCertificateAutoSigningPending} - /> - onSignCSRClick(enrollmentId)} - pending={isCertificateSigningPending} - /> - - - - -
- -
- -
- - - onViewClick(csr, 'CSR')} - /> - onDownloadClick(csr, csrInfo.subject.CN, '.csr')} - /> - onViewClick(certificate as string, 'Certificate')} - disabled={isNil(certificate)} - /> - onDownloadClick(certificate as string, certInfo?.subject?.CN as string, '.cer') - // eslint-disable-next-line react/jsx-curly-newline - } - disabled={isNil(certificate)} - /> - -
-); - -const MountedHubCSRs = withMount(HubCSRs, 'onMount'); -export default connectors(MountedHubCSRs); +import React, { FC } from 'react'; +import { + AnimateFadeIn, + CertificateCard, + CertificateInfo, + CertificateModal, + CertificateValidation, + MessageBox, + Spinner, + Status, +} from 'components'; +import { withMount } from 'utils/hocs'; +import { isNil, isNotNil } from 'utils/testers'; +import { ErrorMessage, CertificateValidationResults, CertInfo } from 'App/types'; + +import connectors from './connectors'; +import { ValidationStates } from './types'; +import { CSR, CSRInfo } from '../types'; + +import './index.css'; + +interface HubCSRsProps { + dfspName: string; + error: ErrorMessage; + csrs: CSR[]; + filter: string; + certificateModalContent?: string; + certificateModalTitle?: string; + isCertificateModalVisible: boolean; + isPending: boolean; + isCertificateSigningPendingByEnrollmentId: { + [id: string]: boolean; + }; + isCertificateAutoSigningPendingByEnrollmentId: { + [id: string]: boolean; + }; + onSignCSRClick: (enrollmentId: number) => void; + onAutoSignCSRClick: (enrollmentId: number) => void; + onCertificateViewClick: (certificate: string, title: string) => void; + onCertificateDownloadClick: (certificate: string, cn: string, extension: string) => void; + onCertificateModalCloseClick: () => void; +} + +const HubCSRs: FC = ({ + error, + csrs, + isCertificateModalVisible, + certificateModalTitle, + certificateModalContent, + isPending, + isCertificateSigningPendingByEnrollmentId, + isCertificateAutoSigningPendingByEnrollmentId, + onSignCSRClick, + onAutoSignCSRClick, + onCertificateViewClick, + onCertificateDownloadClick, + onCertificateModalCloseClick, +}) => { + if (error) { + return ( + + ); + } + if (!csrs.length) { + return ( + + ); + } + if (isPending) { + return ; + } + return ( +
+ + {csrs.map( + ( + { certificate, certInfo, csr, csrInfo, state, validations, validationState, id }, + index + ) => ( + + ) + )} + + + {isCertificateModalVisible && ( + + )} +
+ ); +}; + +interface HubCSRProps { + enrollmentId: number; + certificate?: string; + certInfo?: CertInfo; + csr: string; + csrInfo: CSRInfo; + state: string; + validations: CertificateValidationResults[]; + validationState: string; + isCertificateSigningPending: boolean; + isCertificateAutoSigningPending: boolean; + onAutoSignCSRClick: (enrollmentId: number) => void; + onSignCSRClick: (enrollmentId: number) => void; + onViewClick: (certificate: string, title: string) => void; + onDownloadClick: (certificate: string, cn: string, extension: string) => void; +} + +const HubCSR: FC = ({ + enrollmentId, + certificate, + certInfo, + csr, + csrInfo, + state, + validations, + validationState, + isCertificateSigningPending, + isCertificateAutoSigningPending, + onAutoSignCSRClick, + onSignCSRClick, + onViewClick, + onDownloadClick, +}) => ( + + + + + {csrInfo.subject.CN || 'Common Name'} + + + + + onAutoSignCSRClick(enrollmentId)} + pending={isCertificateAutoSigningPending} + /> + onSignCSRClick(enrollmentId)} + pending={isCertificateSigningPending} + /> + + + + +
+ +
+ +
+ + + onViewClick(csr, 'CSR')} + /> + onDownloadClick(csr, csrInfo.subject.CN, '.csr')} + /> + onViewClick(certificate as string, 'Certificate')} + disabled={isNil(certificate)} + /> + onDownloadClick(certificate as string, certInfo?.subject?.CN as string, '.cer') + // eslint-disable-next-line react/jsx-curly-newline + } + disabled={isNil(certificate)} + /> + +
+); + +const MountedHubCSRs = withMount(HubCSRs, 'onMount'); +export default connectors(MountedHubCSRs); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/_mockData.js index f387ff5..5223bf5 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/_mockData.js @@ -1,83 +1,83 @@ -// CSR_CERT_SAME_PUBLIC_KEY -// CSR_CERT_SAME_SUBJECT_INFO - -const Validation = { - validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', - performed: true, - result: 'VALID', - message: 'It worked', - messageTemplate: - 'Textual description of the validation result, using the JavaScript template literal format', - data: {}, - details: 'string', -}; -const CSRInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - extensions: { - subjectAltName: { - dns: ['dns1', 'dns2'], - ips: ['163.10.5.24'], - emailAddresses: ['pki@modusbox.live'], - uris: ['http://modusbox.live'], - }, - }, -}; - -const CertInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - issuer: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - subjectAlternativeNames: ['alt1', 'alt2'], - serialNumber: '17159976289428250189079625547205715159', - notBefore: '2019-02-04T00:00:00Z', - notAfter: '2020-02-12T12:00:00Z', - signatureAlgorithm: 'SHA256WithRSA', -}; - -export const outboundEnrollments = [ - { - id: 1, - certificate: 'string', - csr: 'string', - state: 'CSR_LOADED', - certInfo: CertInfo, - csrInfo: CSRInfo, - hubCAId: 1, - validations: [Validation], - validationState: 'VALID', - }, - { - id: 2, - certificate: 'string', - csr: 'string', - state: 'NEW', - // certInfo: CertInfo, - csrInfo: CSRInfo, - hubCAId: 1, - validations: [Validation], - validationState: 'VALID', - }, -]; +// CSR_CERT_SAME_PUBLIC_KEY +// CSR_CERT_SAME_SUBJECT_INFO + +const Validation = { + validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', + performed: true, + result: 'VALID', + message: 'It worked', + messageTemplate: + 'Textual description of the validation result, using the JavaScript template literal format', + data: {}, + details: 'string', +}; +const CSRInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + extensions: { + subjectAltName: { + dns: ['dns1', 'dns2'], + ips: ['163.10.5.24'], + emailAddresses: ['pki@modusbox.live'], + uris: ['http://modusbox.live'], + }, + }, +}; + +const CertInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + issuer: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + subjectAlternativeNames: ['alt1', 'alt2'], + serialNumber: '17159976289428250189079625547205715159', + notBefore: '2019-02-04T00:00:00Z', + notAfter: '2020-02-12T12:00:00Z', + signatureAlgorithm: 'SHA256WithRSA', +}; + +export const outboundEnrollments = [ + { + id: 1, + certificate: 'string', + csr: 'string', + state: 'CSR_LOADED', + certInfo: CertInfo, + csrInfo: CSRInfo, + hubCAId: 1, + validations: [Validation], + validationState: 'VALID', + }, + { + id: 2, + certificate: 'string', + csr: 'string', + state: 'NEW', + // certInfo: CertInfo, + csrInfo: CSRInfo, + hubCAId: 1, + validations: [Validation], + validationState: 'VALID', + }, +]; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/actions.ts index 823915f..cf5a867 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/actions.ts @@ -1,110 +1,110 @@ -import { - RESET_DFSP_HUB_CSRS, - SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR, - SET_DFSP_HUB_CSRS_CERTIFICATES, - SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL, - HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL, - SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, - AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, - REQUEST_DFSP_HUB_CSRS_CERTIFICATES, - DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, - ResetDfspHubCsrsAction, - SetDfspHubCsrsCertificatesErrorAction, - SetDfspHubCsrsCertificatesAction, - ShowDfspHubCsrsCertificateModalAction, - HideDfspHubCsrsCertificateModalAction, - SubmitDfspHubCsrsCertificateAction, - AutogenerateDfspHubCsrsCertificateAction, - RequestDfspHubCsrCertificatesAction, - DownloadDfspHubCsrsCertificateAction, -} from './types'; -import { CSR } from '../types'; - -export function resetDfspHubCsrs(): ResetDfspHubCsrsAction { - return { - type: RESET_DFSP_HUB_CSRS, - }; -} -export function setDfspHubCsrsCertificatesError({ - error, -}: { - error: string; -}): SetDfspHubCsrsCertificatesErrorAction { - return { - type: SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR, - error, - }; -} -export function setDfspHubCsrsCertificates({ - certificates, -}: { - certificates: CSR[]; -}): SetDfspHubCsrsCertificatesAction { - return { - type: SET_DFSP_HUB_CSRS_CERTIFICATES, - certificates, - }; -} -export function showDfspHubCsrsCertificateModal({ - certificate, - title, -}: { - certificate: string; - title: string; -}): ShowDfspHubCsrsCertificateModalAction { - return { - type: SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL, - certificate, - title, - }; -} -export function hideDfspHubCsrsCertificateModal(): HideDfspHubCsrsCertificateModalAction { - return { - type: HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL, - }; -} - -export function requestDfspHubCsrsCertificates(): RequestDfspHubCsrCertificatesAction { - return { - type: REQUEST_DFSP_HUB_CSRS_CERTIFICATES, - }; -} - -export function submitDfspHubCsrsCertificate({ - enrollmentId, -}: { - enrollmentId: number; -}): SubmitDfspHubCsrsCertificateAction { - return { - type: SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, - enrollmentId, - }; -} - -export function autogenerateDfspHubCsrsCertificate({ - enrollmentId, -}: { - enrollmentId: number; -}): AutogenerateDfspHubCsrsCertificateAction { - return { - type: AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, - enrollmentId, - }; -} - -export function downloadDfspHubCsrsCertificate({ - certificate, - cn, - extension, -}: { - certificate: string; - cn: string; - extension: string; -}): DownloadDfspHubCsrsCertificateAction { - return { - type: DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, - certificate, - cn, - extension, - }; -} +import { + RESET_DFSP_HUB_CSRS, + SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR, + SET_DFSP_HUB_CSRS_CERTIFICATES, + SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL, + HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL, + SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, + AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, + REQUEST_DFSP_HUB_CSRS_CERTIFICATES, + DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, + ResetDfspHubCsrsAction, + SetDfspHubCsrsCertificatesErrorAction, + SetDfspHubCsrsCertificatesAction, + ShowDfspHubCsrsCertificateModalAction, + HideDfspHubCsrsCertificateModalAction, + SubmitDfspHubCsrsCertificateAction, + AutogenerateDfspHubCsrsCertificateAction, + RequestDfspHubCsrCertificatesAction, + DownloadDfspHubCsrsCertificateAction, +} from './types'; +import { CSR } from '../types'; + +export function resetDfspHubCsrs(): ResetDfspHubCsrsAction { + return { + type: RESET_DFSP_HUB_CSRS, + }; +} +export function setDfspHubCsrsCertificatesError({ + error, +}: { + error: string; +}): SetDfspHubCsrsCertificatesErrorAction { + return { + type: SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR, + error, + }; +} +export function setDfspHubCsrsCertificates({ + certificates, +}: { + certificates: CSR[]; +}): SetDfspHubCsrsCertificatesAction { + return { + type: SET_DFSP_HUB_CSRS_CERTIFICATES, + certificates, + }; +} +export function showDfspHubCsrsCertificateModal({ + certificate, + title, +}: { + certificate: string; + title: string; +}): ShowDfspHubCsrsCertificateModalAction { + return { + type: SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL, + certificate, + title, + }; +} +export function hideDfspHubCsrsCertificateModal(): HideDfspHubCsrsCertificateModalAction { + return { + type: HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL, + }; +} + +export function requestDfspHubCsrsCertificates(): RequestDfspHubCsrCertificatesAction { + return { + type: REQUEST_DFSP_HUB_CSRS_CERTIFICATES, + }; +} + +export function submitDfspHubCsrsCertificate({ + enrollmentId, +}: { + enrollmentId: number; +}): SubmitDfspHubCsrsCertificateAction { + return { + type: SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, + enrollmentId, + }; +} + +export function autogenerateDfspHubCsrsCertificate({ + enrollmentId, +}: { + enrollmentId: number; +}): AutogenerateDfspHubCsrsCertificateAction { + return { + type: AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, + enrollmentId, + }; +} + +export function downloadDfspHubCsrsCertificate({ + certificate, + cn, + extension, +}: { + certificate: string; + cn: string; + extension: string; +}): DownloadDfspHubCsrsCertificateAction { + return { + type: DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, + certificate, + cn, + extension, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/connectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/connectors.ts index f7ecc24..79d510d 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/connectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/connectors.ts @@ -1,53 +1,53 @@ -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { getDfspName } from 'App/ConnectionWizard/selectors'; -import { - requestDfspHubCsrsCertificates, - submitDfspHubCsrsCertificate, - autogenerateDfspHubCsrsCertificate, - downloadDfspHubCsrsCertificate, - showDfspHubCsrsCertificateModal, - hideDfspHubCsrsCertificateModal, -} from './actions'; -import { - getDfspHubCsrsError, - getDfspHubCsrsCertificates, - getDfspHubCsrsCertificateModalContent, - getDfspHubCsrsCertificateModalTitle, - getIsDfspHubCsrsCertificateModalVisible, - getIsDfspHubCsrsPending, - getIsDfspHubCsrCertificateSigningPendingByEnrollmentId, - getIsDfspHubCsrCertificateAutoSigningPendingByEnrollmentId, -} from './selectors'; - -const stateProps = (state: State) => ({ - dfspName: getDfspName(state), - error: getDfspHubCsrsError(state), - csrs: getDfspHubCsrsCertificates(state), - isCertificateModalVisible: getIsDfspHubCsrsCertificateModalVisible(state), - certificateModalContent: getDfspHubCsrsCertificateModalContent(state), - certificateModalTitle: getDfspHubCsrsCertificateModalTitle(state), - isPending: getIsDfspHubCsrsPending(state), - isCertificateSigningPendingByEnrollmentId: getIsDfspHubCsrCertificateSigningPendingByEnrollmentId( - state - ), - // eslint-disable-next-line max-len - isCertificateAutoSigningPendingByEnrollmentId: getIsDfspHubCsrCertificateAutoSigningPendingByEnrollmentId( - state - ), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(requestDfspHubCsrsCertificates()), - onSignCSRClick: (enrollmentId: number) => - dispatch(submitDfspHubCsrsCertificate({ enrollmentId })), - onCertificateViewClick: (certificate: string, title: string) => - dispatch(showDfspHubCsrsCertificateModal({ certificate, title })), - onCertificateDownloadClick: (certificate: string, cn: string, extension: string) => - dispatch(downloadDfspHubCsrsCertificate({ certificate, cn, extension })), - onCertificateModalCloseClick: () => dispatch(hideDfspHubCsrsCertificateModal()), - onAutoSignCSRClick: (enrollmentId: number) => - dispatch(autogenerateDfspHubCsrsCertificate({ enrollmentId })), -}); - -export default connect(stateProps, actionProps); +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { getDfspName } from 'App/ConnectionWizard/selectors'; +import { + requestDfspHubCsrsCertificates, + submitDfspHubCsrsCertificate, + autogenerateDfspHubCsrsCertificate, + downloadDfspHubCsrsCertificate, + showDfspHubCsrsCertificateModal, + hideDfspHubCsrsCertificateModal, +} from './actions'; +import { + getDfspHubCsrsError, + getDfspHubCsrsCertificates, + getDfspHubCsrsCertificateModalContent, + getDfspHubCsrsCertificateModalTitle, + getIsDfspHubCsrsCertificateModalVisible, + getIsDfspHubCsrsPending, + getIsDfspHubCsrCertificateSigningPendingByEnrollmentId, + getIsDfspHubCsrCertificateAutoSigningPendingByEnrollmentId, +} from './selectors'; + +const stateProps = (state: State) => ({ + dfspName: getDfspName(state), + error: getDfspHubCsrsError(state), + csrs: getDfspHubCsrsCertificates(state), + isCertificateModalVisible: getIsDfspHubCsrsCertificateModalVisible(state), + certificateModalContent: getDfspHubCsrsCertificateModalContent(state), + certificateModalTitle: getDfspHubCsrsCertificateModalTitle(state), + isPending: getIsDfspHubCsrsPending(state), + isCertificateSigningPendingByEnrollmentId: getIsDfspHubCsrCertificateSigningPendingByEnrollmentId( + state + ), + // eslint-disable-next-line max-len + isCertificateAutoSigningPendingByEnrollmentId: getIsDfspHubCsrCertificateAutoSigningPendingByEnrollmentId( + state + ), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(requestDfspHubCsrsCertificates()), + onSignCSRClick: (enrollmentId: number) => + dispatch(submitDfspHubCsrsCertificate({ enrollmentId })), + onCertificateViewClick: (certificate: string, title: string) => + dispatch(showDfspHubCsrsCertificateModal({ certificate, title })), + onCertificateDownloadClick: (certificate: string, cn: string, extension: string) => + dispatch(downloadDfspHubCsrsCertificate({ certificate, cn, extension })), + onCertificateModalCloseClick: () => dispatch(hideDfspHubCsrsCertificateModal()), + onAutoSignCSRClick: (enrollmentId: number) => + dispatch(autogenerateDfspHubCsrsCertificate({ enrollmentId })), +}); + +export default connect(stateProps, actionProps); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.css index edc8690..1c3dfd8 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.css @@ -1,8 +1,8 @@ -.dfsp-hub-csrs { - position: relative; -} - -.dfsp-hub-csrs__certificate-validation { - width: 400px; - margin-bottom: 10px; -} +.dfsp-hub-csrs { + position: relative; +} + +.dfsp-hub-csrs__certificate-validation { + width: 400px; + margin-bottom: 10px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.ts index f1f1ddf..fc61c50 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/index.ts @@ -1,9 +1,9 @@ -import HubCSRs from './HubCSRs'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default HubCSRs; -export { actions, reducer, selectors, types, sagas }; +import HubCSRs from './HubCSRs'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default HubCSRs; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/reducers.ts index d36131f..5da4c5f 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/reducers.ts @@ -1,61 +1,61 @@ -import { - RESET_DFSP_HUB_CSRS, - SET_DFSP_HUB_CSRS_CERTIFICATES, - SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR, - SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL, - HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL, - DfspHubCSRsActionTypes, - DfspHubCSRsState, -} from './types'; - -const initialState = { - dfspHubCsrsError: null, - dfspHubCsrsCertificates: [], - isDfspHubCsrsCertificateModalVisible: false, - dfspHubCsrsCertificateModalContent: undefined, - dfspHubCsrsCertificateModalTitle: undefined, -}; - -export default function dfspHubCsrReducer( - state = initialState, - action: DfspHubCSRsActionTypes -): DfspHubCSRsState { - switch (action.type) { - case RESET_DFSP_HUB_CSRS: { - return initialState; - } - case SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR: { - return { - ...state, - dfspHubCsrsError: action.error, - }; - } - case SET_DFSP_HUB_CSRS_CERTIFICATES: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - dfspHubCsrsCertificates: action.certificates || [], - }; - } - case SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL: { - return { - ...state, - isDfspHubCsrsCertificateModalVisible: true, - dfspHubCsrsCertificateModalContent: action.certificate, - dfspHubCsrsCertificateModalTitle: action.title, - }; - } - case HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL: { - return { - ...state, - isDfspHubCsrsCertificateModalVisible: false, - dfspHubCsrsCertificateModalContent: undefined, - dfspHubCsrsCertificateModalTitle: undefined, - }; - } - default: - return state; - } -} +import { + RESET_DFSP_HUB_CSRS, + SET_DFSP_HUB_CSRS_CERTIFICATES, + SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR, + SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL, + HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL, + DfspHubCSRsActionTypes, + DfspHubCSRsState, +} from './types'; + +const initialState = { + dfspHubCsrsError: null, + dfspHubCsrsCertificates: [], + isDfspHubCsrsCertificateModalVisible: false, + dfspHubCsrsCertificateModalContent: undefined, + dfspHubCsrsCertificateModalTitle: undefined, +}; + +export default function dfspHubCsrReducer( + state = initialState, + action: DfspHubCSRsActionTypes +): DfspHubCSRsState { + switch (action.type) { + case RESET_DFSP_HUB_CSRS: { + return initialState; + } + case SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR: { + return { + ...state, + dfspHubCsrsError: action.error, + }; + } + case SET_DFSP_HUB_CSRS_CERTIFICATES: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + dfspHubCsrsCertificates: action.certificates || [], + }; + } + case SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL: { + return { + ...state, + isDfspHubCsrsCertificateModalVisible: true, + dfspHubCsrsCertificateModalContent: action.certificate, + dfspHubCsrsCertificateModalTitle: action.title, + }; + } + case HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL: { + return { + ...state, + isDfspHubCsrsCertificateModalVisible: false, + dfspHubCsrsCertificateModalContent: undefined, + dfspHubCsrsCertificateModalTitle: undefined, + }; + } + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/sagas.ts index a104b72..5b90905 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/sagas.ts @@ -1,120 +1,120 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import apis from 'utils/apis'; -import { downloadFile, loadFile } from 'utils/html'; -import { is20x } from 'utils/http'; -import { isCertificate } from 'utils/certificate'; -import { showToast, showErrorModal } from 'App/actions'; -import { getEnvironmentId, getEnvironmentName } from 'App/ConnectionWizard/selectors'; -import { - SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, - AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, - DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, - REQUEST_DFSP_HUB_CSRS_CERTIFICATES, - SubmitDfspHubCsrsCertificateAction, - AutogenerateDfspHubCsrsCertificateAction, - DownloadDfspHubCsrsCertificateAction, - RequestDfspHubCsrCertificatesAction, -} from './types'; -import { setDfspHubCsrsCertificates, setDfspHubCsrsCertificatesError } from './actions'; - -export function* downloadDfspHubCsrCertificate(action: DownloadDfspHubCsrsCertificateAction) { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const filename = `${environmentName}-${action.cn}${action.extension}`; - yield call(downloadFile, action.certificate, filename); -} - -export function* DownloadHubCSRsCertificateSaga() { - yield takeLatest(DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, downloadDfspHubCsrCertificate); -} - -function* fetchDfspHubCSRs( - action: - | RequestDfspHubCsrCertificatesAction - | SubmitDfspHubCsrsCertificateAction - | AutogenerateDfspHubCsrsCertificateAction -) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.outboundEnrollments.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setDfspHubCsrsCertificates({ certificates: response.data })); - } else { - yield put(setDfspHubCsrsCertificatesError({ error: 'Error in fetching DFSP HUB CSRs' })); - } - } catch (e) { - yield put(setDfspHubCsrsCertificatesError({ error: e.message })); - } -} - -export function* RequestHubCSRSSaga() { - yield takeLatest(REQUEST_DFSP_HUB_CSRS_CERTIFICATES, fetchDfspHubCSRs); -} - -function* submitDfspHubCSRCertificate(action: SubmitDfspHubCsrsCertificateAction) { - let certificate = null; - let invalid = true; - try { - certificate = yield call(loadFile, '.cer'); - invalid = !isCertificate(certificate); - } catch (e) { - invalid = true; - } - - if (invalid) { - yield put(showErrorModal('The file selected is not a valid certificate')); - return; - } - - const state = yield select(); - const environmentId = getEnvironmentId(state); - const body = { certificate }; - try { - const response = yield call(apis.outboundEnrollmentCertificate.create, { - environmentId, - enrollmentId: action.enrollmentId, - body, - }); - if (!is20x(response.status)) { - yield put(showErrorModal('Error Submitting HUB CSR')); - } else { - yield put(showToast()); - } - yield call(fetchDfspHubCSRs, action); - } catch (e) { - yield put(showErrorModal(e.message)); - } -} - -export function* SubmitCSRSSaga() { - yield takeLatest(SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, submitDfspHubCSRCertificate); -} - -function* autogenerateDfspHubCSRCertificate(action: AutogenerateDfspHubCsrsCertificateAction) { - const state = yield select(); - const environmentId = getEnvironmentId(state); - try { - const response = yield call(apis.outboundEnrollmentCertificate.create, { - environmentId, - enrollmentId: action.enrollmentId, - }); - if (!is20x(response.status)) { - yield put(showErrorModal('Error Auto Generating HUB CSR')); - } else { - yield put(showToast()); - } - yield call(fetchDfspHubCSRs, action); - } catch (e) { - yield put(showErrorModal(e.message)); - } -} - -export function* AutogenerateCSRSSaga() { - yield takeLatest(AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, autogenerateDfspHubCSRCertificate); -} - -export default function* rootSaga() { - yield all([DownloadHubCSRsCertificateSaga(), RequestHubCSRSSaga(), AutogenerateCSRSSaga()]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import apis from 'utils/apis'; +import { downloadFile, loadFile } from 'utils/html'; +import { is20x } from 'utils/http'; +import { isCertificate } from 'utils/certificate'; +import { showToast, showErrorModal } from 'App/actions'; +import { getEnvironmentId, getEnvironmentName } from 'App/ConnectionWizard/selectors'; +import { + SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, + AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, + DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, + REQUEST_DFSP_HUB_CSRS_CERTIFICATES, + SubmitDfspHubCsrsCertificateAction, + AutogenerateDfspHubCsrsCertificateAction, + DownloadDfspHubCsrsCertificateAction, + RequestDfspHubCsrCertificatesAction, +} from './types'; +import { setDfspHubCsrsCertificates, setDfspHubCsrsCertificatesError } from './actions'; + +export function* downloadDfspHubCsrCertificate(action: DownloadDfspHubCsrsCertificateAction) { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const filename = `${environmentName}-${action.cn}${action.extension}`; + yield call(downloadFile, action.certificate, filename); +} + +export function* DownloadHubCSRsCertificateSaga() { + yield takeLatest(DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE, downloadDfspHubCsrCertificate); +} + +function* fetchDfspHubCSRs( + action: + | RequestDfspHubCsrCertificatesAction + | SubmitDfspHubCsrsCertificateAction + | AutogenerateDfspHubCsrsCertificateAction +) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.outboundEnrollments.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setDfspHubCsrsCertificates({ certificates: response.data })); + } else { + yield put(setDfspHubCsrsCertificatesError({ error: 'Error in fetching DFSP HUB CSRs' })); + } + } catch (e) { + yield put(setDfspHubCsrsCertificatesError({ error: e.message })); + } +} + +export function* RequestHubCSRSSaga() { + yield takeLatest(REQUEST_DFSP_HUB_CSRS_CERTIFICATES, fetchDfspHubCSRs); +} + +function* submitDfspHubCSRCertificate(action: SubmitDfspHubCsrsCertificateAction) { + let certificate = null; + let invalid = true; + try { + certificate = yield call(loadFile, '.cer'); + invalid = !isCertificate(certificate); + } catch (e) { + invalid = true; + } + + if (invalid) { + yield put(showErrorModal('The file selected is not a valid certificate')); + return; + } + + const state = yield select(); + const environmentId = getEnvironmentId(state); + const body = { certificate }; + try { + const response = yield call(apis.outboundEnrollmentCertificate.create, { + environmentId, + enrollmentId: action.enrollmentId, + body, + }); + if (!is20x(response.status)) { + yield put(showErrorModal('Error Submitting HUB CSR')); + } else { + yield put(showToast()); + } + yield call(fetchDfspHubCSRs, action); + } catch (e) { + yield put(showErrorModal(e.message)); + } +} + +export function* SubmitCSRSSaga() { + yield takeLatest(SUBMIT_DFSP_HUB_CSRS_CERTIFICATE, submitDfspHubCSRCertificate); +} + +function* autogenerateDfspHubCSRCertificate(action: AutogenerateDfspHubCsrsCertificateAction) { + const state = yield select(); + const environmentId = getEnvironmentId(state); + try { + const response = yield call(apis.outboundEnrollmentCertificate.create, { + environmentId, + enrollmentId: action.enrollmentId, + }); + if (!is20x(response.status)) { + yield put(showErrorModal('Error Auto Generating HUB CSR')); + } else { + yield put(showToast()); + } + yield call(fetchDfspHubCSRs, action); + } catch (e) { + yield put(showErrorModal(e.message)); + } +} + +export function* AutogenerateCSRSSaga() { + yield takeLatest(AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE, autogenerateDfspHubCSRCertificate); +} + +export default function* rootSaga() { + yield all([DownloadHubCSRsCertificateSaga(), RequestHubCSRSSaga(), AutogenerateCSRSSaga()]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/selectors.ts index be0dcba..5969fc6 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/selectors.ts @@ -1,76 +1,76 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import { States } from '../types'; - -export const getDfspHubCsrsError = (state: State) => - state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsError; -export const getDfspHubCsrsCertificates = (state: State) => - state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsCertificates; -export const getIsDfspHubCsrsCertificateModalVisible = (state: State) => - state.wizard.environment.tls.tlsclient.hub.isDfspHubCsrsCertificateModalVisible; -export const getDfspHubCsrsCertificateModalContent = (state: State) => - state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsCertificateModalContent; -export const getDfspHubCsrsCertificateModalTitle = (state: State) => - state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsCertificateModalTitle; - -export const getDfspHasUnsignedHubCsrs = createSelector( - getDfspHubCsrsCertificates, - (csrs) => csrs.filter((csr) => States.CSR_LOADED === csr.state).length > 0 -); - -export const getIsDfspHubCsrsPending = createSelector( - (state: State) => state.api, - isPending('outboundEnrollments.read') -); -// export const getDfspHubCsrCertificateSigningPendingCollection = createPendingCollectionSelector( -// 'outboundEnrollmentCertificate.create' -// ); - -export const getIsDfspHubCsrCertificateSigningPendingByEnrollmentId = createSelector( - (state: State) => state.api, - (api) => { - return { - 1: isPending('outboundEnrollmentCertificate.create')(api), - 2: false, - }; - } - // getDfspHubCsrsCertificates, - // getDfspHubCsrCertificateSigningPendingCollection, - // (csrs, collection) => { - // const getByCsrId = getPendingByParameter('enrollmentId'); - // return csrs - // .map((csr) => csr.id) - // .reduce( - // (prev, id) => ({ - // ...prev, - // [id]: getByCsrId(collection, id), - // }), - // {} - // ); - // } -); - -export const getIsDfspHubCsrCertificateAutoSigningPendingByEnrollmentId = createSelector( - (state: State) => state.api, - (api) => { - return { - 1: isPending('outboundEnrollmentAutoCertificate.create')(api), - 2: false, - }; - } - // getDfspHubCsrsCertificates, - // getDfspHubCsrCertificateSigningPendingCollection, - // (csrs, collection) => { - // const getByCsrId = getPendingByParameter('enrollmentId'); - // return csrs - // .map((csr) => csr.id) - // .reduce( - // (prev, id) => ({ - // ...prev, - // [id]: getByCsrId(collection, id), - // }), - // {} - // ); - // } -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import { States } from '../types'; + +export const getDfspHubCsrsError = (state: State) => + state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsError; +export const getDfspHubCsrsCertificates = (state: State) => + state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsCertificates; +export const getIsDfspHubCsrsCertificateModalVisible = (state: State) => + state.wizard.environment.tls.tlsclient.hub.isDfspHubCsrsCertificateModalVisible; +export const getDfspHubCsrsCertificateModalContent = (state: State) => + state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsCertificateModalContent; +export const getDfspHubCsrsCertificateModalTitle = (state: State) => + state.wizard.environment.tls.tlsclient.hub.dfspHubCsrsCertificateModalTitle; + +export const getDfspHasUnsignedHubCsrs = createSelector( + getDfspHubCsrsCertificates, + (csrs) => csrs.filter((csr) => States.CSR_LOADED === csr.state).length > 0 +); + +export const getIsDfspHubCsrsPending = createSelector( + (state: State) => state.api, + isPending('outboundEnrollments.read') +); +// export const getDfspHubCsrCertificateSigningPendingCollection = createPendingCollectionSelector( +// 'outboundEnrollmentCertificate.create' +// ); + +export const getIsDfspHubCsrCertificateSigningPendingByEnrollmentId = createSelector( + (state: State) => state.api, + (api) => { + return { + 1: isPending('outboundEnrollmentCertificate.create')(api), + 2: false, + }; + } + // getDfspHubCsrsCertificates, + // getDfspHubCsrCertificateSigningPendingCollection, + // (csrs, collection) => { + // const getByCsrId = getPendingByParameter('enrollmentId'); + // return csrs + // .map((csr) => csr.id) + // .reduce( + // (prev, id) => ({ + // ...prev, + // [id]: getByCsrId(collection, id), + // }), + // {} + // ); + // } +); + +export const getIsDfspHubCsrCertificateAutoSigningPendingByEnrollmentId = createSelector( + (state: State) => state.api, + (api) => { + return { + 1: isPending('outboundEnrollmentAutoCertificate.create')(api), + 2: false, + }; + } + // getDfspHubCsrsCertificates, + // getDfspHubCsrCertificateSigningPendingCollection, + // (csrs, collection) => { + // const getByCsrId = getPendingByParameter('enrollmentId'); + // return csrs + // .map((csr) => csr.id) + // .reduce( + // (prev, id) => ({ + // ...prev, + // [id]: getByCsrId(collection, id), + // }), + // {} + // ); + // } +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/types.ts index 46b18ab..513505e 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/HubCSRs/types.ts @@ -1,73 +1,73 @@ -import { ErrorMessage } from 'App/types'; -import { CSR } from '../types'; - -export const RESET_DFSP_HUB_CSRS = 'DFSP HUB CSRs / Reset'; -export const SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR = 'DFSP HUB CSRs / Set Root Cert Error'; -export const SET_DFSP_HUB_CSRS_CERTIFICATES = 'DFSP HUB CSRs / Set Certificates'; -export const SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL = 'DFSP HUB CSRs / Show Certificate Modal'; -export const HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL = 'DFSP HUB CSRs / Hide Certificate Modal'; -export const SUBMIT_DFSP_HUB_CSRS_CERTIFICATE = 'DFSP HUB CSRs / Submit Certificate'; -export const AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE = 'DFSP HUB CSRs / Autogenerate Certificate'; -export const REQUEST_DFSP_HUB_CSRS_CERTIFICATES = 'DFSP HUB CSRs / Request CSR Certificates'; -export const DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE = 'DFSP HUB CSRs / Download Certificate'; - -export enum ValidationStates { - VALID = 'VALID', - INVALID = 'INVALID', -} - -export interface DfspHubCSRsState { - dfspHubCsrsError: ErrorMessage; - dfspHubCsrsCertificates: CSR[]; - isDfspHubCsrsCertificateModalVisible: boolean; - dfspHubCsrsCertificateModalContent?: string; - dfspHubCsrsCertificateModalTitle?: string; -} - -export interface ResetDfspHubCsrsAction { - type: typeof RESET_DFSP_HUB_CSRS; -} -export interface SetDfspHubCsrsCertificatesErrorAction { - type: typeof SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR; - error: string; -} -export interface SetDfspHubCsrsCertificatesAction { - type: typeof SET_DFSP_HUB_CSRS_CERTIFICATES; - certificates: CSR[]; -} -export interface ShowDfspHubCsrsCertificateModalAction { - type: typeof SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL; - certificate: string; - title: string; -} -export interface HideDfspHubCsrsCertificateModalAction { - type: typeof HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL; -} - -export interface SubmitDfspHubCsrsCertificateAction { - type: typeof SUBMIT_DFSP_HUB_CSRS_CERTIFICATE; - enrollmentId: number; -} - -export interface AutogenerateDfspHubCsrsCertificateAction { - type: typeof AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE; - enrollmentId: number; -} - -export interface DownloadDfspHubCsrsCertificateAction { - type: typeof DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE; - certificate: string; - cn: string; - extension: string; -} - -export interface RequestDfspHubCsrCertificatesAction { - type: typeof REQUEST_DFSP_HUB_CSRS_CERTIFICATES; -} - -export type DfspHubCSRsActionTypes = - | ResetDfspHubCsrsAction - | SetDfspHubCsrsCertificatesErrorAction - | SetDfspHubCsrsCertificatesAction - | ShowDfspHubCsrsCertificateModalAction - | HideDfspHubCsrsCertificateModalAction; +import { ErrorMessage } from 'App/types'; +import { CSR } from '../types'; + +export const RESET_DFSP_HUB_CSRS = 'DFSP HUB CSRs / Reset'; +export const SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR = 'DFSP HUB CSRs / Set Root Cert Error'; +export const SET_DFSP_HUB_CSRS_CERTIFICATES = 'DFSP HUB CSRs / Set Certificates'; +export const SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL = 'DFSP HUB CSRs / Show Certificate Modal'; +export const HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL = 'DFSP HUB CSRs / Hide Certificate Modal'; +export const SUBMIT_DFSP_HUB_CSRS_CERTIFICATE = 'DFSP HUB CSRs / Submit Certificate'; +export const AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE = 'DFSP HUB CSRs / Autogenerate Certificate'; +export const REQUEST_DFSP_HUB_CSRS_CERTIFICATES = 'DFSP HUB CSRs / Request CSR Certificates'; +export const DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE = 'DFSP HUB CSRs / Download Certificate'; + +export enum ValidationStates { + VALID = 'VALID', + INVALID = 'INVALID', +} + +export interface DfspHubCSRsState { + dfspHubCsrsError: ErrorMessage; + dfspHubCsrsCertificates: CSR[]; + isDfspHubCsrsCertificateModalVisible: boolean; + dfspHubCsrsCertificateModalContent?: string; + dfspHubCsrsCertificateModalTitle?: string; +} + +export interface ResetDfspHubCsrsAction { + type: typeof RESET_DFSP_HUB_CSRS; +} +export interface SetDfspHubCsrsCertificatesErrorAction { + type: typeof SET_DFSP_HUB_CSRS_CERTIFICATES_ERROR; + error: string; +} +export interface SetDfspHubCsrsCertificatesAction { + type: typeof SET_DFSP_HUB_CSRS_CERTIFICATES; + certificates: CSR[]; +} +export interface ShowDfspHubCsrsCertificateModalAction { + type: typeof SHOW_DFSP_HUB_CSRS_CERTIFICATE_MODAL; + certificate: string; + title: string; +} +export interface HideDfspHubCsrsCertificateModalAction { + type: typeof HIDE_DFSP_HUB_CSRS_CERTIFICATE_MODAL; +} + +export interface SubmitDfspHubCsrsCertificateAction { + type: typeof SUBMIT_DFSP_HUB_CSRS_CERTIFICATE; + enrollmentId: number; +} + +export interface AutogenerateDfspHubCsrsCertificateAction { + type: typeof AUTOGENERATE_DFSP_HUB_CSRS_CERTIFICATE; + enrollmentId: number; +} + +export interface DownloadDfspHubCsrsCertificateAction { + type: typeof DOWNLOAD_DFSP_HUB_CSRS_CERTIFICATE; + certificate: string; + cn: string; + extension: string; +} + +export interface RequestDfspHubCsrCertificatesAction { + type: typeof REQUEST_DFSP_HUB_CSRS_CERTIFICATES; +} + +export type DfspHubCSRsActionTypes = + | ResetDfspHubCsrsAction + | SetDfspHubCsrsCertificatesErrorAction + | SetDfspHubCsrsCertificatesAction + | ShowDfspHubCsrsCertificateModalAction + | HideDfspHubCsrsCertificateModalAction; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/SentCSRs.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/SentCSRs.tsx index 5e798a8..314c854 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/SentCSRs.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/SentCSRs.tsx @@ -1,232 +1,232 @@ -import React, { FC } from 'react'; -import { - AnimateFadeIn, - CertificateCard, - CertificateModal, - CertificateInfo, - CertificateValidation, - MessageBox, - Status, - Spinner, - TextField, -} from 'components'; -import { ErrorMessage, CertificateValidationResults, CertInfo } from 'App/types'; -import { withMount } from 'utils/hocs'; -import connectors from './connectors'; -import { ExternalCA, CSR, CSRInfo } from '../types'; - -import './index.css'; - -interface SentCSRsProps { - dfspName: string; - error: ErrorMessage; - csrs: CSR[]; - filter: string; - certificateModalContent?: string; - certificateModalTitle?: string; - isCertificateModalVisible: boolean; - isDfspSentCsrsPending: boolean; - onFilterChange: () => void; - onCertificateViewClick: () => void; - onCertificateDownloadClick: () => void; - onCertificateModalCloseClick: () => void; -} - -const SentCSRs: FC = ({ - error, - csrs, - filter, - isCertificateModalVisible, - certificateModalContent, - certificateModalTitle, - isDfspSentCsrsPending, - onFilterChange, - onCertificateViewClick, - onCertificateDownloadClick, - onCertificateModalCloseClick, -}) => { - if (error) { - return ( - - ); - } - return ( -
-
- -
- - - - {isCertificateModalVisible && ( - - )} -
- ); -}; - -interface FilteredSentCSRSProps { - isPending: boolean; - csrs: CSR[]; - onCertificateViewClick: (file: string, extension: string) => void; - onCertificateDownloadClick: (file: string, extension: string) => void; -} -const FilteredSentCSRS: FC = ({ - isPending, - csrs, - onCertificateViewClick, - onCertificateDownloadClick, -}) => { - if (!csrs.length) { - return ( - - ); - } - if (isPending) { - return ; - } - return ( - - {csrs.map( - ( - { certificate, csr, csrInfo, certInfo, state, validations, validationState, externalCa }, - index - ) => ( - onCertificateViewClick(csr, 'CSR')} - onDownloadClick={() => onCertificateDownloadClick(csr, '.csr')} - onViewSignedClick={() => onCertificateViewClick(certificate, 'Certificate')} - onDownloadSignedClick={() => onCertificateDownloadClick(certificate, '.cer')} - /> - ) - )} - - ); -}; - -interface SentCSRProps { - certificate?: string; - csr: string; - csrInfo: CSRInfo; - certInfo?: CertInfo; - state: string; - validations: CertificateValidationResults[]; - validationState: string; - externalCa?: ExternalCA; - onViewClick: () => void; - onDownloadClick: () => void; - onViewSignedClick: () => void; - onDownloadSignedClick: () => void; -} - -const SentCSR: FC = ({ - certificate, - csr, - csrInfo, - certInfo, - state, - validations, - validationState, - externalCa, - onViewClick, - onDownloadClick, - onViewSignedClick, - onDownloadSignedClick, -}) => ( - - - - - {csrInfo.subject.CN || 'Common Name'} - - - - - - -
- -
- -
- - - - - - - {externalCa && ( - - - Signed with external CA {externalCa.name} - - - )} - -
-); - -const MountedSentCSRs = withMount(SentCSRs, 'onMount'); - -export default connectors(MountedSentCSRs); +import React, { FC } from 'react'; +import { + AnimateFadeIn, + CertificateCard, + CertificateModal, + CertificateInfo, + CertificateValidation, + MessageBox, + Status, + Spinner, + TextField, +} from 'components'; +import { ErrorMessage, CertificateValidationResults, CertInfo } from 'App/types'; +import { withMount } from 'utils/hocs'; +import connectors from './connectors'; +import { ExternalCA, CSR, CSRInfo } from '../types'; + +import './index.css'; + +interface SentCSRsProps { + dfspName: string; + error: ErrorMessage; + csrs: CSR[]; + filter: string; + certificateModalContent?: string; + certificateModalTitle?: string; + isCertificateModalVisible: boolean; + isDfspSentCsrsPending: boolean; + onFilterChange: () => void; + onCertificateViewClick: () => void; + onCertificateDownloadClick: () => void; + onCertificateModalCloseClick: () => void; +} + +const SentCSRs: FC = ({ + error, + csrs, + filter, + isCertificateModalVisible, + certificateModalContent, + certificateModalTitle, + isDfspSentCsrsPending, + onFilterChange, + onCertificateViewClick, + onCertificateDownloadClick, + onCertificateModalCloseClick, +}) => { + if (error) { + return ( + + ); + } + return ( +
+
+ +
+ + + + {isCertificateModalVisible && ( + + )} +
+ ); +}; + +interface FilteredSentCSRSProps { + isPending: boolean; + csrs: CSR[]; + onCertificateViewClick: (file: string, extension: string) => void; + onCertificateDownloadClick: (file: string, extension: string) => void; +} +const FilteredSentCSRS: FC = ({ + isPending, + csrs, + onCertificateViewClick, + onCertificateDownloadClick, +}) => { + if (!csrs.length) { + return ( + + ); + } + if (isPending) { + return ; + } + return ( + + {csrs.map( + ( + { certificate, csr, csrInfo, certInfo, state, validations, validationState, externalCa }, + index + ) => ( + onCertificateViewClick(csr, 'CSR')} + onDownloadClick={() => onCertificateDownloadClick(csr, '.csr')} + onViewSignedClick={() => onCertificateViewClick(certificate, 'Certificate')} + onDownloadSignedClick={() => onCertificateDownloadClick(certificate, '.cer')} + /> + ) + )} + + ); +}; + +interface SentCSRProps { + certificate?: string; + csr: string; + csrInfo: CSRInfo; + certInfo?: CertInfo; + state: string; + validations: CertificateValidationResults[]; + validationState: string; + externalCa?: ExternalCA; + onViewClick: () => void; + onDownloadClick: () => void; + onViewSignedClick: () => void; + onDownloadSignedClick: () => void; +} + +const SentCSR: FC = ({ + certificate, + csr, + csrInfo, + certInfo, + state, + validations, + validationState, + externalCa, + onViewClick, + onDownloadClick, + onViewSignedClick, + onDownloadSignedClick, +}) => ( + + + + + {csrInfo.subject.CN || 'Common Name'} + + + + + + +
+ +
+ +
+ + + + + + + {externalCa && ( + + + Signed with external CA {externalCa.name} + + + )} + +
+); + +const MountedSentCSRs = withMount(SentCSRs, 'onMount'); + +export default connectors(MountedSentCSRs); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/_mockData.js index 88ae6d1..ac158c7 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/_mockData.js @@ -1,72 +1,72 @@ -// CSR_CERT_SAME_PUBLIC_KEY -// CSR_CERT_SAME_SUBJECT_INFO - -const Validation = { - validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', - performed: true, - result: 'VALID', - message: 'It worked', - messageTemplate: - 'Textual description of the validation result, using the JavaScript template literal format', - data: {}, - details: 'string', -}; -const CSRInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - extensions: { - subjectAltName: { - dns: ['dns1', 'dns2'], - ips: ['163.10.5.24'], - emailAddresses: ['pki@modusbox.live'], - uris: ['http://modusbox.live'], - }, - }, -}; - -const CertInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - issuer: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - subjectAlternativeNames: ['alt1', 'alt2'], - serialNumber: '17159976289428250189079625547205715159', - notBefore: '2019-02-04T00:00:00Z', - notAfter: '2020-02-12T12:00:00Z', - signatureAlgorithm: 'SHA256WithRSA', -}; - -export const inboundEnrollments = [ - { - id: 1, - certificate: 'string', - csr: 'string', - state: 'CSR_LOADED', - certInfo: CertInfo, - csrInfo: CSRInfo, - hubCAId: 1, - validations: [Validation], - validationState: 'VALID', - }, -]; +// CSR_CERT_SAME_PUBLIC_KEY +// CSR_CERT_SAME_SUBJECT_INFO + +const Validation = { + validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', + performed: true, + result: 'VALID', + message: 'It worked', + messageTemplate: + 'Textual description of the validation result, using the JavaScript template literal format', + data: {}, + details: 'string', +}; +const CSRInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + extensions: { + subjectAltName: { + dns: ['dns1', 'dns2'], + ips: ['163.10.5.24'], + emailAddresses: ['pki@modusbox.live'], + uris: ['http://modusbox.live'], + }, + }, +}; + +const CertInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + issuer: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + subjectAlternativeNames: ['alt1', 'alt2'], + serialNumber: '17159976289428250189079625547205715159', + notBefore: '2019-02-04T00:00:00Z', + notAfter: '2020-02-12T12:00:00Z', + signatureAlgorithm: 'SHA256WithRSA', +}; + +export const inboundEnrollments = [ + { + id: 1, + certificate: 'string', + csr: 'string', + state: 'CSR_LOADED', + certInfo: CertInfo, + csrInfo: CSRInfo, + hubCAId: 1, + validations: [Validation], + validationState: 'VALID', + }, +]; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/actions.ts index f807d5a..5b6fe9d 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/actions.ts @@ -1,94 +1,94 @@ -import { - RESET_DFSP_SENT_CSRS, - SET_DFSP_SENT_CSRS_FILTER, - SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR, - SET_DFSP_SENT_CSRS_CERTIFICATES, - SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL, - HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL, - REQUEST_DFSP_SENT_CSR_CERTIFICATE, - DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, - ResetDfspSentCsrsAction, - SetDfspSentCsrsCertificatesErrorAction, - SetDfspSentCsrsFilterAction, - SetDfspSentCsrsCertificatesAction, - ShowDfspSentCsrsCertificateModalAction, - HideDfspSentCsrsCertificateModalAction, - RequestDfspSentCsrCertificateAction, - DownloadDfspSentCsrCertificateAction, -} from './types'; -import { CSR } from '../types'; - -export function resetDfspSentCsrs(): ResetDfspSentCsrsAction { - return { - type: RESET_DFSP_SENT_CSRS, - }; -} - -export function setDfspSentCsrsCertificatesError({ - error, -}: { - error: string; -}): SetDfspSentCsrsCertificatesErrorAction { - return { - type: SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR, - error, - }; -} - -export function setDfspSentCsrsFilter({ filter }: { filter: string }): SetDfspSentCsrsFilterAction { - return { - type: SET_DFSP_SENT_CSRS_FILTER, - filter, - }; -} - -export function setDfspSentCsrsCertificates({ - certificates, -}: { - certificates: CSR[]; -}): SetDfspSentCsrsCertificatesAction { - return { - type: SET_DFSP_SENT_CSRS_CERTIFICATES, - certificates, - }; -} - -export function showDfspSentCsrsCertificateModal({ - certificate, - title, -}: { - certificate: string; - title: string; -}): ShowDfspSentCsrsCertificateModalAction { - return { - type: SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL, - certificate, - title, - }; -} - -export function hideDfspSentCsrsCertificateModal(): HideDfspSentCsrsCertificateModalAction { - return { - type: HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL, - }; -} - -export function downloadDfspSentCsrCertificate({ - certificate, - extension, -}: { - certificate: string; - extension: string; -}): DownloadDfspSentCsrCertificateAction { - return { - type: DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, - certificate, - extension, - }; -} - -export function requestDfspSentCsrs(): RequestDfspSentCsrCertificateAction { - return { - type: REQUEST_DFSP_SENT_CSR_CERTIFICATE, - }; -} +import { + RESET_DFSP_SENT_CSRS, + SET_DFSP_SENT_CSRS_FILTER, + SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR, + SET_DFSP_SENT_CSRS_CERTIFICATES, + SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL, + HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL, + REQUEST_DFSP_SENT_CSR_CERTIFICATE, + DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, + ResetDfspSentCsrsAction, + SetDfspSentCsrsCertificatesErrorAction, + SetDfspSentCsrsFilterAction, + SetDfspSentCsrsCertificatesAction, + ShowDfspSentCsrsCertificateModalAction, + HideDfspSentCsrsCertificateModalAction, + RequestDfspSentCsrCertificateAction, + DownloadDfspSentCsrCertificateAction, +} from './types'; +import { CSR } from '../types'; + +export function resetDfspSentCsrs(): ResetDfspSentCsrsAction { + return { + type: RESET_DFSP_SENT_CSRS, + }; +} + +export function setDfspSentCsrsCertificatesError({ + error, +}: { + error: string; +}): SetDfspSentCsrsCertificatesErrorAction { + return { + type: SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR, + error, + }; +} + +export function setDfspSentCsrsFilter({ filter }: { filter: string }): SetDfspSentCsrsFilterAction { + return { + type: SET_DFSP_SENT_CSRS_FILTER, + filter, + }; +} + +export function setDfspSentCsrsCertificates({ + certificates, +}: { + certificates: CSR[]; +}): SetDfspSentCsrsCertificatesAction { + return { + type: SET_DFSP_SENT_CSRS_CERTIFICATES, + certificates, + }; +} + +export function showDfspSentCsrsCertificateModal({ + certificate, + title, +}: { + certificate: string; + title: string; +}): ShowDfspSentCsrsCertificateModalAction { + return { + type: SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL, + certificate, + title, + }; +} + +export function hideDfspSentCsrsCertificateModal(): HideDfspSentCsrsCertificateModalAction { + return { + type: HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL, + }; +} + +export function downloadDfspSentCsrCertificate({ + certificate, + extension, +}: { + certificate: string; + extension: string; +}): DownloadDfspSentCsrCertificateAction { + return { + type: DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, + certificate, + extension, + }; +} + +export function requestDfspSentCsrs(): RequestDfspSentCsrCertificateAction { + return { + type: REQUEST_DFSP_SENT_CSR_CERTIFICATE, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/connectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/connectors.ts index 7f4ff3a..27f6bfb 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/connectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/connectors.ts @@ -1,42 +1,42 @@ -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { getDfspName } from 'App/ConnectionWizard/selectors'; -import { - requestDfspSentCsrs, - setDfspSentCsrsFilter, - downloadDfspSentCsrCertificate, - showDfspSentCsrsCertificateModal, - hideDfspSentCsrsCertificateModal, -} from './actions'; -import { - getDfspSentCsrsError, - getDfspSentCsrsFilter, - getFilteredDfspSentCsrsCertificates, - getDfspSentCsrsCertificateModalContent, - getDfspSentCsrsCertificateModalTitle, - getIsDfspSentCsrsCertificateModalVisible, - getIsDfspSentCsrsPending, -} from './selectors'; - -const stateProps = (state: State) => ({ - dfspName: getDfspName(state), - error: getDfspSentCsrsError(state), - csrs: getFilteredDfspSentCsrsCertificates(state), - filter: getDfspSentCsrsFilter(state), - certificateModalContent: getDfspSentCsrsCertificateModalContent(state), - certificateModalTitle: getDfspSentCsrsCertificateModalTitle(state), - isCertificateModalVisible: getIsDfspSentCsrsCertificateModalVisible(state), - isDfspSentCsrsPending: getIsDfspSentCsrsPending(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(requestDfspSentCsrs()), - onFilterChange: (filter: string) => dispatch(setDfspSentCsrsFilter({ filter })), - onCertificateViewClick: (certificate: string, title: string) => - dispatch(showDfspSentCsrsCertificateModal({ certificate, title })), - onCertificateDownloadClick: (certificate: string, extension: string) => - dispatch(downloadDfspSentCsrCertificate({ certificate, extension })), - onCertificateModalCloseClick: () => dispatch(hideDfspSentCsrsCertificateModal()), -}); - -export default connect(stateProps, actionProps); +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { getDfspName } from 'App/ConnectionWizard/selectors'; +import { + requestDfspSentCsrs, + setDfspSentCsrsFilter, + downloadDfspSentCsrCertificate, + showDfspSentCsrsCertificateModal, + hideDfspSentCsrsCertificateModal, +} from './actions'; +import { + getDfspSentCsrsError, + getDfspSentCsrsFilter, + getFilteredDfspSentCsrsCertificates, + getDfspSentCsrsCertificateModalContent, + getDfspSentCsrsCertificateModalTitle, + getIsDfspSentCsrsCertificateModalVisible, + getIsDfspSentCsrsPending, +} from './selectors'; + +const stateProps = (state: State) => ({ + dfspName: getDfspName(state), + error: getDfspSentCsrsError(state), + csrs: getFilteredDfspSentCsrsCertificates(state), + filter: getDfspSentCsrsFilter(state), + certificateModalContent: getDfspSentCsrsCertificateModalContent(state), + certificateModalTitle: getDfspSentCsrsCertificateModalTitle(state), + isCertificateModalVisible: getIsDfspSentCsrsCertificateModalVisible(state), + isDfspSentCsrsPending: getIsDfspSentCsrsPending(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(requestDfspSentCsrs()), + onFilterChange: (filter: string) => dispatch(setDfspSentCsrsFilter({ filter })), + onCertificateViewClick: (certificate: string, title: string) => + dispatch(showDfspSentCsrsCertificateModal({ certificate, title })), + onCertificateDownloadClick: (certificate: string, extension: string) => + dispatch(downloadDfspSentCsrCertificate({ certificate, extension })), + onCertificateModalCloseClick: () => dispatch(hideDfspSentCsrsCertificateModal()), +}); + +export default connect(stateProps, actionProps); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.css index d65357a..b334df4 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.css @@ -1,19 +1,19 @@ -.dfsp-sent-csrs { -} -.dfsp-sent-csrs__filter { - margin-bottom: 20px; -} - -.dfsp-sent-csrs__certificate-validation { - width: 400px; - margin-bottom: 10px; -} - -.dfsp-sent-csrs__external-ca__message-box { - margin: 0px; - width: auto; -} - -.dfsp-sent-csrs__external-ca__message-box .message-box__icon { - margin: 0px; -} +.dfsp-sent-csrs { +} +.dfsp-sent-csrs__filter { + margin-bottom: 20px; +} + +.dfsp-sent-csrs__certificate-validation { + width: 400px; + margin-bottom: 10px; +} + +.dfsp-sent-csrs__external-ca__message-box { + margin: 0px; + width: auto; +} + +.dfsp-sent-csrs__external-ca__message-box .message-box__icon { + margin: 0px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.ts index 81849d4..6ce8546 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/index.ts @@ -1,9 +1,9 @@ -import SentCSRs from './SentCSRs'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default SentCSRs; -export { actions, reducer, selectors, types, sagas }; +import SentCSRs from './SentCSRs'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default SentCSRs; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/reducers.ts index 6216634..12fd575 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/reducers.ts @@ -1,66 +1,66 @@ -import { - RESET_DFSP_SENT_CSRS, - SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR, - SET_DFSP_SENT_CSRS_FILTER, - SET_DFSP_SENT_CSRS_CERTIFICATES, - SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL, - HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL, - DfspSentCSRsActionTypes, - SentCSRsState, -} from './types'; - -const initialState = { - dfspSentCsrsError: null, - dfspSentCsrsFilter: '', - dfspSentCsrsCertificates: [], - isDfspSentCsrsCertificateModalVisible: false, - dfspSentCsrsCertificateModalContent: undefined, - dfspSentCsrsCertificateModalTitle: undefined, -}; - -export default function dfspSentCsrsReducer( - state = initialState, - action: DfspSentCSRsActionTypes -): SentCSRsState { - switch (action.type) { - case RESET_DFSP_SENT_CSRS: { - return initialState; - } - case SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR: { - return { - ...state, - dfspSentCsrsError: action.error, - }; - } - case SET_DFSP_SENT_CSRS_FILTER: { - return { - ...state, - dfspSentCsrsFilter: action.filter || '', - }; - } - case SET_DFSP_SENT_CSRS_CERTIFICATES: { - return { - ...state, - dfspSentCsrsCertificates: action.certificates || initialState.dfspSentCsrsCertificates, - }; - } - case SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL: { - return { - ...state, - isDfspSentCsrsCertificateModalVisible: true, - dfspSentCsrsCertificateModalContent: action.certificate, - dfspSentCsrsCertificateModalTitle: action.title, - }; - } - case HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL: { - return { - ...state, - isDfspSentCsrsCertificateModalVisible: false, - dfspSentCsrsCertificateModalContent: undefined, - dfspSentCsrsCertificateModalTitle: undefined, - }; - } - default: - return state; - } -} +import { + RESET_DFSP_SENT_CSRS, + SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR, + SET_DFSP_SENT_CSRS_FILTER, + SET_DFSP_SENT_CSRS_CERTIFICATES, + SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL, + HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL, + DfspSentCSRsActionTypes, + SentCSRsState, +} from './types'; + +const initialState = { + dfspSentCsrsError: null, + dfspSentCsrsFilter: '', + dfspSentCsrsCertificates: [], + isDfspSentCsrsCertificateModalVisible: false, + dfspSentCsrsCertificateModalContent: undefined, + dfspSentCsrsCertificateModalTitle: undefined, +}; + +export default function dfspSentCsrsReducer( + state = initialState, + action: DfspSentCSRsActionTypes +): SentCSRsState { + switch (action.type) { + case RESET_DFSP_SENT_CSRS: { + return initialState; + } + case SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR: { + return { + ...state, + dfspSentCsrsError: action.error, + }; + } + case SET_DFSP_SENT_CSRS_FILTER: { + return { + ...state, + dfspSentCsrsFilter: action.filter || '', + }; + } + case SET_DFSP_SENT_CSRS_CERTIFICATES: { + return { + ...state, + dfspSentCsrsCertificates: action.certificates || initialState.dfspSentCsrsCertificates, + }; + } + case SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL: { + return { + ...state, + isDfspSentCsrsCertificateModalVisible: true, + dfspSentCsrsCertificateModalContent: action.certificate, + dfspSentCsrsCertificateModalTitle: action.title, + }; + } + case HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL: { + return { + ...state, + isDfspSentCsrsCertificateModalVisible: false, + dfspSentCsrsCertificateModalContent: undefined, + dfspSentCsrsCertificateModalTitle: undefined, + }; + } + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/sagas.ts index 734607b..ad58adc 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/sagas.ts @@ -1,48 +1,48 @@ -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import apis from 'utils/apis'; -import { downloadFile } from 'utils/html'; -import { is20x } from 'utils/http'; -import { getDfspName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { - DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, - REQUEST_DFSP_SENT_CSR_CERTIFICATE, - DownloadDfspSentCsrCertificateAction, - RequestDfspSentCsrCertificateAction, -} from './types'; - -import { setDfspSentCsrsCertificates, setDfspSentCsrsCertificatesError } from './actions'; - -export function* downloadDfspSentCsrCertificate(action: DownloadDfspSentCsrCertificateAction) { - const state = yield select(); - const dfspName = getDfspName(state); - const filename = `${dfspName}${action.extension}`; - yield call(downloadFile, action.certificate, filename); -} - -export function* DownloadCSRSSaga() { - yield takeLatest(DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, downloadDfspSentCsrCertificate); -} - -function* fetchDfspSentCSRs(action: RequestDfspSentCsrCertificateAction) { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.inboundEnrollments.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setDfspSentCsrsCertificates({ certificates: response.data })); - } else { - yield put(setDfspSentCsrsCertificatesError({ error: 'Error in fetching DFSP Sent CSRs' })); - } - } catch (e) { - yield put(setDfspSentCsrsCertificatesError({ error: e.message })); - } -} - -export function* RequestSentCSRSSaga() { - yield takeLatest(REQUEST_DFSP_SENT_CSR_CERTIFICATE, fetchDfspSentCSRs); -} - -export default function* rootSaga() { - yield all([DownloadCSRSSaga(), RequestSentCSRSSaga()]); -} +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import apis from 'utils/apis'; +import { downloadFile } from 'utils/html'; +import { is20x } from 'utils/http'; +import { getDfspName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { + DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, + REQUEST_DFSP_SENT_CSR_CERTIFICATE, + DownloadDfspSentCsrCertificateAction, + RequestDfspSentCsrCertificateAction, +} from './types'; + +import { setDfspSentCsrsCertificates, setDfspSentCsrsCertificatesError } from './actions'; + +export function* downloadDfspSentCsrCertificate(action: DownloadDfspSentCsrCertificateAction) { + const state = yield select(); + const dfspName = getDfspName(state); + const filename = `${dfspName}${action.extension}`; + yield call(downloadFile, action.certificate, filename); +} + +export function* DownloadCSRSSaga() { + yield takeLatest(DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE, downloadDfspSentCsrCertificate); +} + +function* fetchDfspSentCSRs(action: RequestDfspSentCsrCertificateAction) { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.inboundEnrollments.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setDfspSentCsrsCertificates({ certificates: response.data })); + } else { + yield put(setDfspSentCsrsCertificatesError({ error: 'Error in fetching DFSP Sent CSRs' })); + } + } catch (e) { + yield put(setDfspSentCsrsCertificatesError({ error: e.message })); + } +} + +export function* RequestSentCSRSSaga() { + yield takeLatest(REQUEST_DFSP_SENT_CSR_CERTIFICATE, fetchDfspSentCSRs); +} + +export default function* rootSaga() { + yield all([DownloadCSRSSaga(), RequestSentCSRSSaga()]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/selectors.ts index 758f004..fd1f5ca 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/selectors.ts @@ -1,40 +1,40 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import { CSR } from '../types'; -// import find from 'lodash/find'; -// import { getDfspHubExternalCaCertificates } from '../../CertificateAuthorities/HUBExternalCertificateAuthority/selectors'; - -export const getDfspSentCsrsError = (state: State) => - state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsError; -export const getDfspSentCsrsFilter = (state: State) => - state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsFilter; -export const getDfspSentCsrsCertificates = (state: State) => - state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsCertificates; -export const getIsDfspSentCsrsCertificateModalVisible = (state: State) => - state.wizard.environment.tls.tlsclient.csrs.isDfspSentCsrsCertificateModalVisible; -export const getDfspSentCsrsCertificateModalContent = (state: State) => - state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsCertificateModalContent; -export const getDfspSentCsrsCertificateModalTitle = (state: State) => - state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsCertificateModalTitle; - -export const getFilteredDfspSentCsrsCertificates = createSelector( - // getDfspHubExternalCaCertificates, - getDfspSentCsrsCertificates, - getDfspSentCsrsFilter, - (/* cas, */ certificates, filter) => { - // const findCaById = (id, cas) => find(cas, { id }); - const lowerCaseFilter = filter.toLowerCase(); - return certificates - .map((csr: CSR) => ({ - ...csr, - externalCa: undefined, // findCaById(csr.hubCAId, cas), - })) - .filter((csr: CSR) => csr.csrInfo.subject.CN.toLowerCase().includes(lowerCaseFilter)); - } -); - -export const getIsDfspSentCsrsPending = createSelector( - (state: State) => state.api, - isPending('inboundEnrollments.read') -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import { CSR } from '../types'; +// import find from 'lodash/find'; +// import { getDfspHubExternalCaCertificates } from '../../CertificateAuthorities/HUBExternalCertificateAuthority/selectors'; + +export const getDfspSentCsrsError = (state: State) => + state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsError; +export const getDfspSentCsrsFilter = (state: State) => + state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsFilter; +export const getDfspSentCsrsCertificates = (state: State) => + state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsCertificates; +export const getIsDfspSentCsrsCertificateModalVisible = (state: State) => + state.wizard.environment.tls.tlsclient.csrs.isDfspSentCsrsCertificateModalVisible; +export const getDfspSentCsrsCertificateModalContent = (state: State) => + state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsCertificateModalContent; +export const getDfspSentCsrsCertificateModalTitle = (state: State) => + state.wizard.environment.tls.tlsclient.csrs.dfspSentCsrsCertificateModalTitle; + +export const getFilteredDfspSentCsrsCertificates = createSelector( + // getDfspHubExternalCaCertificates, + getDfspSentCsrsCertificates, + getDfspSentCsrsFilter, + (/* cas, */ certificates, filter) => { + // const findCaById = (id, cas) => find(cas, { id }); + const lowerCaseFilter = filter.toLowerCase(); + return certificates + .map((csr: CSR) => ({ + ...csr, + externalCa: undefined, // findCaById(csr.hubCAId, cas), + })) + .filter((csr: CSR) => csr.csrInfo.subject.CN.toLowerCase().includes(lowerCaseFilter)); + } +); + +export const getIsDfspSentCsrsPending = createSelector( + (state: State) => state.api, + isPending('inboundEnrollments.read') +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/types.ts index 6ba683f..3d64948 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/SentCSRs/types.ts @@ -1,62 +1,62 @@ -import { ErrorMessage } from 'App/types'; -import { CSR } from '../types'; - -export const RESET_DFSP_SENT_CSRS = 'DFSP Sent CSRs / Reset'; -export const SET_DFSP_SENT_CSRS_FILTER = 'DFSP Sent CSRs / Set Filter'; -export const SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR = 'DFSP Sent CSRs / Set Error'; -export const SET_DFSP_SENT_CSRS_CERTIFICATES = 'DFSP Sent CSRs / Set Certificates'; -export const SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL = 'DFSP Sent CSRs / Show Certificate Modal'; -export const HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL = 'DFSP Sent CSRs / Hide Certificate Modal'; -export const REQUEST_DFSP_SENT_CSR_CERTIFICATE = 'DFSP Sent CSRs / Request CSR Certificate'; -export const DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE = 'DFSP Sent CSRs / Download CSR Certificate'; - -export interface SentCSRsState { - dfspSentCsrsError: ErrorMessage; - dfspSentCsrsFilter: string; - dfspSentCsrsCertificates: CSR[]; - isDfspSentCsrsCertificateModalVisible: boolean; - dfspSentCsrsCertificateModalContent?: string; - dfspSentCsrsCertificateModalTitle?: string; -} - -export interface ResetDfspSentCsrsAction { - type: typeof RESET_DFSP_SENT_CSRS; -} -export interface SetDfspSentCsrsCertificatesErrorAction { - type: typeof SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR; - error: string; -} -export interface SetDfspSentCsrsFilterAction { - type: typeof SET_DFSP_SENT_CSRS_FILTER; - filter: string; -} -export interface SetDfspSentCsrsCertificatesAction { - type: typeof SET_DFSP_SENT_CSRS_CERTIFICATES; - certificates: CSR[]; -} -export interface ShowDfspSentCsrsCertificateModalAction { - type: typeof SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL; - certificate: string; - title: string; -} -export interface HideDfspSentCsrsCertificateModalAction { - type: typeof HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL; -} -export interface DownloadDfspSentCsrCertificateAction { - type: typeof DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE; - certificate: string; - extension: string; -} -export interface RequestDfspSentCsrCertificateAction { - type: typeof REQUEST_DFSP_SENT_CSR_CERTIFICATE; -} - -export type DfspSentCSRsActionTypes = - | ResetDfspSentCsrsAction - | SetDfspSentCsrsCertificatesErrorAction - | SetDfspSentCsrsFilterAction - | SetDfspSentCsrsCertificatesAction - | ShowDfspSentCsrsCertificateModalAction - | HideDfspSentCsrsCertificateModalAction - | DownloadDfspSentCsrCertificateAction - | RequestDfspSentCsrCertificateAction; +import { ErrorMessage } from 'App/types'; +import { CSR } from '../types'; + +export const RESET_DFSP_SENT_CSRS = 'DFSP Sent CSRs / Reset'; +export const SET_DFSP_SENT_CSRS_FILTER = 'DFSP Sent CSRs / Set Filter'; +export const SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR = 'DFSP Sent CSRs / Set Error'; +export const SET_DFSP_SENT_CSRS_CERTIFICATES = 'DFSP Sent CSRs / Set Certificates'; +export const SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL = 'DFSP Sent CSRs / Show Certificate Modal'; +export const HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL = 'DFSP Sent CSRs / Hide Certificate Modal'; +export const REQUEST_DFSP_SENT_CSR_CERTIFICATE = 'DFSP Sent CSRs / Request CSR Certificate'; +export const DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE = 'DFSP Sent CSRs / Download CSR Certificate'; + +export interface SentCSRsState { + dfspSentCsrsError: ErrorMessage; + dfspSentCsrsFilter: string; + dfspSentCsrsCertificates: CSR[]; + isDfspSentCsrsCertificateModalVisible: boolean; + dfspSentCsrsCertificateModalContent?: string; + dfspSentCsrsCertificateModalTitle?: string; +} + +export interface ResetDfspSentCsrsAction { + type: typeof RESET_DFSP_SENT_CSRS; +} +export interface SetDfspSentCsrsCertificatesErrorAction { + type: typeof SET_DFSP_SENT_CSRS_CERTIFICATES_ERROR; + error: string; +} +export interface SetDfspSentCsrsFilterAction { + type: typeof SET_DFSP_SENT_CSRS_FILTER; + filter: string; +} +export interface SetDfspSentCsrsCertificatesAction { + type: typeof SET_DFSP_SENT_CSRS_CERTIFICATES; + certificates: CSR[]; +} +export interface ShowDfspSentCsrsCertificateModalAction { + type: typeof SHOW_DFSP_SENT_CSRS_CERTIFICATE_MODAL; + certificate: string; + title: string; +} +export interface HideDfspSentCsrsCertificateModalAction { + type: typeof HIDE_DFSP_SENT_CSRS_CERTIFICATE_MODAL; +} +export interface DownloadDfspSentCsrCertificateAction { + type: typeof DOWNLOAD_DFSP_SENT_CSR_CERTIFICATE; + certificate: string; + extension: string; +} +export interface RequestDfspSentCsrCertificateAction { + type: typeof REQUEST_DFSP_SENT_CSR_CERTIFICATE; +} + +export type DfspSentCSRsActionTypes = + | ResetDfspSentCsrsAction + | SetDfspSentCsrsCertificatesErrorAction + | SetDfspSentCsrsFilterAction + | SetDfspSentCsrsCertificatesAction + | ShowDfspSentCsrsCertificateModalAction + | HideDfspSentCsrsCertificateModalAction + | DownloadDfspSentCsrCertificateAction + | RequestDfspSentCsrCertificateAction; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.css index f055d5a..b46baf6 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.css @@ -1,7 +1,7 @@ -.dfsp-tls { - margin-top: 10px; -} -.dfsp-tls__notification-icon { - margin-right: 4px; - fill: #f96; -} +.dfsp-tls { + margin-top: 10px; +} +.dfsp-tls__notification-icon { + margin-right: 4px; + fill: #f96; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.tsx index 221c619..7872513 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/TLSClient.tsx @@ -1,51 +1,51 @@ -import React, { FC } from 'react'; -import { State } from 'store/types'; -import { connect } from 'react-redux'; -import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; -import CSR from './CSR'; -import SentCSRs from './SentCSRs'; -import HubCSRs from './HubCSRs'; - -import './TLSClient.css'; - -import { getDfspHasUnsignedHubCsrs } from './HubCSRs/selectors'; - -const stateProps = (state: State) => ({ - hasUnsignedCsrs: getDfspHasUnsignedHubCsrs(state), -}); - -interface TLSClientProps { - hasUnsignedCsrs: boolean; -} -const TLSClient: FC = ({ hasUnsignedCsrs }) => ( -
- - - CSR - Sent CSRs - {/* To be enabled later */} - {/* - - {hasUnsignedCsrs && ( - - )} - Unprocessed Hub CSRs - - */} - - - - - - - - - - - - - -
-); - -export default connect(stateProps)(TLSClient); +import React, { FC } from 'react'; +import { State } from 'store/types'; +import { connect } from 'react-redux'; +import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; +import CSR from './CSR'; +import SentCSRs from './SentCSRs'; +import HubCSRs from './HubCSRs'; + +import './TLSClient.css'; + +import { getDfspHasUnsignedHubCsrs } from './HubCSRs/selectors'; + +const stateProps = (state: State) => ({ + hasUnsignedCsrs: getDfspHasUnsignedHubCsrs(state), +}); + +interface TLSClientProps { + hasUnsignedCsrs: boolean; +} +const TLSClient: FC = ({ hasUnsignedCsrs }) => ( +
+ + + CSR + Sent CSRs + {/* To be enabled later */} + {/* + + {hasUnsignedCsrs && ( + + )} + Unprocessed Hub CSRs + + */} + + + + + + + + + + + + + +
+); + +export default connect(stateProps)(TLSClient); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/index.ts index fd5a93a..ca4440f 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/index.ts @@ -1,7 +1,7 @@ -import TLS from './TLSClient'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default TLS; -export { reducer, types, sagas }; +import TLS from './TLSClient'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default TLS; +export { reducer, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/reducers.ts index 35cfb9a..cf0216a 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/reducers.ts @@ -1,12 +1,12 @@ -import { Reducer, combineReducers } from 'redux'; -import { reducer as csrReducer } from './CSR'; -import { reducer as csrsReducer } from './SentCSRs'; -import { reducer as hubCsrsReducer } from './HubCSRs'; - -const reducer: Reducer = combineReducers({ - csr: csrReducer, - csrs: csrsReducer, - hub: hubCsrsReducer, -}); - -export default reducer; +import { Reducer, combineReducers } from 'redux'; +import { reducer as csrReducer } from './CSR'; +import { reducer as csrsReducer } from './SentCSRs'; +import { reducer as hubCsrsReducer } from './HubCSRs'; + +const reducer: Reducer = combineReducers({ + csr: csrReducer, + csrs: csrsReducer, + hub: hubCsrsReducer, +}); + +export default reducer; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/sagas.ts index 5768a35..00ba1a4 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/sagas.ts @@ -1,10 +1,10 @@ -import { all } from 'redux-saga/effects'; -import { sagas as CSRSagas } from './CSR'; -import { sagas as sentCSRsSagas } from './SentCSRs'; -import { sagas as hubCSRsSagas } from './HubCSRs'; - -function* rootSaga() { - yield all([CSRSagas(), sentCSRsSagas(), hubCSRsSagas()]); -} - -export default rootSaga; +import { all } from 'redux-saga/effects'; +import { sagas as CSRSagas } from './CSR'; +import { sagas as sentCSRsSagas } from './SentCSRs'; +import { sagas as hubCSRsSagas } from './HubCSRs'; + +function* rootSaga() { + yield all([CSRSagas(), sentCSRsSagas(), hubCSRsSagas()]); +} + +export default rootSaga; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/types.ts index 7ec1453..bcb85aa 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSClient/types.ts @@ -1,31 +1,31 @@ -import { CertificateValidationResults, CertInfo } from 'App/types'; - -export enum States { - NEW = 'NEW', - CSR_LOADED = 'CSR_LOADED', - CERT_SIGNED = 'CERT_SIGNED', - VALID = 'VALID', - INVALID = 'INVALID', -} - -export interface ExternalCA { - name: string; -} - -export interface CSRInfo { - subject: { - CN: string; - }; -} - -export interface CSR { - id: number; - certificate: string; - csr: string; - csrInfo: CSRInfo; - certInfo?: CertInfo; - state: string; - validations: CertificateValidationResults[]; - validationState: string; - externalCa?: ExternalCA; -} +import { CertificateValidationResults, CertInfo } from 'App/types'; + +export enum States { + NEW = 'NEW', + CSR_LOADED = 'CSR_LOADED', + CERT_SIGNED = 'CERT_SIGNED', + VALID = 'VALID', + INVALID = 'INVALID', +} + +export interface ExternalCA { + name: string; +} + +export interface CSRInfo { + subject: { + CN: string; + }; +} + +export interface CSR { + id: number; + certificate: string; + csr: string; + csrInfo: CSRInfo; + certInfo?: CertInfo; + state: string; + validations: CertificateValidationResults[]; + validationState: string; + externalCa?: ExternalCA; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/DFSPSC.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/DFSPSC.tsx index e2186e7..6995e45 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/DFSPSC.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/DFSPSC.tsx @@ -1,286 +1,286 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { - Button, - CertificateInfo, - CertificateModal, - CertificateValidation, - MessageBox, - FileControls, - FormInput, -} from 'components'; - -import { AnyAction } from 'redux'; -import { withMount } from 'utils/hocs'; - -import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; -import { CertificateValidationResults, CertInfo } from 'App/types'; -import { State, Dispatch } from 'store/types'; - -import { - changeDfspSCRootCertificate, - downloadDfspSCRootCertificate, - showDfspSCRootCertificateModal, - hideDfspSCRootCertificateModal, - changeDfspSCIntermediateChain, - downloadDfspSCIntermediateChain, - showDfspSCIntermediateChainModal, - hideDfspSCIntermediateChainModal, - changeDfspSCServerCertificate, - downloadDfspSCServerCertificate, - showDfspSCServerCertificateModal, - hideDfspSCServerCertificateModal, - submitDfspSCServerCertificate, - storeDfspSCServerCertificate, -} from './actions'; -import { - getDfspSCError, - getDfspSCRootCertificate, - getDfspSCIntermediateChain, - getDfspSCServerCertificate, - getDfspSCRootCertificateInfo, - getDfspSCIntermediateChainInfo, - getDfspSCServerCertificateInfo, - getDfspSCValidations, - getDfspSCValidationState, - getIsDfspSCRootCertificateModalVisible, - getIsDfspSCIntermediateChainModalVisible, - getIsDfspSCServerCertificateModalVisible, - getIsDfspSCSubmitEnabled, - getIsDfspSCSubmitPending, - getIsDfspSCReadPending, -} from './selectors'; - -import './index.css'; - -const stateProps = (state: State) => ({ - environmentName: getEnvironmentName(state), - error: getDfspSCError(state), - rootCertificate: getDfspSCRootCertificate(state), - intermediateChain: getDfspSCIntermediateChain(state), - serverCertificate: getDfspSCServerCertificate(state), - rootCertificateInfo: getDfspSCRootCertificateInfo(state), - intermediateChainInfo: getDfspSCIntermediateChainInfo(state), - serverCertificateInfo: getDfspSCServerCertificateInfo(state), - validations: getDfspSCValidations(state), - validationState: getDfspSCValidationState(state), - isRootCertificateModalVisible: getIsDfspSCRootCertificateModalVisible(state), - isIntermediateChainModalVisible: getIsDfspSCIntermediateChainModalVisible(state), - isServerCertificateModalVisible: getIsDfspSCServerCertificateModalVisible(state), - isSubmitEnabled: getIsDfspSCSubmitEnabled(state), - isSubmitPending: getIsDfspSCSubmitPending(state), - isReadPending: getIsDfspSCReadPending(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(storeDfspSCServerCertificate()), - onRootCertificateChange: (cert: string) => - dispatch(changeDfspSCRootCertificate({ certificate: cert })), - onRootCertificateViewClick: () => dispatch(showDfspSCRootCertificateModal()), - onRootCertificateDownloadClick: () => dispatch(downloadDfspSCRootCertificate()), - onRootCertificateModalCloseClick: () => dispatch(hideDfspSCRootCertificateModal()), - onIntermediateChainChange: (cert: string) => - dispatch(changeDfspSCIntermediateChain({ certificate: cert })), - onIntermediateChainDownloadClick: () => dispatch(downloadDfspSCIntermediateChain()), - onIntermediateChainViewClick: () => dispatch(showDfspSCIntermediateChainModal()), - onIntermediateChainModalCloseClick: () => dispatch(hideDfspSCIntermediateChainModal()), - onServerCertificateChange: (cert: string) => - dispatch(changeDfspSCServerCertificate({ certificate: cert })), - onServerCertificateViewClick: () => dispatch(showDfspSCServerCertificateModal()), - onServerCertificateDownloadClick: () => dispatch(downloadDfspSCServerCertificate()), - onServerCertificateModalCloseClick: () => dispatch(hideDfspSCServerCertificateModal()), - onCreateCertificateClick: () => dispatch(submitDfspSCServerCertificate()), -}); - -interface DfspSCProps { - environmentName: string; - error?: string; - rootCertificate: string; - intermediateChain: string; - serverCertificate: string; - rootCertificateInfo?: CertInfo; - intermediateChainInfo?: CertInfo; - serverCertificateInfo?: CertInfo; - validations: CertificateValidationResults[]; - validationState?: string; - isRootCertificateModalVisible: boolean; - isIntermediateChainModalVisible: boolean; - isServerCertificateModalVisible: boolean; - isSubmitEnabled: boolean; - isSubmitPending: boolean; - isReadPending: boolean; - onRootCertificateChange: (certificate: string) => void; - onRootCertificateViewClick: () => void; - onRootCertificateDownloadClick: () => AnyAction; - onRootCertificateModalCloseClick: () => void; - onIntermediateChainChange: (certificate: string) => void; - onIntermediateChainViewClick: () => void; - onIntermediateChainDownloadClick: () => AnyAction; - onIntermediateChainModalCloseClick: () => void; - onServerCertificateChange: (certificate: string) => void; - onServerCertificateViewClick: () => void; - onServerCertificateDownloadClick: () => AnyAction; - onServerCertificateModalCloseClick: () => void; - onCreateCertificateClick: () => void; -} - -const DfspSC: FC = ({ - environmentName, - error, - rootCertificate, - intermediateChain, - serverCertificate, - rootCertificateInfo, - intermediateChainInfo, - serverCertificateInfo, - validations, - validationState, - isRootCertificateModalVisible, - isIntermediateChainModalVisible, - isServerCertificateModalVisible, - isSubmitEnabled, - isSubmitPending, - isReadPending, - onRootCertificateChange, - onRootCertificateViewClick, - onRootCertificateDownloadClick, - onRootCertificateModalCloseClick, - onIntermediateChainChange, - onIntermediateChainViewClick, - onIntermediateChainDownloadClick, - onIntermediateChainModalCloseClick, - onServerCertificateChange, - onServerCertificateViewClick, - onServerCertificateDownloadClick, - onServerCertificateModalCloseClick, - onCreateCertificateClick, -}) => { - if (error) { - return ( - - ); - } - - return ( -
-
-
- -
- -
- -
-
- - {serverCertificate && ( - - )} -
- {serverCertificateInfo && } -
- -
-
- - {rootCertificate && ( - - )} -
- {rootCertificateInfo && } -
- -
-
- - {intermediateChain && ( - - )} -
- {intermediateChainInfo && } -
- - {isRootCertificateModalVisible && ( - - )} - {isIntermediateChainModalVisible && ( - - )} - {isServerCertificateModalVisible && ( - - )} -
- ); -}; - -const MountedDfspSC = withMount(DfspSC, 'onMount'); - -export default connect(stateProps, actionProps)(MountedDfspSC); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { + Button, + CertificateInfo, + CertificateModal, + CertificateValidation, + MessageBox, + FileControls, + FormInput, +} from 'components'; + +import { AnyAction } from 'redux'; +import { withMount } from 'utils/hocs'; + +import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; +import { CertificateValidationResults, CertInfo } from 'App/types'; +import { State, Dispatch } from 'store/types'; + +import { + changeDfspSCRootCertificate, + downloadDfspSCRootCertificate, + showDfspSCRootCertificateModal, + hideDfspSCRootCertificateModal, + changeDfspSCIntermediateChain, + downloadDfspSCIntermediateChain, + showDfspSCIntermediateChainModal, + hideDfspSCIntermediateChainModal, + changeDfspSCServerCertificate, + downloadDfspSCServerCertificate, + showDfspSCServerCertificateModal, + hideDfspSCServerCertificateModal, + submitDfspSCServerCertificate, + storeDfspSCServerCertificate, +} from './actions'; +import { + getDfspSCError, + getDfspSCRootCertificate, + getDfspSCIntermediateChain, + getDfspSCServerCertificate, + getDfspSCRootCertificateInfo, + getDfspSCIntermediateChainInfo, + getDfspSCServerCertificateInfo, + getDfspSCValidations, + getDfspSCValidationState, + getIsDfspSCRootCertificateModalVisible, + getIsDfspSCIntermediateChainModalVisible, + getIsDfspSCServerCertificateModalVisible, + getIsDfspSCSubmitEnabled, + getIsDfspSCSubmitPending, + getIsDfspSCReadPending, +} from './selectors'; + +import './index.css'; + +const stateProps = (state: State) => ({ + environmentName: getEnvironmentName(state), + error: getDfspSCError(state), + rootCertificate: getDfspSCRootCertificate(state), + intermediateChain: getDfspSCIntermediateChain(state), + serverCertificate: getDfspSCServerCertificate(state), + rootCertificateInfo: getDfspSCRootCertificateInfo(state), + intermediateChainInfo: getDfspSCIntermediateChainInfo(state), + serverCertificateInfo: getDfspSCServerCertificateInfo(state), + validations: getDfspSCValidations(state), + validationState: getDfspSCValidationState(state), + isRootCertificateModalVisible: getIsDfspSCRootCertificateModalVisible(state), + isIntermediateChainModalVisible: getIsDfspSCIntermediateChainModalVisible(state), + isServerCertificateModalVisible: getIsDfspSCServerCertificateModalVisible(state), + isSubmitEnabled: getIsDfspSCSubmitEnabled(state), + isSubmitPending: getIsDfspSCSubmitPending(state), + isReadPending: getIsDfspSCReadPending(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(storeDfspSCServerCertificate()), + onRootCertificateChange: (cert: string) => + dispatch(changeDfspSCRootCertificate({ certificate: cert })), + onRootCertificateViewClick: () => dispatch(showDfspSCRootCertificateModal()), + onRootCertificateDownloadClick: () => dispatch(downloadDfspSCRootCertificate()), + onRootCertificateModalCloseClick: () => dispatch(hideDfspSCRootCertificateModal()), + onIntermediateChainChange: (cert: string) => + dispatch(changeDfspSCIntermediateChain({ certificate: cert })), + onIntermediateChainDownloadClick: () => dispatch(downloadDfspSCIntermediateChain()), + onIntermediateChainViewClick: () => dispatch(showDfspSCIntermediateChainModal()), + onIntermediateChainModalCloseClick: () => dispatch(hideDfspSCIntermediateChainModal()), + onServerCertificateChange: (cert: string) => + dispatch(changeDfspSCServerCertificate({ certificate: cert })), + onServerCertificateViewClick: () => dispatch(showDfspSCServerCertificateModal()), + onServerCertificateDownloadClick: () => dispatch(downloadDfspSCServerCertificate()), + onServerCertificateModalCloseClick: () => dispatch(hideDfspSCServerCertificateModal()), + onCreateCertificateClick: () => dispatch(submitDfspSCServerCertificate()), +}); + +interface DfspSCProps { + environmentName: string; + error?: string; + rootCertificate: string; + intermediateChain: string; + serverCertificate: string; + rootCertificateInfo?: CertInfo; + intermediateChainInfo?: CertInfo; + serverCertificateInfo?: CertInfo; + validations: CertificateValidationResults[]; + validationState?: string; + isRootCertificateModalVisible: boolean; + isIntermediateChainModalVisible: boolean; + isServerCertificateModalVisible: boolean; + isSubmitEnabled: boolean; + isSubmitPending: boolean; + isReadPending: boolean; + onRootCertificateChange: (certificate: string) => void; + onRootCertificateViewClick: () => void; + onRootCertificateDownloadClick: () => AnyAction; + onRootCertificateModalCloseClick: () => void; + onIntermediateChainChange: (certificate: string) => void; + onIntermediateChainViewClick: () => void; + onIntermediateChainDownloadClick: () => AnyAction; + onIntermediateChainModalCloseClick: () => void; + onServerCertificateChange: (certificate: string) => void; + onServerCertificateViewClick: () => void; + onServerCertificateDownloadClick: () => AnyAction; + onServerCertificateModalCloseClick: () => void; + onCreateCertificateClick: () => void; +} + +const DfspSC: FC = ({ + environmentName, + error, + rootCertificate, + intermediateChain, + serverCertificate, + rootCertificateInfo, + intermediateChainInfo, + serverCertificateInfo, + validations, + validationState, + isRootCertificateModalVisible, + isIntermediateChainModalVisible, + isServerCertificateModalVisible, + isSubmitEnabled, + isSubmitPending, + isReadPending, + onRootCertificateChange, + onRootCertificateViewClick, + onRootCertificateDownloadClick, + onRootCertificateModalCloseClick, + onIntermediateChainChange, + onIntermediateChainViewClick, + onIntermediateChainDownloadClick, + onIntermediateChainModalCloseClick, + onServerCertificateChange, + onServerCertificateViewClick, + onServerCertificateDownloadClick, + onServerCertificateModalCloseClick, + onCreateCertificateClick, +}) => { + if (error) { + return ( + + ); + } + + return ( +
+
+
+ +
+ +
+ +
+
+ + {serverCertificate && ( + + )} +
+ {serverCertificateInfo && } +
+ +
+
+ + {rootCertificate && ( + + )} +
+ {rootCertificateInfo && } +
+ +
+
+ + {intermediateChain && ( + + )} +
+ {intermediateChainInfo && } +
+ + {isRootCertificateModalVisible && ( + + )} + {isIntermediateChainModalVisible && ( + + )} + {isServerCertificateModalVisible && ( + + )} +
+ ); +}; + +const MountedDfspSC = withMount(DfspSC, 'onMount'); + +export default connect(stateProps, actionProps)(MountedDfspSC); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/_mockData.js index 366ea29..dee89e8 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/_mockData.js @@ -1,52 +1,52 @@ -export const dfspCaHubCertMock = - '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhjxSZnE0qnsHhfTuvcqdFuhOWKU4Z0BqYBvQ3lBetoxi6PrABDJXWKTUgNX31EGDk-----END CERTIFICATE-----'; - -const Validation = { - validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', - performed: true, - result: 'VALID', - message: 'Validation Test Message', - messageTemplate: 'Textual description of the validation result', - data: {}, - details: 'Test Details', -}; - -const CertInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - issuer: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - subjectAlternativeNames: ['alt1', 'alt2'], - serialNumber: '17159976289428250189079625547205715159', - notBefore: '2019-02-04T00:00:00Z', - notAfter: '2020-02-12T12:00:00Z', - signatureAlgorithm: 'SHA256WithRSA', -}; - -export const dfspServerCertsMock = { - rootCertificate: - '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', - intermediateChain: - '-----BEGIN CERTIFICATE-----MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', - serverCertificate: - '-----BEGIN CERTIFICATE-----VJEA8KbtyX+r8snwU5C1hUrwaW6MWOARa8qBpNQcWTkaIeoYvy/sGIJEmjR0vFEwHdp1cSaWIr6/4g72n7OqXwfinu7ZYW97EfoOSQJeAzAgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHfCuFCaZ3Z2sS3ChtCDoH6mfrpLMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd/cGYYuMDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdvb2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb2-----END CERTIFICATE-----', - validations: [Validation], - validationState: 'VALID', - rootCertificateInfo: CertInfo, - intermediateChainInfo: [CertInfo], - serverCertificateInfo: CertInfo, -}; +export const dfspCaHubCertMock = + '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhjxSZnE0qnsHhfTuvcqdFuhOWKU4Z0BqYBvQ3lBetoxi6PrABDJXWKTUgNX31EGDk-----END CERTIFICATE-----'; + +const Validation = { + validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', + performed: true, + result: 'VALID', + message: 'Validation Test Message', + messageTemplate: 'Textual description of the validation result', + data: {}, + details: 'Test Details', +}; + +const CertInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + issuer: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + subjectAlternativeNames: ['alt1', 'alt2'], + serialNumber: '17159976289428250189079625547205715159', + notBefore: '2019-02-04T00:00:00Z', + notAfter: '2020-02-12T12:00:00Z', + signatureAlgorithm: 'SHA256WithRSA', +}; + +export const dfspServerCertsMock = { + rootCertificate: + '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', + intermediateChain: + '-----BEGIN CERTIFICATE-----MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', + serverCertificate: + '-----BEGIN CERTIFICATE-----VJEA8KbtyX+r8snwU5C1hUrwaW6MWOARa8qBpNQcWTkaIeoYvy/sGIJEmjR0vFEwHdp1cSaWIr6/4g72n7OqXwfinu7ZYW97EfoOSQJeAzAgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHfCuFCaZ3Z2sS3ChtCDoH6mfrpLMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd/cGYYuMDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdvb2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb2-----END CERTIFICATE-----', + validations: [Validation], + validationState: 'VALID', + rootCertificateInfo: CertInfo, + intermediateChainInfo: [CertInfo], + serverCertificateInfo: CertInfo, +}; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/actions.ts index 190fc38..22850ae 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/actions.ts @@ -1,251 +1,251 @@ -import { CertificateValidationResults, CertInfo } from 'App/types'; -import { - ResetDfspSCAction, - RESET_DFSP_SC, - SetDfspSCErrorAction, - SET_DFSP_SC_ERROR, - SET_DFSP_SC_INTERMEDIATE_CHAIN, - SetDfspSCRootCertificateAction, - SET_DFSP_SC_ROOT_CERTIFICATE, - SetDfspSCIntermediateChainAction, - SetDfspSCServerCertificateAction, - SET_DFSP_SC_SERVER_CERTIFICATE, - SetDfspSCRootCertificateInfoAction, - SET_DFSP_SC_ROOT_CERTIFICATE_INFO, - SetDfspSCIntermediateChainInfoAction, - SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO, - SetDfspSCServerCertificateInfoAction, - SET_DFSP_SC_SERVER_CERTIFICATE_INFO, - SetDfspSCValidationsAction, - SET_DFSP_SC_VALIDATIONS, - SetDfspSCValidationStateAction, - SET_DFSP_SC_VALIDATION_STATE, - ShowDfspSCRootCertificateModalAction, - SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL, - ChangeDfspSCRootCertificateAction, - CHANGE_DFSP_SC_ROOT_CERTIFICATE, - ChangeDfspSCIntermediateChainAction, - CHANGE_DFSP_SC_INTERMEDIATE_CHAIN, - ChangeDfspSCServerCertificateAction, - CHANGE_DFSP_SC_SERVER_CERTIFICATE, - HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL, - SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, - HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, - SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL, - HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL, - HideDfspSCRootCertificateModalAction, - ShowDfspSCIntermediateChainModalAction, - HideDfspSCIntermediateChainModalAction, - ShowDfspSCServerCertificateModalAction, - HideDfspSCServerCertificateModalAction, - SubmitDfspSCServerCertificateAction, - SUBMIT_DFSP_SC_SERVER_CERTIFICATE, - DownloadDfspSCRootCertificateAction, - DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, - DownloadDfspSCIntermediateChainAction, - DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, - DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, - DownloadDfspSCServerCertificateAction, - STORE_DFSP_SC_SERVER_CERTIFICATE, - StoreDfspSCServerCertificateAction, -} from './types'; - -export function resetDfspSC(): ResetDfspSCAction { - return { - type: RESET_DFSP_SC, - }; -} - -export function setDfspSCError({ error }: { error: string }): SetDfspSCErrorAction { - return { - type: SET_DFSP_SC_ERROR, - error, - }; -} - -export function setDfspSCRootCertificate({ - certificate, -}: { - certificate: string; -}): SetDfspSCRootCertificateAction { - return { - type: SET_DFSP_SC_ROOT_CERTIFICATE, - certificate, - }; -} - -export function setDfspSCIntermediateChain({ - certificate, -}: { - certificate: string; -}): SetDfspSCIntermediateChainAction { - return { - type: SET_DFSP_SC_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function setDfspSCServerCertificate({ - certificate, -}: { - certificate: string; -}): SetDfspSCServerCertificateAction { - return { - type: SET_DFSP_SC_SERVER_CERTIFICATE, - certificate, - }; -} - -export function setDfspSCRootCertificateInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspSCRootCertificateInfoAction { - return { - type: SET_DFSP_SC_ROOT_CERTIFICATE_INFO, - certInfo, - }; -} - -export function setDfspSCIntermediateChainInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspSCIntermediateChainInfoAction { - return { - type: SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO, - certInfo, - }; -} - -export function setDfspSCServerCertificateInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspSCServerCertificateInfoAction { - return { - type: SET_DFSP_SC_SERVER_CERTIFICATE_INFO, - certInfo, - }; -} - -export function setDfspSCValidations({ - validations, -}: { - validations: CertificateValidationResults[]; -}): SetDfspSCValidationsAction { - return { - type: SET_DFSP_SC_VALIDATIONS, - validations, - }; -} - -export function setDfspSCValidationState({ - validationState, -}: { - validationState: string | undefined; -}): SetDfspSCValidationStateAction { - return { - type: SET_DFSP_SC_VALIDATION_STATE, - validationState, - }; -} - -export function showDfspSCRootCertificateModal(): ShowDfspSCRootCertificateModalAction { - return { - type: SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL, - }; -} - -export function changeDfspSCRootCertificate({ - certificate, -}: { - certificate: string; -}): ChangeDfspSCRootCertificateAction { - return { - type: CHANGE_DFSP_SC_ROOT_CERTIFICATE, - certificate, - }; -} - -export function changeDfspSCIntermediateChain({ - certificate, -}: { - certificate: string; -}): ChangeDfspSCIntermediateChainAction { - return { - type: CHANGE_DFSP_SC_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function changeDfspSCServerCertificate({ - certificate, -}: { - certificate: string; -}): ChangeDfspSCServerCertificateAction { - return { - type: CHANGE_DFSP_SC_SERVER_CERTIFICATE, - certificate, - }; -} - -export function hideDfspSCRootCertificateModal(): HideDfspSCRootCertificateModalAction { - return { - type: HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL, - }; -} - -export function showDfspSCIntermediateChainModal(): ShowDfspSCIntermediateChainModalAction { - return { - type: SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function hideDfspSCIntermediateChainModal(): HideDfspSCIntermediateChainModalAction { - return { - type: HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function showDfspSCServerCertificateModal(): ShowDfspSCServerCertificateModalAction { - return { - type: SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL, - }; -} - -export function hideDfspSCServerCertificateModal(): HideDfspSCServerCertificateModalAction { - return { - type: HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL, - }; -} - -export function submitDfspSCServerCertificate(): SubmitDfspSCServerCertificateAction { - return { - type: SUBMIT_DFSP_SC_SERVER_CERTIFICATE, - }; -} - -export function storeDfspSCServerCertificate(): StoreDfspSCServerCertificateAction { - return { - type: STORE_DFSP_SC_SERVER_CERTIFICATE, - }; -} - -export function downloadDfspSCRootCertificate(): DownloadDfspSCRootCertificateAction { - return { - type: DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, - }; -} - -export function downloadDfspSCIntermediateChain(): DownloadDfspSCIntermediateChainAction { - return { - type: DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, - }; -} - -export function downloadDfspSCServerCertificate(): DownloadDfspSCServerCertificateAction { - return { - type: DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, - }; -} +import { CertificateValidationResults, CertInfo } from 'App/types'; +import { + ResetDfspSCAction, + RESET_DFSP_SC, + SetDfspSCErrorAction, + SET_DFSP_SC_ERROR, + SET_DFSP_SC_INTERMEDIATE_CHAIN, + SetDfspSCRootCertificateAction, + SET_DFSP_SC_ROOT_CERTIFICATE, + SetDfspSCIntermediateChainAction, + SetDfspSCServerCertificateAction, + SET_DFSP_SC_SERVER_CERTIFICATE, + SetDfspSCRootCertificateInfoAction, + SET_DFSP_SC_ROOT_CERTIFICATE_INFO, + SetDfspSCIntermediateChainInfoAction, + SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO, + SetDfspSCServerCertificateInfoAction, + SET_DFSP_SC_SERVER_CERTIFICATE_INFO, + SetDfspSCValidationsAction, + SET_DFSP_SC_VALIDATIONS, + SetDfspSCValidationStateAction, + SET_DFSP_SC_VALIDATION_STATE, + ShowDfspSCRootCertificateModalAction, + SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL, + ChangeDfspSCRootCertificateAction, + CHANGE_DFSP_SC_ROOT_CERTIFICATE, + ChangeDfspSCIntermediateChainAction, + CHANGE_DFSP_SC_INTERMEDIATE_CHAIN, + ChangeDfspSCServerCertificateAction, + CHANGE_DFSP_SC_SERVER_CERTIFICATE, + HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL, + SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, + HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, + SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL, + HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL, + HideDfspSCRootCertificateModalAction, + ShowDfspSCIntermediateChainModalAction, + HideDfspSCIntermediateChainModalAction, + ShowDfspSCServerCertificateModalAction, + HideDfspSCServerCertificateModalAction, + SubmitDfspSCServerCertificateAction, + SUBMIT_DFSP_SC_SERVER_CERTIFICATE, + DownloadDfspSCRootCertificateAction, + DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, + DownloadDfspSCIntermediateChainAction, + DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, + DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, + DownloadDfspSCServerCertificateAction, + STORE_DFSP_SC_SERVER_CERTIFICATE, + StoreDfspSCServerCertificateAction, +} from './types'; + +export function resetDfspSC(): ResetDfspSCAction { + return { + type: RESET_DFSP_SC, + }; +} + +export function setDfspSCError({ error }: { error: string }): SetDfspSCErrorAction { + return { + type: SET_DFSP_SC_ERROR, + error, + }; +} + +export function setDfspSCRootCertificate({ + certificate, +}: { + certificate: string; +}): SetDfspSCRootCertificateAction { + return { + type: SET_DFSP_SC_ROOT_CERTIFICATE, + certificate, + }; +} + +export function setDfspSCIntermediateChain({ + certificate, +}: { + certificate: string; +}): SetDfspSCIntermediateChainAction { + return { + type: SET_DFSP_SC_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function setDfspSCServerCertificate({ + certificate, +}: { + certificate: string; +}): SetDfspSCServerCertificateAction { + return { + type: SET_DFSP_SC_SERVER_CERTIFICATE, + certificate, + }; +} + +export function setDfspSCRootCertificateInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspSCRootCertificateInfoAction { + return { + type: SET_DFSP_SC_ROOT_CERTIFICATE_INFO, + certInfo, + }; +} + +export function setDfspSCIntermediateChainInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspSCIntermediateChainInfoAction { + return { + type: SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO, + certInfo, + }; +} + +export function setDfspSCServerCertificateInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspSCServerCertificateInfoAction { + return { + type: SET_DFSP_SC_SERVER_CERTIFICATE_INFO, + certInfo, + }; +} + +export function setDfspSCValidations({ + validations, +}: { + validations: CertificateValidationResults[]; +}): SetDfspSCValidationsAction { + return { + type: SET_DFSP_SC_VALIDATIONS, + validations, + }; +} + +export function setDfspSCValidationState({ + validationState, +}: { + validationState: string | undefined; +}): SetDfspSCValidationStateAction { + return { + type: SET_DFSP_SC_VALIDATION_STATE, + validationState, + }; +} + +export function showDfspSCRootCertificateModal(): ShowDfspSCRootCertificateModalAction { + return { + type: SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL, + }; +} + +export function changeDfspSCRootCertificate({ + certificate, +}: { + certificate: string; +}): ChangeDfspSCRootCertificateAction { + return { + type: CHANGE_DFSP_SC_ROOT_CERTIFICATE, + certificate, + }; +} + +export function changeDfspSCIntermediateChain({ + certificate, +}: { + certificate: string; +}): ChangeDfspSCIntermediateChainAction { + return { + type: CHANGE_DFSP_SC_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function changeDfspSCServerCertificate({ + certificate, +}: { + certificate: string; +}): ChangeDfspSCServerCertificateAction { + return { + type: CHANGE_DFSP_SC_SERVER_CERTIFICATE, + certificate, + }; +} + +export function hideDfspSCRootCertificateModal(): HideDfspSCRootCertificateModalAction { + return { + type: HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL, + }; +} + +export function showDfspSCIntermediateChainModal(): ShowDfspSCIntermediateChainModalAction { + return { + type: SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function hideDfspSCIntermediateChainModal(): HideDfspSCIntermediateChainModalAction { + return { + type: HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function showDfspSCServerCertificateModal(): ShowDfspSCServerCertificateModalAction { + return { + type: SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL, + }; +} + +export function hideDfspSCServerCertificateModal(): HideDfspSCServerCertificateModalAction { + return { + type: HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL, + }; +} + +export function submitDfspSCServerCertificate(): SubmitDfspSCServerCertificateAction { + return { + type: SUBMIT_DFSP_SC_SERVER_CERTIFICATE, + }; +} + +export function storeDfspSCServerCertificate(): StoreDfspSCServerCertificateAction { + return { + type: STORE_DFSP_SC_SERVER_CERTIFICATE, + }; +} + +export function downloadDfspSCRootCertificate(): DownloadDfspSCRootCertificateAction { + return { + type: DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, + }; +} + +export function downloadDfspSCIntermediateChain(): DownloadDfspSCIntermediateChainAction { + return { + type: DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, + }; +} + +export function downloadDfspSCServerCertificate(): DownloadDfspSCServerCertificateAction { + return { + type: DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.css index 8b7ce15..ebe38f5 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.css @@ -1,26 +1,26 @@ -.dfsp-sc { - margin-top: 10px; -} -.dfsp-sc__submit__container { - margin: 10px 0px; -} -.dfsp-sc__submit { - width: 200px; -} - -.dfsp-sc__certificate-validation { - width: 400px; - margin: 10px 0px; -} -.dfsp-sc__certificate-item { - margin-bottom: 20px; -} -.dfsp-sc__root-certificate, -.dfsp-sc__intermediate-chain, -.dfsp-sc__server-certificate { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; - margin-bottom: 20px; -} +.dfsp-sc { + margin-top: 10px; +} +.dfsp-sc__submit__container { + margin: 10px 0px; +} +.dfsp-sc__submit { + width: 200px; +} + +.dfsp-sc__certificate-validation { + width: 400px; + margin: 10px 0px; +} +.dfsp-sc__certificate-item { + margin-bottom: 20px; +} +.dfsp-sc__root-certificate, +.dfsp-sc__intermediate-chain, +.dfsp-sc__server-certificate { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; + margin-bottom: 20px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.ts index 4faa368..fa546df 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/index.ts @@ -1,9 +1,9 @@ -import DFSPSC from './DFSPSC'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default DFSPSC; -export { actions, reducer, selectors, types, sagas }; +import DFSPSC from './DFSPSC'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default DFSPSC; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/reducers.ts index a6be740..542e0d7 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/reducers.ts @@ -1,202 +1,202 @@ -import { - RESET_DFSP_SC, - SET_DFSP_SC_ERROR, - SET_DFSP_SC_ROOT_CERTIFICATE, - SET_DFSP_SC_INTERMEDIATE_CHAIN, - SET_DFSP_SC_SERVER_CERTIFICATE, - SET_DFSP_SC_ROOT_CERTIFICATE_INFO, - SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO, - SET_DFSP_SC_SERVER_CERTIFICATE_INFO, - SET_DFSP_SC_VALIDATIONS, - SET_DFSP_SC_VALIDATION_STATE, - CHANGE_DFSP_SC_ROOT_CERTIFICATE, - CHANGE_DFSP_SC_INTERMEDIATE_CHAIN, - CHANGE_DFSP_SC_SERVER_CERTIFICATE, - SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL, - HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL, - SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, - HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, - SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL, - HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL, - DfspSCActionTypes, - DfspSCState, -} from './types'; - -const initialState = { - dfspSCError: null, - previousDfspSCRootCertificate: undefined, - previousDfspSCIntermediateChain: undefined, - previousDfspSCServerCertificate: undefined, - dfspSCRootCertificate: undefined, - dfspSCIntermediateChain: undefined, - dfspSCServerCertificate: undefined, - dfspSCRootCertificateInfo: undefined, - dfspSCIntermediateChainInfo: undefined, - dfspSCServerCertificateInfo: undefined, - dfspSCValidations: [], - dfspSCValidationState: undefined, - isDfspSCRootCertificateModalVisible: false, - isDfspSCIntermediateChainModalVisible: false, - isDfspSCServerCertificateModalVisible: false, -}; - -export default function dfspSCReducer( - state = initialState, - action: DfspSCActionTypes -): DfspSCState { - switch (action.type) { - case RESET_DFSP_SC: { - return initialState; - } - - case SET_DFSP_SC_ERROR: { - return { - ...state, - dfspSCError: action.error, - }; - } - - case SET_DFSP_SC_ROOT_CERTIFICATE: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspSCRootCertificate: action.certificate, - dfspSCRootCertificate: action.certificate, - }; - } - - case SET_DFSP_SC_INTERMEDIATE_CHAIN: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspSCIntermediateChain: action.certificate, - dfspSCIntermediateChain: action.certificate, - }; - } - - case SET_DFSP_SC_SERVER_CERTIFICATE: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspSCServerCertificate: action.certificate, - dfspSCServerCertificate: action.certificate, - }; - } - - case SET_DFSP_SC_ROOT_CERTIFICATE_INFO: { - return { - ...state, - dfspSCRootCertificateInfo: action.certInfo, - }; - } - - case SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO: { - return { - ...state, - dfspSCIntermediateChainInfo: action.certInfo, - }; - } - - case SET_DFSP_SC_SERVER_CERTIFICATE_INFO: { - return { - ...state, - dfspSCServerCertificateInfo: action.certInfo, - }; - } - - case SET_DFSP_SC_VALIDATIONS: { - return { - ...state, - dfspSCValidations: action.validations, - }; - } - - case SET_DFSP_SC_VALIDATION_STATE: { - return { - ...state, - dfspSCValidationState: action.validationState, - }; - } - - case CHANGE_DFSP_SC_ROOT_CERTIFICATE: { - return { - ...state, - dfspSCRootCertificate: action.certificate, - dfspSCRootCertificateInfo: initialState.dfspSCRootCertificateInfo, - dfspSCValidationState: initialState.dfspSCValidationState, - dfspSCValidations: initialState.dfspSCValidations, - }; - } - - case CHANGE_DFSP_SC_INTERMEDIATE_CHAIN: { - return { - ...state, - dfspSCIntermediateChain: action.certificate, - dfspSCIntermediateChainInfo: initialState.dfspSCIntermediateChainInfo, - dfspSCValidationState: initialState.dfspSCValidationState, - dfspSCValidations: initialState.dfspSCValidations, - }; - } - - case CHANGE_DFSP_SC_SERVER_CERTIFICATE: { - return { - ...state, - dfspSCServerCertificate: action.certificate, - dfspSCServerCertificateInfo: initialState.dfspSCServerCertificateInfo, - dfspSCValidationState: initialState.dfspSCValidationState, - dfspSCValidations: initialState.dfspSCValidations, - }; - } - - case SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL: { - return { - ...state, - isDfspSCRootCertificateModalVisible: true, - }; - } - - case HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL: { - return { - ...state, - isDfspSCRootCertificateModalVisible: false, - }; - } - - case SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isDfspSCIntermediateChainModalVisible: true, - }; - } - - case HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isDfspSCIntermediateChainModalVisible: false, - }; - } - - case SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL: { - return { - ...state, - isDfspSCServerCertificateModalVisible: true, - }; - } - - case HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL: { - return { - ...state, - isDfspSCServerCertificateModalVisible: false, - }; - } - - default: - return state; - } -} +import { + RESET_DFSP_SC, + SET_DFSP_SC_ERROR, + SET_DFSP_SC_ROOT_CERTIFICATE, + SET_DFSP_SC_INTERMEDIATE_CHAIN, + SET_DFSP_SC_SERVER_CERTIFICATE, + SET_DFSP_SC_ROOT_CERTIFICATE_INFO, + SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO, + SET_DFSP_SC_SERVER_CERTIFICATE_INFO, + SET_DFSP_SC_VALIDATIONS, + SET_DFSP_SC_VALIDATION_STATE, + CHANGE_DFSP_SC_ROOT_CERTIFICATE, + CHANGE_DFSP_SC_INTERMEDIATE_CHAIN, + CHANGE_DFSP_SC_SERVER_CERTIFICATE, + SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL, + HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL, + SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, + HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL, + SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL, + HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL, + DfspSCActionTypes, + DfspSCState, +} from './types'; + +const initialState = { + dfspSCError: null, + previousDfspSCRootCertificate: undefined, + previousDfspSCIntermediateChain: undefined, + previousDfspSCServerCertificate: undefined, + dfspSCRootCertificate: undefined, + dfspSCIntermediateChain: undefined, + dfspSCServerCertificate: undefined, + dfspSCRootCertificateInfo: undefined, + dfspSCIntermediateChainInfo: undefined, + dfspSCServerCertificateInfo: undefined, + dfspSCValidations: [], + dfspSCValidationState: undefined, + isDfspSCRootCertificateModalVisible: false, + isDfspSCIntermediateChainModalVisible: false, + isDfspSCServerCertificateModalVisible: false, +}; + +export default function dfspSCReducer( + state = initialState, + action: DfspSCActionTypes +): DfspSCState { + switch (action.type) { + case RESET_DFSP_SC: { + return initialState; + } + + case SET_DFSP_SC_ERROR: { + return { + ...state, + dfspSCError: action.error, + }; + } + + case SET_DFSP_SC_ROOT_CERTIFICATE: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspSCRootCertificate: action.certificate, + dfspSCRootCertificate: action.certificate, + }; + } + + case SET_DFSP_SC_INTERMEDIATE_CHAIN: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspSCIntermediateChain: action.certificate, + dfspSCIntermediateChain: action.certificate, + }; + } + + case SET_DFSP_SC_SERVER_CERTIFICATE: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspSCServerCertificate: action.certificate, + dfspSCServerCertificate: action.certificate, + }; + } + + case SET_DFSP_SC_ROOT_CERTIFICATE_INFO: { + return { + ...state, + dfspSCRootCertificateInfo: action.certInfo, + }; + } + + case SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO: { + return { + ...state, + dfspSCIntermediateChainInfo: action.certInfo, + }; + } + + case SET_DFSP_SC_SERVER_CERTIFICATE_INFO: { + return { + ...state, + dfspSCServerCertificateInfo: action.certInfo, + }; + } + + case SET_DFSP_SC_VALIDATIONS: { + return { + ...state, + dfspSCValidations: action.validations, + }; + } + + case SET_DFSP_SC_VALIDATION_STATE: { + return { + ...state, + dfspSCValidationState: action.validationState, + }; + } + + case CHANGE_DFSP_SC_ROOT_CERTIFICATE: { + return { + ...state, + dfspSCRootCertificate: action.certificate, + dfspSCRootCertificateInfo: initialState.dfspSCRootCertificateInfo, + dfspSCValidationState: initialState.dfspSCValidationState, + dfspSCValidations: initialState.dfspSCValidations, + }; + } + + case CHANGE_DFSP_SC_INTERMEDIATE_CHAIN: { + return { + ...state, + dfspSCIntermediateChain: action.certificate, + dfspSCIntermediateChainInfo: initialState.dfspSCIntermediateChainInfo, + dfspSCValidationState: initialState.dfspSCValidationState, + dfspSCValidations: initialState.dfspSCValidations, + }; + } + + case CHANGE_DFSP_SC_SERVER_CERTIFICATE: { + return { + ...state, + dfspSCServerCertificate: action.certificate, + dfspSCServerCertificateInfo: initialState.dfspSCServerCertificateInfo, + dfspSCValidationState: initialState.dfspSCValidationState, + dfspSCValidations: initialState.dfspSCValidations, + }; + } + + case SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL: { + return { + ...state, + isDfspSCRootCertificateModalVisible: true, + }; + } + + case HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL: { + return { + ...state, + isDfspSCRootCertificateModalVisible: false, + }; + } + + case SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isDfspSCIntermediateChainModalVisible: true, + }; + } + + case HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isDfspSCIntermediateChainModalVisible: false, + }; + } + + case SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL: { + return { + ...state, + isDfspSCServerCertificateModalVisible: true, + }; + } + + case HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL: { + return { + ...state, + isDfspSCServerCertificateModalVisible: false, + }; + } + + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/sagas.ts index 8364acc..e58d9e0 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/sagas.ts @@ -1,142 +1,142 @@ -import { call, all, put, select, takeLatest } from 'redux-saga/effects'; -import { is20x, is404 } from 'utils/http'; -import { downloadFile } from 'utils/html'; -import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { showToast, showErrorModal } from 'App/actions'; -import apis from 'utils/apis'; -import { - setDfspSCRootCertificate, - setDfspSCIntermediateChain, - setDfspSCServerCertificate, - setDfspSCRootCertificateInfo, - setDfspSCIntermediateChainInfo, - setDfspSCServerCertificateInfo, - setDfspSCValidations, - setDfspSCValidationState, -} from './actions'; -import { - getDfspSCRootCertificate, - getDfspSCIntermediateChain, - getDfspSCServerCertificate, - getIsDfspSCEditingExistingModel, -} from './selectors'; -import { - SUBMIT_DFSP_SC_SERVER_CERTIFICATE, - STORE_DFSP_SC_SERVER_CERTIFICATE, - DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, - DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, - DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, -} from './types'; - -function* storeDfspSCServerCertificate() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.dfspServerCerts.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setDfspSCRootCertificate({ certificate: response.data.rootCertificate })); - yield put(setDfspSCIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDfspSCServerCertificate({ certificate: response.data.serverCertificate })); - yield put(setDfspSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); - yield put( - setDfspSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) - ); - yield put(setDfspSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo })); - yield put(setDfspSCValidations({ validations: response.data.validations })); - yield put(setDfspSCValidationState({ validationState: response.data.validationState })); - } else if (!is404(response.status)) { - yield put(showErrorModal('Error Loading SC Server Certificate')); - } - } catch (error) { - yield put(showErrorModal(error.message)); - } -} - -export function* StoreDfspSCServerCertificateSaga() { - yield takeLatest(STORE_DFSP_SC_SERVER_CERTIFICATE, storeDfspSCServerCertificate); -} - -function* submitDfspSCServerCertificate() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const rootCertificate = getDfspSCRootCertificate(state); - const intermediateChain = getDfspSCIntermediateChain(state); - const serverCertificate = getDfspSCServerCertificate(state); - const body = { rootCertificate, intermediateChain, serverCertificate }; - - let response; - if (getIsDfspSCEditingExistingModel(state)) { - response = yield call(apis.dfspServerCerts.update, { environmentId, body }); - } else { - response = yield call(apis.dfspServerCerts.create, { environmentId, body }); - } - - if (is20x(response.status)) { - yield put(showToast()); - - yield put(setDfspSCRootCertificate({ certificate: response.data.rootCertificate })); - yield put(setDfspSCIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDfspSCServerCertificate({ certificate: response.data.serverCertificate })); - yield put(setDfspSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); - yield put( - setDfspSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) - ); - yield put(setDfspSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo })); - yield put(setDfspSCValidations({ validations: response.data.validations })); - yield put(setDfspSCValidationState({ validationState: response.data.validationState })); - } else { - yield put(showErrorModal('Error Submitting SC Server Certificate')); - } - } catch (error) { - yield put(showErrorModal(error.message)); - } -} - -export function* SubmitDfspSCServerCertificateSaga() { - yield takeLatest(SUBMIT_DFSP_SC_SERVER_CERTIFICATE, submitDfspSCServerCertificate); -} - -export function* downloadDfspSCRootCertificate() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const rootCertificate = getDfspSCRootCertificate(state); - downloadFile(rootCertificate, `${environmentName}-root.pem`); -} - -export function* DownloadDfspSCRootCertificateSaga() { - yield takeLatest(DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, downloadDfspSCRootCertificate); -} - -export function* downloadDfspSCIntermediateChain() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const intermediateChain = getDfspSCIntermediateChain(state); - downloadFile(intermediateChain, `${environmentName}-intermediates.pem`); -} - -export function* DownloadDfspSCIntermediateChainSaga() { - yield takeLatest(DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, downloadDfspSCIntermediateChain); -} - -export function* downloadDfspSCServerCertificate() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const rootCertificate = getDfspSCServerCertificate(state); - downloadFile(rootCertificate, `${environmentName}-server.pem`); -} - -export function* DownloadDfspSCServerCertificateSaga() { - yield takeLatest(DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, downloadDfspSCServerCertificate); -} - -export default function* rootSaga() { - yield all([ - StoreDfspSCServerCertificateSaga(), - SubmitDfspSCServerCertificateSaga(), - DownloadDfspSCRootCertificateSaga(), - DownloadDfspSCIntermediateChainSaga(), - DownloadDfspSCServerCertificateSaga(), - ]); -} +import { call, all, put, select, takeLatest } from 'redux-saga/effects'; +import { is20x, is404 } from 'utils/http'; +import { downloadFile } from 'utils/html'; +import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { showToast, showErrorModal } from 'App/actions'; +import apis from 'utils/apis'; +import { + setDfspSCRootCertificate, + setDfspSCIntermediateChain, + setDfspSCServerCertificate, + setDfspSCRootCertificateInfo, + setDfspSCIntermediateChainInfo, + setDfspSCServerCertificateInfo, + setDfspSCValidations, + setDfspSCValidationState, +} from './actions'; +import { + getDfspSCRootCertificate, + getDfspSCIntermediateChain, + getDfspSCServerCertificate, + getIsDfspSCEditingExistingModel, +} from './selectors'; +import { + SUBMIT_DFSP_SC_SERVER_CERTIFICATE, + STORE_DFSP_SC_SERVER_CERTIFICATE, + DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, + DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, + DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, +} from './types'; + +function* storeDfspSCServerCertificate() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.dfspServerCerts.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setDfspSCRootCertificate({ certificate: response.data.rootCertificate })); + yield put(setDfspSCIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDfspSCServerCertificate({ certificate: response.data.serverCertificate })); + yield put(setDfspSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); + yield put( + setDfspSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) + ); + yield put(setDfspSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo })); + yield put(setDfspSCValidations({ validations: response.data.validations })); + yield put(setDfspSCValidationState({ validationState: response.data.validationState })); + } else if (!is404(response.status)) { + yield put(showErrorModal('Error Loading SC Server Certificate')); + } + } catch (error) { + yield put(showErrorModal(error.message)); + } +} + +export function* StoreDfspSCServerCertificateSaga() { + yield takeLatest(STORE_DFSP_SC_SERVER_CERTIFICATE, storeDfspSCServerCertificate); +} + +function* submitDfspSCServerCertificate() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const rootCertificate = getDfspSCRootCertificate(state); + const intermediateChain = getDfspSCIntermediateChain(state); + const serverCertificate = getDfspSCServerCertificate(state); + const body = { rootCertificate, intermediateChain, serverCertificate }; + + let response; + if (getIsDfspSCEditingExistingModel(state)) { + response = yield call(apis.dfspServerCerts.update, { environmentId, body }); + } else { + response = yield call(apis.dfspServerCerts.create, { environmentId, body }); + } + + if (is20x(response.status)) { + yield put(showToast()); + + yield put(setDfspSCRootCertificate({ certificate: response.data.rootCertificate })); + yield put(setDfspSCIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDfspSCServerCertificate({ certificate: response.data.serverCertificate })); + yield put(setDfspSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); + yield put( + setDfspSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) + ); + yield put(setDfspSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo })); + yield put(setDfspSCValidations({ validations: response.data.validations })); + yield put(setDfspSCValidationState({ validationState: response.data.validationState })); + } else { + yield put(showErrorModal('Error Submitting SC Server Certificate')); + } + } catch (error) { + yield put(showErrorModal(error.message)); + } +} + +export function* SubmitDfspSCServerCertificateSaga() { + yield takeLatest(SUBMIT_DFSP_SC_SERVER_CERTIFICATE, submitDfspSCServerCertificate); +} + +export function* downloadDfspSCRootCertificate() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const rootCertificate = getDfspSCRootCertificate(state); + downloadFile(rootCertificate, `${environmentName}-root.pem`); +} + +export function* DownloadDfspSCRootCertificateSaga() { + yield takeLatest(DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE, downloadDfspSCRootCertificate); +} + +export function* downloadDfspSCIntermediateChain() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const intermediateChain = getDfspSCIntermediateChain(state); + downloadFile(intermediateChain, `${environmentName}-intermediates.pem`); +} + +export function* DownloadDfspSCIntermediateChainSaga() { + yield takeLatest(DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN, downloadDfspSCIntermediateChain); +} + +export function* downloadDfspSCServerCertificate() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const rootCertificate = getDfspSCServerCertificate(state); + downloadFile(rootCertificate, `${environmentName}-server.pem`); +} + +export function* DownloadDfspSCServerCertificateSaga() { + yield takeLatest(DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE, downloadDfspSCServerCertificate); +} + +export default function* rootSaga() { + yield all([ + StoreDfspSCServerCertificateSaga(), + SubmitDfspSCServerCertificateSaga(), + DownloadDfspSCRootCertificateSaga(), + DownloadDfspSCIntermediateChainSaga(), + DownloadDfspSCServerCertificateSaga(), + ]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/selectors.ts index 24c03be..20e5526 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/selectors.ts @@ -1,99 +1,99 @@ -import { State } from 'store/types'; -import { createSelector } from 'reselect'; -import { isPending } from 'utils/api'; - -import * as testers from 'utils/testers'; - -export const getDfspSCError = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCError; -export const getPreviousDfspSCRootCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.previousDfspSCRootCertificate || ''; -export const getPreviousDfspSCIntermediateChain = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.previousDfspSCIntermediateChain || ''; -export const getPreviousDfspSCServerCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.previousDfspSCServerCertificate || ''; -export const getDfspSCRootCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCRootCertificate || ''; -export const getDfspSCIntermediateChain = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCIntermediateChain || ''; -export const getDfspSCServerCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCServerCertificate || ''; -export const getDfspSCRootCertificateInfo = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCRootCertificateInfo; -export const getDfspSCIntermediateChainInfo = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCIntermediateChainInfo; -export const getDfspSCServerCertificateInfo = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCServerCertificateInfo; -export const getDfspSCValidations = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCValidations; -export const getDfspSCValidationState = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.dfspSCValidationState; -export const getIsDfspSCRootCertificateModalVisible = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.isDfspSCRootCertificateModalVisible; -export const getIsDfspSCIntermediateChainModalVisible = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.isDfspSCIntermediateChainModalVisible; -export const getIsDfspSCServerCertificateModalVisible = (state: State) => - state.wizard.environment.tls.tlsserver.dfsps.isDfspSCServerCertificateModalVisible; - -export const getIsDfspSCReadPending = createSelector( - (state: State) => state.api, - isPending('dfspServerCerts.read') -); - -const buildDfspSCModel = ( - rootCertificate: string, - intermediateChain: string, - serverCertificate: string -) => ({ - rootCertificate, - intermediateChain, - serverCertificate, -}); -const getPreviousDfspSCModel = createSelector( - getPreviousDfspSCRootCertificate, - getPreviousDfspSCIntermediateChain, - getPreviousDfspSCServerCertificate, - buildDfspSCModel -); -export const getDfspSCModel = createSelector( - getDfspSCRootCertificate, - getDfspSCIntermediateChain, - getDfspSCServerCertificate, - buildDfspSCModel -); - -const getIsDfspSCModelChanged = createSelector( - getPreviousDfspSCModel, - getDfspSCModel, - testers.isNotEqual -); -const getIsDfspSCServerCertificateValid = createSelector( - getDfspSCServerCertificate, - testers.isNotNil -); - -export const getIsDfspSCEditingExistingModel = createSelector( - getPreviousDfspSCServerCertificate, - testers.isNotNilNorEmpty -); -export const getIsDfspSCSubmitEnabled = createSelector( - getIsDfspSCServerCertificateValid, - getIsDfspSCModelChanged, - testers.getAllAre(true) -); - -export const getIsDfspSCCreatePending = createSelector( - (state: State) => state.api, - isPending('dfspServerCerts.create') -); - -export const getIsDfspSCUpdatePending = createSelector( - (state: State) => state.api, - isPending('dfspServerCerts.update') -); - -export const getIsDfspSCSubmitPending = createSelector( - getIsDfspSCCreatePending, - getIsDfspSCUpdatePending, - testers.getAnyIs(true) -); +import { State } from 'store/types'; +import { createSelector } from 'reselect'; +import { isPending } from 'utils/api'; + +import * as testers from 'utils/testers'; + +export const getDfspSCError = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCError; +export const getPreviousDfspSCRootCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.previousDfspSCRootCertificate || ''; +export const getPreviousDfspSCIntermediateChain = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.previousDfspSCIntermediateChain || ''; +export const getPreviousDfspSCServerCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.previousDfspSCServerCertificate || ''; +export const getDfspSCRootCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCRootCertificate || ''; +export const getDfspSCIntermediateChain = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCIntermediateChain || ''; +export const getDfspSCServerCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCServerCertificate || ''; +export const getDfspSCRootCertificateInfo = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCRootCertificateInfo; +export const getDfspSCIntermediateChainInfo = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCIntermediateChainInfo; +export const getDfspSCServerCertificateInfo = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCServerCertificateInfo; +export const getDfspSCValidations = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCValidations; +export const getDfspSCValidationState = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.dfspSCValidationState; +export const getIsDfspSCRootCertificateModalVisible = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.isDfspSCRootCertificateModalVisible; +export const getIsDfspSCIntermediateChainModalVisible = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.isDfspSCIntermediateChainModalVisible; +export const getIsDfspSCServerCertificateModalVisible = (state: State) => + state.wizard.environment.tls.tlsserver.dfsps.isDfspSCServerCertificateModalVisible; + +export const getIsDfspSCReadPending = createSelector( + (state: State) => state.api, + isPending('dfspServerCerts.read') +); + +const buildDfspSCModel = ( + rootCertificate: string, + intermediateChain: string, + serverCertificate: string +) => ({ + rootCertificate, + intermediateChain, + serverCertificate, +}); +const getPreviousDfspSCModel = createSelector( + getPreviousDfspSCRootCertificate, + getPreviousDfspSCIntermediateChain, + getPreviousDfspSCServerCertificate, + buildDfspSCModel +); +export const getDfspSCModel = createSelector( + getDfspSCRootCertificate, + getDfspSCIntermediateChain, + getDfspSCServerCertificate, + buildDfspSCModel +); + +const getIsDfspSCModelChanged = createSelector( + getPreviousDfspSCModel, + getDfspSCModel, + testers.isNotEqual +); +const getIsDfspSCServerCertificateValid = createSelector( + getDfspSCServerCertificate, + testers.isNotNil +); + +export const getIsDfspSCEditingExistingModel = createSelector( + getPreviousDfspSCServerCertificate, + testers.isNotNilNorEmpty +); +export const getIsDfspSCSubmitEnabled = createSelector( + getIsDfspSCServerCertificateValid, + getIsDfspSCModelChanged, + testers.getAllAre(true) +); + +export const getIsDfspSCCreatePending = createSelector( + (state: State) => state.api, + isPending('dfspServerCerts.create') +); + +export const getIsDfspSCUpdatePending = createSelector( + (state: State) => state.api, + isPending('dfspServerCerts.update') +); + +export const getIsDfspSCSubmitPending = createSelector( + getIsDfspSCCreatePending, + getIsDfspSCUpdatePending, + testers.getAnyIs(true) +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/types.ts index ed885d3..0da32f6 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/types.ts @@ -1,173 +1,173 @@ -import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; - -export const RESET_DFSP_SC = 'DFSP SC / Reset'; -export const SET_DFSP_SC_ERROR = 'DFSP SC / Set Root Cert Error'; -export const SET_DFSP_SC_ROOT_CERTIFICATE = 'DFSP SC / Set Root Certificate'; -export const SET_DFSP_SC_INTERMEDIATE_CHAIN = 'DFSP SC / Set Intermediate Chain'; -export const SET_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Set Server Certificate'; -export const SET_DFSP_SC_ROOT_CERTIFICATE_INFO = 'DFSP SC / Set Root Certificate Info'; -export const SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO = 'DFSP SC / Set Intermediate Chain Info'; -export const SET_DFSP_SC_SERVER_CERTIFICATE_INFO = 'DFSP SC / Set Server Certificate Info'; -export const SET_DFSP_SC_VALIDATIONS = 'DFSP SC / Set Validations'; -export const SET_DFSP_SC_VALIDATION_STATE = 'DFSP SC / Set Validation State'; -export const CHANGE_DFSP_SC_ROOT_CERTIFICATE = 'DFSP SC / Change Root Certificate'; -export const CHANGE_DFSP_SC_INTERMEDIATE_CHAIN = 'DFSP SC / Change Intermediate Chain'; -export const CHANGE_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Change Server Certificate'; -export const SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL = 'DFSP SC / Show Root Certificate Modal'; -export const HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL = 'DFSP SC / Hide Root Certificate Modal'; -export const SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL = 'DFSP SC / Show Intermediate Chain Modal'; -export const HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL = 'DFSP SC / Hide Intermediate Chain Modal'; -export const SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL = 'DFSP SC / Show Server Certificate Modal'; -export const HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL = 'DFSP SC / Hide Server Certificate Modal'; -export const SUBMIT_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Submit Server Certificate'; -export const STORE_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Store Server Certificate'; -export const DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE = 'DFSP SC / Download Root Certificate'; -export const DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN = 'DFSP SC / Download Intermediate Chain'; -export const DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Download Server Certificate'; - -export interface ResetDfspSCAction { - type: typeof RESET_DFSP_SC; -} - -export interface SetDfspSCErrorAction { - type: typeof SET_DFSP_SC_ERROR; - error: string; -} - -export interface SetDfspSCRootCertificateAction { - type: typeof SET_DFSP_SC_ROOT_CERTIFICATE; - certificate: string; -} - -export interface SetDfspSCIntermediateChainAction { - type: typeof SET_DFSP_SC_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface SetDfspSCServerCertificateAction { - type: typeof SET_DFSP_SC_SERVER_CERTIFICATE; - certificate: string; -} - -export interface SetDfspSCRootCertificateInfoAction { - type: typeof SET_DFSP_SC_ROOT_CERTIFICATE_INFO; - certInfo: CertInfo; -} - -export interface SetDfspSCIntermediateChainInfoAction { - type: typeof SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO; - certInfo: CertInfo; -} - -export interface SetDfspSCServerCertificateInfoAction { - type: typeof SET_DFSP_SC_SERVER_CERTIFICATE_INFO; - certInfo: CertInfo; -} - -export interface SetDfspSCValidationsAction { - type: typeof SET_DFSP_SC_VALIDATIONS; - validations: CertificateValidationResults[]; -} - -export interface SetDfspSCValidationStateAction { - type: typeof SET_DFSP_SC_VALIDATION_STATE; - validationState: string | undefined; -} - -export interface ShowDfspSCRootCertificateModalAction { - type: typeof SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL; -} - -export interface ChangeDfspSCRootCertificateAction { - type: typeof CHANGE_DFSP_SC_ROOT_CERTIFICATE; - certificate: string; -} - -export interface ChangeDfspSCIntermediateChainAction { - type: typeof CHANGE_DFSP_SC_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface ChangeDfspSCServerCertificateAction { - type: typeof CHANGE_DFSP_SC_SERVER_CERTIFICATE; - certificate: string; -} - -export interface HideDfspSCRootCertificateModalAction { - type: typeof HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL; -} - -export interface ShowDfspSCIntermediateChainModalAction { - type: typeof SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL; -} - -export interface HideDfspSCIntermediateChainModalAction { - type: typeof HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL; -} - -export interface ShowDfspSCServerCertificateModalAction { - type: typeof SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL; -} - -export interface HideDfspSCServerCertificateModalAction { - type: typeof HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL; -} - -export interface SubmitDfspSCServerCertificateAction { - type: typeof SUBMIT_DFSP_SC_SERVER_CERTIFICATE; -} - -export interface StoreDfspSCServerCertificateAction { - type: typeof STORE_DFSP_SC_SERVER_CERTIFICATE; -} - -export interface DownloadDfspSCRootCertificateAction { - type: typeof DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE; -} - -export interface DownloadDfspSCIntermediateChainAction { - type: typeof DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN; -} - -export interface DownloadDfspSCServerCertificateAction { - type: typeof DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE; -} - -export type DfspSCActionTypes = - | SetDfspSCErrorAction - | ResetDfspSCAction - | SetDfspSCRootCertificateAction - | SetDfspSCIntermediateChainAction - | SetDfspSCServerCertificateAction - | SetDfspSCRootCertificateInfoAction - | SetDfspSCIntermediateChainInfoAction - | SetDfspSCServerCertificateInfoAction - | SetDfspSCValidationsAction - | SetDfspSCValidationStateAction - | ShowDfspSCRootCertificateModalAction - | ChangeDfspSCRootCertificateAction - | ChangeDfspSCIntermediateChainAction - | ChangeDfspSCServerCertificateAction - | HideDfspSCRootCertificateModalAction - | ShowDfspSCIntermediateChainModalAction - | HideDfspSCIntermediateChainModalAction - | ShowDfspSCServerCertificateModalAction - | HideDfspSCServerCertificateModalAction; - -export interface DfspSCState { - dfspSCError?: ErrorMessage; - previousDfspSCRootCertificate?: string; - previousDfspSCIntermediateChain?: string; - previousDfspSCServerCertificate?: string; - dfspSCRootCertificate?: string; - dfspSCIntermediateChain?: string; - dfspSCServerCertificate?: string; - dfspSCRootCertificateInfo?: CertInfo; - dfspSCIntermediateChainInfo?: CertInfo; - dfspSCServerCertificateInfo?: CertInfo; - dfspSCValidations: CertificateValidationResults[]; - dfspSCValidationState?: string; - isDfspSCRootCertificateModalVisible: boolean; - isDfspSCIntermediateChainModalVisible: boolean; - isDfspSCServerCertificateModalVisible: boolean; -} +import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; + +export const RESET_DFSP_SC = 'DFSP SC / Reset'; +export const SET_DFSP_SC_ERROR = 'DFSP SC / Set Root Cert Error'; +export const SET_DFSP_SC_ROOT_CERTIFICATE = 'DFSP SC / Set Root Certificate'; +export const SET_DFSP_SC_INTERMEDIATE_CHAIN = 'DFSP SC / Set Intermediate Chain'; +export const SET_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Set Server Certificate'; +export const SET_DFSP_SC_ROOT_CERTIFICATE_INFO = 'DFSP SC / Set Root Certificate Info'; +export const SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO = 'DFSP SC / Set Intermediate Chain Info'; +export const SET_DFSP_SC_SERVER_CERTIFICATE_INFO = 'DFSP SC / Set Server Certificate Info'; +export const SET_DFSP_SC_VALIDATIONS = 'DFSP SC / Set Validations'; +export const SET_DFSP_SC_VALIDATION_STATE = 'DFSP SC / Set Validation State'; +export const CHANGE_DFSP_SC_ROOT_CERTIFICATE = 'DFSP SC / Change Root Certificate'; +export const CHANGE_DFSP_SC_INTERMEDIATE_CHAIN = 'DFSP SC / Change Intermediate Chain'; +export const CHANGE_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Change Server Certificate'; +export const SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL = 'DFSP SC / Show Root Certificate Modal'; +export const HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL = 'DFSP SC / Hide Root Certificate Modal'; +export const SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL = 'DFSP SC / Show Intermediate Chain Modal'; +export const HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL = 'DFSP SC / Hide Intermediate Chain Modal'; +export const SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL = 'DFSP SC / Show Server Certificate Modal'; +export const HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL = 'DFSP SC / Hide Server Certificate Modal'; +export const SUBMIT_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Submit Server Certificate'; +export const STORE_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Store Server Certificate'; +export const DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE = 'DFSP SC / Download Root Certificate'; +export const DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN = 'DFSP SC / Download Intermediate Chain'; +export const DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE = 'DFSP SC / Download Server Certificate'; + +export interface ResetDfspSCAction { + type: typeof RESET_DFSP_SC; +} + +export interface SetDfspSCErrorAction { + type: typeof SET_DFSP_SC_ERROR; + error: string; +} + +export interface SetDfspSCRootCertificateAction { + type: typeof SET_DFSP_SC_ROOT_CERTIFICATE; + certificate: string; +} + +export interface SetDfspSCIntermediateChainAction { + type: typeof SET_DFSP_SC_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface SetDfspSCServerCertificateAction { + type: typeof SET_DFSP_SC_SERVER_CERTIFICATE; + certificate: string; +} + +export interface SetDfspSCRootCertificateInfoAction { + type: typeof SET_DFSP_SC_ROOT_CERTIFICATE_INFO; + certInfo: CertInfo; +} + +export interface SetDfspSCIntermediateChainInfoAction { + type: typeof SET_DFSP_SC_INTERMEDIATE_CHAIN_INFO; + certInfo: CertInfo; +} + +export interface SetDfspSCServerCertificateInfoAction { + type: typeof SET_DFSP_SC_SERVER_CERTIFICATE_INFO; + certInfo: CertInfo; +} + +export interface SetDfspSCValidationsAction { + type: typeof SET_DFSP_SC_VALIDATIONS; + validations: CertificateValidationResults[]; +} + +export interface SetDfspSCValidationStateAction { + type: typeof SET_DFSP_SC_VALIDATION_STATE; + validationState: string | undefined; +} + +export interface ShowDfspSCRootCertificateModalAction { + type: typeof SHOW_DFSP_SC_ROOT_CERTIFICATE_MODAL; +} + +export interface ChangeDfspSCRootCertificateAction { + type: typeof CHANGE_DFSP_SC_ROOT_CERTIFICATE; + certificate: string; +} + +export interface ChangeDfspSCIntermediateChainAction { + type: typeof CHANGE_DFSP_SC_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface ChangeDfspSCServerCertificateAction { + type: typeof CHANGE_DFSP_SC_SERVER_CERTIFICATE; + certificate: string; +} + +export interface HideDfspSCRootCertificateModalAction { + type: typeof HIDE_DFSP_SC_ROOT_CERTIFICATE_MODAL; +} + +export interface ShowDfspSCIntermediateChainModalAction { + type: typeof SHOW_DFSP_SC_INTERMEDIATE_CHAIN_MODAL; +} + +export interface HideDfspSCIntermediateChainModalAction { + type: typeof HIDE_DFSP_SC_INTERMEDIATE_CHAIN_MODAL; +} + +export interface ShowDfspSCServerCertificateModalAction { + type: typeof SHOW_DFSP_SC_SERVER_CERTIFICATE_MODAL; +} + +export interface HideDfspSCServerCertificateModalAction { + type: typeof HIDE_DFSP_SC_SERVER_CERTIFICATE_MODAL; +} + +export interface SubmitDfspSCServerCertificateAction { + type: typeof SUBMIT_DFSP_SC_SERVER_CERTIFICATE; +} + +export interface StoreDfspSCServerCertificateAction { + type: typeof STORE_DFSP_SC_SERVER_CERTIFICATE; +} + +export interface DownloadDfspSCRootCertificateAction { + type: typeof DOWNLOAD_DFSP_SC_ROOT_CERTIFICATE; +} + +export interface DownloadDfspSCIntermediateChainAction { + type: typeof DOWNLOAD_DFSP_SC_INTERMEDIATE_CHAIN; +} + +export interface DownloadDfspSCServerCertificateAction { + type: typeof DOWNLOAD_DFSP_SC_SERVER_CERTIFICATE; +} + +export type DfspSCActionTypes = + | SetDfspSCErrorAction + | ResetDfspSCAction + | SetDfspSCRootCertificateAction + | SetDfspSCIntermediateChainAction + | SetDfspSCServerCertificateAction + | SetDfspSCRootCertificateInfoAction + | SetDfspSCIntermediateChainInfoAction + | SetDfspSCServerCertificateInfoAction + | SetDfspSCValidationsAction + | SetDfspSCValidationStateAction + | ShowDfspSCRootCertificateModalAction + | ChangeDfspSCRootCertificateAction + | ChangeDfspSCIntermediateChainAction + | ChangeDfspSCServerCertificateAction + | HideDfspSCRootCertificateModalAction + | ShowDfspSCIntermediateChainModalAction + | HideDfspSCIntermediateChainModalAction + | ShowDfspSCServerCertificateModalAction + | HideDfspSCServerCertificateModalAction; + +export interface DfspSCState { + dfspSCError?: ErrorMessage; + previousDfspSCRootCertificate?: string; + previousDfspSCIntermediateChain?: string; + previousDfspSCServerCertificate?: string; + dfspSCRootCertificate?: string; + dfspSCIntermediateChain?: string; + dfspSCServerCertificate?: string; + dfspSCRootCertificateInfo?: CertInfo; + dfspSCIntermediateChainInfo?: CertInfo; + dfspSCServerCertificateInfo?: CertInfo; + dfspSCValidations: CertificateValidationResults[]; + dfspSCValidationState?: string; + isDfspSCRootCertificateModalVisible: boolean; + isDfspSCIntermediateChainModalVisible: boolean; + isDfspSCServerCertificateModalVisible: boolean; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/HubSC.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/HubSC.tsx index 0ef62aa..b874534 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/HubSC.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/HubSC.tsx @@ -1,245 +1,245 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { - CertificateInfo, - CertificateModal, - CertificateValidation, - FileControls, - FormInput, - MessageBox, -} from 'components'; -import { AnyAction } from 'redux'; -import { withMount } from 'utils/hocs'; -import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; -import { CertificateValidationResults, CertInfo } from 'App/types'; -import { State, Dispatch } from 'store/types'; -import { - storeDfspHubSCServerCertificate, - downloadDfspHubSCRootCertificate, - showDfspHubSCRootCertificateModal, - hideDfspHubSCRootCertificateModal, - downloadDfspHubSCIntermediateChain, - showDfspHubSCIntermediateChainModal, - hideDfspHubSCIntermediateChainModal, - downloadDfspHubSCServerCertificate, - showDfspHubSCServerCertificateModal, - hideDfspHubSCServerCertificateModal, -} from './actions'; -import { - getDfspHubSCError, - getDfspHubSCRootCertificate, - getDfspHubSCIntermediateChain, - getDfspHubSCServerCertificate, - getDfspHubSCRootCertificateInfo, - getDfspHubSCIntermediateChainInfo, - getDfspHubSCServerCertificateInfo, - getDfspHubSCValidations, - getDfspHubSCValidationState, - getIsDfspHubSCRootCertificateModalVisible, - getIsDfspHubSCIntermediateChainModalVisible, - getIsDfspHubSCServerCertificateModalVisible, - getIsDfspHubSCCreatePending, -} from './selectors'; - -import './index.css'; - -const stateProps = (state: State) => ({ - environmentName: getEnvironmentName(state), - error: getDfspHubSCError(state), - rootCertificate: getDfspHubSCRootCertificate(state), - intermediateChain: getDfspHubSCIntermediateChain(state), - serverCertificate: getDfspHubSCServerCertificate(state), - rootCertificateInfo: getDfspHubSCRootCertificateInfo(state), - intermediateChainInfo: getDfspHubSCIntermediateChainInfo(state), - serverCertificateInfo: getDfspHubSCServerCertificateInfo(state), - validations: getDfspHubSCValidations(state), - validationState: getDfspHubSCValidationState(state), - isRootCertificateModalVisible: getIsDfspHubSCRootCertificateModalVisible(state), - isIntermediateChainModalVisible: getIsDfspHubSCIntermediateChainModalVisible(state), - isServerCertificateModalVisible: getIsDfspHubSCServerCertificateModalVisible(state), - isSubmitPending: getIsDfspHubSCCreatePending(state), -}); - -const actionProps = (dispatch: Dispatch) => ({ - onMount: () => dispatch(storeDfspHubSCServerCertificate()), - onRootCertificateViewClick: () => dispatch(showDfspHubSCRootCertificateModal()), - onRootCertificateDownloadClick: () => dispatch(downloadDfspHubSCRootCertificate()), - onRootCertificateModalCloseClick: () => dispatch(hideDfspHubSCRootCertificateModal()), - onIntermediateChainDownloadClick: () => dispatch(downloadDfspHubSCIntermediateChain()), - onIntermediateChainViewClick: () => dispatch(showDfspHubSCIntermediateChainModal()), - onIntermediateChainModalCloseClick: () => dispatch(hideDfspHubSCIntermediateChainModal()), - onServerCertificateViewClick: () => dispatch(showDfspHubSCServerCertificateModal()), - onServerCertificateDownloadClick: () => dispatch(downloadDfspHubSCServerCertificate()), - onServerCertificateModalCloseClick: () => dispatch(hideDfspHubSCServerCertificateModal()), -}); - -interface DfspHubSCProps { - environmentName: string; - error?: string; - rootCertificate: string; - intermediateChain: string; - serverCertificate: string; - rootCertificateInfo?: CertInfo; - intermediateChainInfo?: CertInfo; - serverCertificateInfo?: CertInfo; - validations: CertificateValidationResults[]; - validationState?: string; - isRootCertificateModalVisible: boolean; - isIntermediateChainModalVisible: boolean; - isServerCertificateModalVisible: boolean; - isSubmitEnabled: boolean; - isSubmitPending: boolean; - isReadPending: boolean; - onRootCertificateChange: (certificate: string) => void; - onRootCertificateViewClick: () => void; - onRootCertificateDownloadClick: () => AnyAction; - onRootCertificateModalCloseClick: () => void; - onIntermediateChainChange: (certificate: string) => void; - onIntermediateChainViewClick: () => void; - onIntermediateChainDownloadClick: () => AnyAction; - onIntermediateChainModalCloseClick: () => void; - onServerCertificateChange: (certificate: string) => void; - onServerCertificateViewClick: () => void; - onServerCertificateDownloadClick: () => AnyAction; - onServerCertificateModalCloseClick: () => void; - onCreateCertificateClick: () => void; -} - -const HubSC: FC = ({ - environmentName, - error, - rootCertificate, - intermediateChain, - serverCertificate, - rootCertificateInfo, - intermediateChainInfo, - serverCertificateInfo, - validations, - validationState, - isRootCertificateModalVisible, - isIntermediateChainModalVisible, - isServerCertificateModalVisible, - isSubmitPending, - onRootCertificateViewClick, - onRootCertificateDownloadClick, - onRootCertificateModalCloseClick, - onIntermediateChainViewClick, - onIntermediateChainDownloadClick, - onIntermediateChainModalCloseClick, - onServerCertificateViewClick, - onServerCertificateDownloadClick, - onServerCertificateModalCloseClick, -}) => { - if (error) { - return ( - - ); - } - return ( -
-
- -
- -
-
- - {serverCertificate && ( - - )} -
- {serverCertificateInfo && } -
- -
-
- - {rootCertificate && ( - - )} -
- {rootCertificateInfo && } -
- -
-
- - {intermediateChain && ( - - )} -
- {intermediateChainInfo && } -
- - {isRootCertificateModalVisible && ( - - )} - {isIntermediateChainModalVisible && ( - - )} - {isServerCertificateModalVisible && ( - - )} -
- ); -}; - -const MountedHubSC = withMount(HubSC, 'onMount'); - -export default connect(stateProps, actionProps)(MountedHubSC); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { + CertificateInfo, + CertificateModal, + CertificateValidation, + FileControls, + FormInput, + MessageBox, +} from 'components'; +import { AnyAction } from 'redux'; +import { withMount } from 'utils/hocs'; +import { getEnvironmentName } from 'App/ConnectionWizard/selectors'; +import { CertificateValidationResults, CertInfo } from 'App/types'; +import { State, Dispatch } from 'store/types'; +import { + storeDfspHubSCServerCertificate, + downloadDfspHubSCRootCertificate, + showDfspHubSCRootCertificateModal, + hideDfspHubSCRootCertificateModal, + downloadDfspHubSCIntermediateChain, + showDfspHubSCIntermediateChainModal, + hideDfspHubSCIntermediateChainModal, + downloadDfspHubSCServerCertificate, + showDfspHubSCServerCertificateModal, + hideDfspHubSCServerCertificateModal, +} from './actions'; +import { + getDfspHubSCError, + getDfspHubSCRootCertificate, + getDfspHubSCIntermediateChain, + getDfspHubSCServerCertificate, + getDfspHubSCRootCertificateInfo, + getDfspHubSCIntermediateChainInfo, + getDfspHubSCServerCertificateInfo, + getDfspHubSCValidations, + getDfspHubSCValidationState, + getIsDfspHubSCRootCertificateModalVisible, + getIsDfspHubSCIntermediateChainModalVisible, + getIsDfspHubSCServerCertificateModalVisible, + getIsDfspHubSCCreatePending, +} from './selectors'; + +import './index.css'; + +const stateProps = (state: State) => ({ + environmentName: getEnvironmentName(state), + error: getDfspHubSCError(state), + rootCertificate: getDfspHubSCRootCertificate(state), + intermediateChain: getDfspHubSCIntermediateChain(state), + serverCertificate: getDfspHubSCServerCertificate(state), + rootCertificateInfo: getDfspHubSCRootCertificateInfo(state), + intermediateChainInfo: getDfspHubSCIntermediateChainInfo(state), + serverCertificateInfo: getDfspHubSCServerCertificateInfo(state), + validations: getDfspHubSCValidations(state), + validationState: getDfspHubSCValidationState(state), + isRootCertificateModalVisible: getIsDfspHubSCRootCertificateModalVisible(state), + isIntermediateChainModalVisible: getIsDfspHubSCIntermediateChainModalVisible(state), + isServerCertificateModalVisible: getIsDfspHubSCServerCertificateModalVisible(state), + isSubmitPending: getIsDfspHubSCCreatePending(state), +}); + +const actionProps = (dispatch: Dispatch) => ({ + onMount: () => dispatch(storeDfspHubSCServerCertificate()), + onRootCertificateViewClick: () => dispatch(showDfspHubSCRootCertificateModal()), + onRootCertificateDownloadClick: () => dispatch(downloadDfspHubSCRootCertificate()), + onRootCertificateModalCloseClick: () => dispatch(hideDfspHubSCRootCertificateModal()), + onIntermediateChainDownloadClick: () => dispatch(downloadDfspHubSCIntermediateChain()), + onIntermediateChainViewClick: () => dispatch(showDfspHubSCIntermediateChainModal()), + onIntermediateChainModalCloseClick: () => dispatch(hideDfspHubSCIntermediateChainModal()), + onServerCertificateViewClick: () => dispatch(showDfspHubSCServerCertificateModal()), + onServerCertificateDownloadClick: () => dispatch(downloadDfspHubSCServerCertificate()), + onServerCertificateModalCloseClick: () => dispatch(hideDfspHubSCServerCertificateModal()), +}); + +interface DfspHubSCProps { + environmentName: string; + error?: string; + rootCertificate: string; + intermediateChain: string; + serverCertificate: string; + rootCertificateInfo?: CertInfo; + intermediateChainInfo?: CertInfo; + serverCertificateInfo?: CertInfo; + validations: CertificateValidationResults[]; + validationState?: string; + isRootCertificateModalVisible: boolean; + isIntermediateChainModalVisible: boolean; + isServerCertificateModalVisible: boolean; + isSubmitEnabled: boolean; + isSubmitPending: boolean; + isReadPending: boolean; + onRootCertificateChange: (certificate: string) => void; + onRootCertificateViewClick: () => void; + onRootCertificateDownloadClick: () => AnyAction; + onRootCertificateModalCloseClick: () => void; + onIntermediateChainChange: (certificate: string) => void; + onIntermediateChainViewClick: () => void; + onIntermediateChainDownloadClick: () => AnyAction; + onIntermediateChainModalCloseClick: () => void; + onServerCertificateChange: (certificate: string) => void; + onServerCertificateViewClick: () => void; + onServerCertificateDownloadClick: () => AnyAction; + onServerCertificateModalCloseClick: () => void; + onCreateCertificateClick: () => void; +} + +const HubSC: FC = ({ + environmentName, + error, + rootCertificate, + intermediateChain, + serverCertificate, + rootCertificateInfo, + intermediateChainInfo, + serverCertificateInfo, + validations, + validationState, + isRootCertificateModalVisible, + isIntermediateChainModalVisible, + isServerCertificateModalVisible, + isSubmitPending, + onRootCertificateViewClick, + onRootCertificateDownloadClick, + onRootCertificateModalCloseClick, + onIntermediateChainViewClick, + onIntermediateChainDownloadClick, + onIntermediateChainModalCloseClick, + onServerCertificateViewClick, + onServerCertificateDownloadClick, + onServerCertificateModalCloseClick, +}) => { + if (error) { + return ( + + ); + } + return ( +
+
+ +
+ +
+
+ + {serverCertificate && ( + + )} +
+ {serverCertificateInfo && } +
+ +
+
+ + {rootCertificate && ( + + )} +
+ {rootCertificateInfo && } +
+ +
+
+ + {intermediateChain && ( + + )} +
+ {intermediateChainInfo && } +
+ + {isRootCertificateModalVisible && ( + + )} + {isIntermediateChainModalVisible && ( + + )} + {isServerCertificateModalVisible && ( + + )} +
+ ); +}; + +const MountedHubSC = withMount(HubSC, 'onMount'); + +export default connect(stateProps, actionProps)(MountedHubSC); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/_mockData.js b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/_mockData.js index 8516637..4d25fd3 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/_mockData.js +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/_mockData.js @@ -1,49 +1,49 @@ -const Validation = { - validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', - performed: true, - result: 'VALID', - message: 'Validation Test Message', - messageTemplate: 'Textual description of the validation result', - data: {}, - details: 'Test Details', -}; - -const CertInfo = { - subject: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - issuer: { - CN: 'cnvalue', - emailAddress: 'e@mail.com', - O: 'Org', - OU: 'OrgUnit', - C: 'SriLanka', - ST: 'None', - L: 'Central America', - }, - subjectAlternativeNames: ['alt1', 'alt2'], - serialNumber: '17159976289428250189079625547205715159', - notBefore: '2019-02-04T00:00:00Z', - notAfter: '2020-02-12T12:00:00Z', - signatureAlgorithm: 'SHA256WithRSA', -}; - -export const tlsServerCertHubSCMock = { - rootCertificate: - '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', - intermediateChain: - '-----BEGIN CERTIFICATE-----MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', - serverCertificate: - '-----BEGIN CERTIFICATE-----VJEA8KbtyX+r8snwU5C1hUrwaW6MWOARa8qBpNQcWTkaIeoYvy/sGIJEmjR0vFEwHdp1cSaWIr6/4g72n7OqXwfinu7ZYW97EfoOSQJeAzAgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHfCuFCaZ3Z2sS3ChtCDoH6mfrpLMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd/cGYYuMDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdvb2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb2-----END CERTIFICATE-----', - validations: [Validation], - validationState: 'VALID', - rootCertificateInfo: CertInfo, - intermediateChainInfo: [CertInfo], - serverCertificateInfo: CertInfo, -}; +const Validation = { + validationCode: 'CSR_CERT_SAME_PUBLIC_KEY', + performed: true, + result: 'VALID', + message: 'Validation Test Message', + messageTemplate: 'Textual description of the validation result', + data: {}, + details: 'Test Details', +}; + +const CertInfo = { + subject: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + issuer: { + CN: 'cnvalue', + emailAddress: 'e@mail.com', + O: 'Org', + OU: 'OrgUnit', + C: 'SriLanka', + ST: 'None', + L: 'Central America', + }, + subjectAlternativeNames: ['alt1', 'alt2'], + serialNumber: '17159976289428250189079625547205715159', + notBefore: '2019-02-04T00:00:00Z', + notAfter: '2020-02-12T12:00:00Z', + signatureAlgorithm: 'SHA256WithRSA', +}; + +export const tlsServerCertHubSCMock = { + rootCertificate: + '-----BEGIN CERTIFICATE-----MIIEizCCA3OgAwIBAgIQDI7gyQ1qiRWIBAYe4kH5rzANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3+rZ8uckJ2/0lYDblizkVIvP6hnZf1WZUXoOLRg9eFhSvGNoVwvdRLNXSmDmyHBwW4coatc7TlJFGa8kBpJIER-----END CERTIFICATE-----', + intermediateChain: + '-----BEGIN CERTIFICATE-----MIIEXDCCA0SgAwIBAgINAeOpMBz8cgY4P5pTHTANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0xNzA2MTUwMDAwNDJaFw0yMTEyMTUwMDAwNDJaMFQxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVHb29n-----END CERTIFICATE-----', + serverCertificate: + '-----BEGIN CERTIFICATE-----VJEA8KbtyX+r8snwU5C1hUrwaW6MWOARa8qBpNQcWTkaIeoYvy/sGIJEmjR0vFEwHdp1cSaWIr6/4g72n7OqXwfinu7ZYW97EfoOSQJeAzAgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFHfCuFCaZ3Z2sS3ChtCDoH6mfrpLMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd/cGYYuMDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdvb2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb2-----END CERTIFICATE-----', + validations: [Validation], + validationState: 'VALID', + rootCertificateInfo: CertInfo, + intermediateChainInfo: [CertInfo], + serverCertificateInfo: CertInfo, +}; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/actions.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/actions.ts index 4090e6c..e4bbdd8 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/actions.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/actions.ts @@ -1,251 +1,251 @@ -import { CertificateValidationResults, CertInfo } from 'App/types'; -import { - RESET_DFSP_HUB_SC, - SET_DFSP_HUB_SC_ERROR, - SET_DFSP_HUB_SC_ROOT_CERTIFICATE, - SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - SET_DFSP_HUB_SC_SERVER_CERTIFICATE, - SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO, - SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO, - SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO, - SET_DFSP_HUB_SC_VALIDATIONS, - SET_DFSP_HUB_SC_VALIDATION_STATE, - SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, - HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, - SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, - HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, - SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, - HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, - ResetDfspHubSCAction, - SetDfspHubSCErrorAction, - SetDfspHubSCRootCertificateAction, - SetDfspHubSCIntermediateChainAction, - SetDfspHubSCServerCertificateAction, - SetDfspHubSCRootCertificateInfoAction, - SetDfspHubSCIntermediateChainInfoAction, - SetDfspHubSCServerCertificateInfoAction, - SetDfspHubSCValidationsAction, - SetDfspHubSCValidationStateAction, - ShowDfspHubSCRootCertificateModalAction, - ChangeDfspHubSCRootCertificateAction, - CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE, - ChangeDfspHubSCIntermediateChainAction, - CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - ChangeDfspHubSCServerCertificateAction, - CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE, - HideDfspHubSCRootCertificateModalAction, - ShowDfspHubSCIntermediateChainModalAction, - HideDfspHubSCIntermediateChainModalAction, - ShowDfspHubSCServerCertificateModalAction, - HideDfspHubSCServerCertificateModalAction, - SubmitDfspHubSCServerCertificateAction, - SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, - DownloadDfspHubSCRootCertificateAction, - DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, - DownloadDfspHubSCIntermediateChainAction, - DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, - DownloadDfspHubSCServerCertificateAction, - StoreDfspHubSCServerCertificateAction, - STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, -} from './types'; - -export function resetDfspHubSC(): ResetDfspHubSCAction { - return { - type: RESET_DFSP_HUB_SC, - }; -} - -export function setDfspHubSCError({ error }: { error: string }): SetDfspHubSCErrorAction { - return { - type: SET_DFSP_HUB_SC_ERROR, - error, - }; -} - -export function setDfspHubSCRootCertificate({ - certificate, -}: { - certificate: string; -}): SetDfspHubSCRootCertificateAction { - return { - type: SET_DFSP_HUB_SC_ROOT_CERTIFICATE, - certificate, - }; -} - -export function setDfspHubSCIntermediateChain({ - certificate, -}: { - certificate: string; -}): SetDfspHubSCIntermediateChainAction { - return { - type: SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function setDfspHubSCServerCertificate({ - certificate, -}: { - certificate: string; -}): SetDfspHubSCServerCertificateAction { - return { - type: SET_DFSP_HUB_SC_SERVER_CERTIFICATE, - certificate, - }; -} - -export function setDfspHubSCRootCertificateInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspHubSCRootCertificateInfoAction { - return { - type: SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO, - certInfo, - }; -} - -export function setDfspHubSCIntermediateChainInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspHubSCIntermediateChainInfoAction { - return { - type: SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO, - certInfo, - }; -} - -export function setDfspHubSCServerCertificateInfo({ - certInfo, -}: { - certInfo: CertInfo; -}): SetDfspHubSCServerCertificateInfoAction { - return { - type: SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO, - certInfo, - }; -} - -export function setDfspHubSCValidations({ - validations, -}: { - validations: CertificateValidationResults[]; -}): SetDfspHubSCValidationsAction { - return { - type: SET_DFSP_HUB_SC_VALIDATIONS, - validations, - }; -} - -export function setDfspHubSCValidationState({ - validationState, -}: { - validationState: string | undefined; -}): SetDfspHubSCValidationStateAction { - return { - type: SET_DFSP_HUB_SC_VALIDATION_STATE, - validationState, - }; -} - -export function showDfspHubSCRootCertificateModal(): ShowDfspHubSCRootCertificateModalAction { - return { - type: SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, - }; -} - -export function changeDfspHubSCRootCertificate({ - certificate, -}: { - certificate: string; -}): ChangeDfspHubSCRootCertificateAction { - return { - type: CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE, - certificate, - }; -} - -export function changeDfspHubSCIntermediateChain({ - certificate, -}: { - certificate: string; -}): ChangeDfspHubSCIntermediateChainAction { - return { - type: CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - certificate, - }; -} - -export function changeDfspHubSCServerCertificate({ - certificate, -}: { - certificate: string; -}): ChangeDfspHubSCServerCertificateAction { - return { - type: CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE, - certificate, - }; -} - -export function hideDfspHubSCRootCertificateModal(): HideDfspHubSCRootCertificateModalAction { - return { - type: HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, - }; -} - -export function showDfspHubSCIntermediateChainModal(): ShowDfspHubSCIntermediateChainModalAction { - return { - type: SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function hideDfspHubSCIntermediateChainModal(): HideDfspHubSCIntermediateChainModalAction { - return { - type: HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, - }; -} - -export function showDfspHubSCServerCertificateModal(): ShowDfspHubSCServerCertificateModalAction { - return { - type: SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, - }; -} - -export function hideDfspHubSCServerCertificateModal(): HideDfspHubSCServerCertificateModalAction { - return { - type: HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, - }; -} - -export function submitDfspHubSCServerCertificate(): SubmitDfspHubSCServerCertificateAction { - return { - type: SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, - }; -} - -export function storeDfspHubSCServerCertificate(): StoreDfspHubSCServerCertificateAction { - return { - type: STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, - }; -} - -export function downloadDfspHubSCRootCertificate(): DownloadDfspHubSCRootCertificateAction { - return { - type: DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, - }; -} - -export function downloadDfspHubSCIntermediateChain(): DownloadDfspHubSCIntermediateChainAction { - return { - type: DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - }; -} - -export function downloadDfspHubSCServerCertificate(): DownloadDfspHubSCServerCertificateAction { - return { - type: DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, - }; -} +import { CertificateValidationResults, CertInfo } from 'App/types'; +import { + RESET_DFSP_HUB_SC, + SET_DFSP_HUB_SC_ERROR, + SET_DFSP_HUB_SC_ROOT_CERTIFICATE, + SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + SET_DFSP_HUB_SC_SERVER_CERTIFICATE, + SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO, + SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO, + SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO, + SET_DFSP_HUB_SC_VALIDATIONS, + SET_DFSP_HUB_SC_VALIDATION_STATE, + SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, + HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, + SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, + HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, + SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, + HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, + ResetDfspHubSCAction, + SetDfspHubSCErrorAction, + SetDfspHubSCRootCertificateAction, + SetDfspHubSCIntermediateChainAction, + SetDfspHubSCServerCertificateAction, + SetDfspHubSCRootCertificateInfoAction, + SetDfspHubSCIntermediateChainInfoAction, + SetDfspHubSCServerCertificateInfoAction, + SetDfspHubSCValidationsAction, + SetDfspHubSCValidationStateAction, + ShowDfspHubSCRootCertificateModalAction, + ChangeDfspHubSCRootCertificateAction, + CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE, + ChangeDfspHubSCIntermediateChainAction, + CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + ChangeDfspHubSCServerCertificateAction, + CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE, + HideDfspHubSCRootCertificateModalAction, + ShowDfspHubSCIntermediateChainModalAction, + HideDfspHubSCIntermediateChainModalAction, + ShowDfspHubSCServerCertificateModalAction, + HideDfspHubSCServerCertificateModalAction, + SubmitDfspHubSCServerCertificateAction, + SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, + DownloadDfspHubSCRootCertificateAction, + DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, + DownloadDfspHubSCIntermediateChainAction, + DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, + DownloadDfspHubSCServerCertificateAction, + StoreDfspHubSCServerCertificateAction, + STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, +} from './types'; + +export function resetDfspHubSC(): ResetDfspHubSCAction { + return { + type: RESET_DFSP_HUB_SC, + }; +} + +export function setDfspHubSCError({ error }: { error: string }): SetDfspHubSCErrorAction { + return { + type: SET_DFSP_HUB_SC_ERROR, + error, + }; +} + +export function setDfspHubSCRootCertificate({ + certificate, +}: { + certificate: string; +}): SetDfspHubSCRootCertificateAction { + return { + type: SET_DFSP_HUB_SC_ROOT_CERTIFICATE, + certificate, + }; +} + +export function setDfspHubSCIntermediateChain({ + certificate, +}: { + certificate: string; +}): SetDfspHubSCIntermediateChainAction { + return { + type: SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function setDfspHubSCServerCertificate({ + certificate, +}: { + certificate: string; +}): SetDfspHubSCServerCertificateAction { + return { + type: SET_DFSP_HUB_SC_SERVER_CERTIFICATE, + certificate, + }; +} + +export function setDfspHubSCRootCertificateInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspHubSCRootCertificateInfoAction { + return { + type: SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO, + certInfo, + }; +} + +export function setDfspHubSCIntermediateChainInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspHubSCIntermediateChainInfoAction { + return { + type: SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO, + certInfo, + }; +} + +export function setDfspHubSCServerCertificateInfo({ + certInfo, +}: { + certInfo: CertInfo; +}): SetDfspHubSCServerCertificateInfoAction { + return { + type: SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO, + certInfo, + }; +} + +export function setDfspHubSCValidations({ + validations, +}: { + validations: CertificateValidationResults[]; +}): SetDfspHubSCValidationsAction { + return { + type: SET_DFSP_HUB_SC_VALIDATIONS, + validations, + }; +} + +export function setDfspHubSCValidationState({ + validationState, +}: { + validationState: string | undefined; +}): SetDfspHubSCValidationStateAction { + return { + type: SET_DFSP_HUB_SC_VALIDATION_STATE, + validationState, + }; +} + +export function showDfspHubSCRootCertificateModal(): ShowDfspHubSCRootCertificateModalAction { + return { + type: SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, + }; +} + +export function changeDfspHubSCRootCertificate({ + certificate, +}: { + certificate: string; +}): ChangeDfspHubSCRootCertificateAction { + return { + type: CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE, + certificate, + }; +} + +export function changeDfspHubSCIntermediateChain({ + certificate, +}: { + certificate: string; +}): ChangeDfspHubSCIntermediateChainAction { + return { + type: CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + certificate, + }; +} + +export function changeDfspHubSCServerCertificate({ + certificate, +}: { + certificate: string; +}): ChangeDfspHubSCServerCertificateAction { + return { + type: CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE, + certificate, + }; +} + +export function hideDfspHubSCRootCertificateModal(): HideDfspHubSCRootCertificateModalAction { + return { + type: HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, + }; +} + +export function showDfspHubSCIntermediateChainModal(): ShowDfspHubSCIntermediateChainModalAction { + return { + type: SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function hideDfspHubSCIntermediateChainModal(): HideDfspHubSCIntermediateChainModalAction { + return { + type: HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, + }; +} + +export function showDfspHubSCServerCertificateModal(): ShowDfspHubSCServerCertificateModalAction { + return { + type: SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, + }; +} + +export function hideDfspHubSCServerCertificateModal(): HideDfspHubSCServerCertificateModalAction { + return { + type: HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, + }; +} + +export function submitDfspHubSCServerCertificate(): SubmitDfspHubSCServerCertificateAction { + return { + type: SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, + }; +} + +export function storeDfspHubSCServerCertificate(): StoreDfspHubSCServerCertificateAction { + return { + type: STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, + }; +} + +export function downloadDfspHubSCRootCertificate(): DownloadDfspHubSCRootCertificateAction { + return { + type: DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, + }; +} + +export function downloadDfspHubSCIntermediateChain(): DownloadDfspHubSCIntermediateChainAction { + return { + type: DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + }; +} + +export function downloadDfspHubSCServerCertificate(): DownloadDfspHubSCServerCertificateAction { + return { + type: DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, + }; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.css b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.css index 68bf1d1..f8bbb83 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.css +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.css @@ -1,22 +1,22 @@ -.hub-sc { - margin-top: 10px; -} - -.hub-sc__certificate-validation { - width: 400px; - margin: 10px 0px; -} - -.hub-sc__certificate-item { - margin-bottom: 20px; -} - -.hub-sc__root-certificate, -.hub-sc__intermediate-chain, -.hub-sc__server-certificate { - width: 400px; - display: flex; - flex-direction: row; - align-items: flex-end; - margin-bottom: 20px; -} +.hub-sc { + margin-top: 10px; +} + +.hub-sc__certificate-validation { + width: 400px; + margin: 10px 0px; +} + +.hub-sc__certificate-item { + margin-bottom: 20px; +} + +.hub-sc__root-certificate, +.hub-sc__intermediate-chain, +.hub-sc__server-certificate { + width: 400px; + display: flex; + flex-direction: row; + align-items: flex-end; + margin-bottom: 20px; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.ts index 77692c6..b4077af 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/index.ts @@ -1,9 +1,9 @@ -import HubSC from './HubSC'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; -import sagas from './sagas'; - -export default HubSC; -export { actions, reducer, selectors, types, sagas }; +import HubSC from './HubSC'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; +import sagas from './sagas'; + +export default HubSC; +export { actions, reducer, selectors, types, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/reducers.ts index eca19d1..8a70798 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/reducers.ts @@ -1,202 +1,202 @@ -import { - RESET_DFSP_HUB_SC, - SET_DFSP_HUB_SC_ERROR, - SET_DFSP_HUB_SC_ROOT_CERTIFICATE, - SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - SET_DFSP_HUB_SC_SERVER_CERTIFICATE, - SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO, - SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO, - SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO, - SET_DFSP_HUB_SC_VALIDATIONS, - SET_DFSP_HUB_SC_VALIDATION_STATE, - CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE, - CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE, - SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, - HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, - SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, - HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, - SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, - HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, - DfspHubSCActionTypes, - DfspHubSCState, -} from './types'; - -const initialState = { - dfspHubSCError: null, - previousDfspHubSCRootCertificate: undefined, - previousDfspHubSCIntermediateChain: undefined, - previousDfspHubSCServerCertificate: undefined, - dfspHubSCRootCertificate: undefined, - dfspHubSCIntermediateChain: undefined, - dfspHubSCServerCertificate: undefined, - dfspHubSCRootCertificateInfo: undefined, - dfspHubSCIntermediateChainInfo: undefined, - dfspHubSCServerCertificateInfo: undefined, - dfspHubSCValidations: [], - dfspHubSCValidationState: undefined, - isDfspHubSCRootCertificateModalVisible: false, - isDfspHubSCIntermediateChainModalVisible: false, - isDfspHubSCServerCertificateModalVisible: false, -}; - -export default function dfspHubSCReducer( - state = initialState, - action: DfspHubSCActionTypes -): DfspHubSCState { - switch (action.type) { - case RESET_DFSP_HUB_SC: { - return initialState; - } - - case SET_DFSP_HUB_SC_ERROR: { - return { - ...state, - dfspHubSCError: action.error, - }; - } - - case SET_DFSP_HUB_SC_ROOT_CERTIFICATE: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspHubSCRootCertificate: action.certificate, - dfspHubSCRootCertificate: action.certificate, - }; - } - - case SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspHubSCIntermediateChain: action.certificate, - dfspHubSCIntermediateChain: action.certificate, - }; - } - - case SET_DFSP_HUB_SC_SERVER_CERTIFICATE: { - // the server sends null for a non-existing certificate - // causing the ui to fail on the fileuploader component - // so it needs to be stored as an undefined value - return { - ...state, - previousDfspHubSCServerCertificate: action.certificate, - dfspHubSCServerCertificate: action.certificate, - }; - } - - case SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO: { - return { - ...state, - dfspHubSCRootCertificateInfo: action.certInfo, - }; - } - - case SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO: { - return { - ...state, - dfspHubSCIntermediateChainInfo: action.certInfo, - }; - } - - case SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO: { - return { - ...state, - dfspHubSCServerCertificateInfo: action.certInfo, - }; - } - - case SET_DFSP_HUB_SC_VALIDATIONS: { - return { - ...state, - dfspHubSCValidations: action.validations, - }; - } - - case SET_DFSP_HUB_SC_VALIDATION_STATE: { - return { - ...state, - dfspHubSCValidationState: action.validationState, - }; - } - - case CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE: { - return { - ...state, - dfspHubSCRootCertificate: action.certificate, - dfspHubSCRootCertificateInfo: initialState.dfspHubSCRootCertificateInfo, - dfspHubSCValidationState: initialState.dfspHubSCValidationState, - dfspHubSCValidations: initialState.dfspHubSCValidations, - }; - } - - case CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN: { - return { - ...state, - dfspHubSCIntermediateChain: action.certificate, - dfspHubSCIntermediateChainInfo: initialState.dfspHubSCIntermediateChainInfo, - dfspHubSCValidationState: initialState.dfspHubSCValidationState, - dfspHubSCValidations: initialState.dfspHubSCValidations, - }; - } - - case CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE: { - return { - ...state, - dfspHubSCServerCertificate: action.certificate, - dfspHubSCServerCertificateInfo: initialState.dfspHubSCServerCertificateInfo, - dfspHubSCValidationState: initialState.dfspHubSCValidationState, - dfspHubSCValidations: initialState.dfspHubSCValidations, - }; - } - - case SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL: { - return { - ...state, - isDfspHubSCRootCertificateModalVisible: true, - }; - } - - case HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL: { - return { - ...state, - isDfspHubSCRootCertificateModalVisible: false, - }; - } - - case SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isDfspHubSCIntermediateChainModalVisible: true, - }; - } - - case HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL: { - return { - ...state, - isDfspHubSCIntermediateChainModalVisible: false, - }; - } - - case SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL: { - return { - ...state, - isDfspHubSCServerCertificateModalVisible: true, - }; - } - - case HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL: { - return { - ...state, - isDfspHubSCServerCertificateModalVisible: false, - }; - } - - default: - return state; - } -} +import { + RESET_DFSP_HUB_SC, + SET_DFSP_HUB_SC_ERROR, + SET_DFSP_HUB_SC_ROOT_CERTIFICATE, + SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + SET_DFSP_HUB_SC_SERVER_CERTIFICATE, + SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO, + SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO, + SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO, + SET_DFSP_HUB_SC_VALIDATIONS, + SET_DFSP_HUB_SC_VALIDATION_STATE, + CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE, + CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE, + SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, + HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL, + SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, + HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL, + SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, + HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL, + DfspHubSCActionTypes, + DfspHubSCState, +} from './types'; + +const initialState = { + dfspHubSCError: null, + previousDfspHubSCRootCertificate: undefined, + previousDfspHubSCIntermediateChain: undefined, + previousDfspHubSCServerCertificate: undefined, + dfspHubSCRootCertificate: undefined, + dfspHubSCIntermediateChain: undefined, + dfspHubSCServerCertificate: undefined, + dfspHubSCRootCertificateInfo: undefined, + dfspHubSCIntermediateChainInfo: undefined, + dfspHubSCServerCertificateInfo: undefined, + dfspHubSCValidations: [], + dfspHubSCValidationState: undefined, + isDfspHubSCRootCertificateModalVisible: false, + isDfspHubSCIntermediateChainModalVisible: false, + isDfspHubSCServerCertificateModalVisible: false, +}; + +export default function dfspHubSCReducer( + state = initialState, + action: DfspHubSCActionTypes +): DfspHubSCState { + switch (action.type) { + case RESET_DFSP_HUB_SC: { + return initialState; + } + + case SET_DFSP_HUB_SC_ERROR: { + return { + ...state, + dfspHubSCError: action.error, + }; + } + + case SET_DFSP_HUB_SC_ROOT_CERTIFICATE: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspHubSCRootCertificate: action.certificate, + dfspHubSCRootCertificate: action.certificate, + }; + } + + case SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspHubSCIntermediateChain: action.certificate, + dfspHubSCIntermediateChain: action.certificate, + }; + } + + case SET_DFSP_HUB_SC_SERVER_CERTIFICATE: { + // the server sends null for a non-existing certificate + // causing the ui to fail on the fileuploader component + // so it needs to be stored as an undefined value + return { + ...state, + previousDfspHubSCServerCertificate: action.certificate, + dfspHubSCServerCertificate: action.certificate, + }; + } + + case SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO: { + return { + ...state, + dfspHubSCRootCertificateInfo: action.certInfo, + }; + } + + case SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO: { + return { + ...state, + dfspHubSCIntermediateChainInfo: action.certInfo, + }; + } + + case SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO: { + return { + ...state, + dfspHubSCServerCertificateInfo: action.certInfo, + }; + } + + case SET_DFSP_HUB_SC_VALIDATIONS: { + return { + ...state, + dfspHubSCValidations: action.validations, + }; + } + + case SET_DFSP_HUB_SC_VALIDATION_STATE: { + return { + ...state, + dfspHubSCValidationState: action.validationState, + }; + } + + case CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE: { + return { + ...state, + dfspHubSCRootCertificate: action.certificate, + dfspHubSCRootCertificateInfo: initialState.dfspHubSCRootCertificateInfo, + dfspHubSCValidationState: initialState.dfspHubSCValidationState, + dfspHubSCValidations: initialState.dfspHubSCValidations, + }; + } + + case CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN: { + return { + ...state, + dfspHubSCIntermediateChain: action.certificate, + dfspHubSCIntermediateChainInfo: initialState.dfspHubSCIntermediateChainInfo, + dfspHubSCValidationState: initialState.dfspHubSCValidationState, + dfspHubSCValidations: initialState.dfspHubSCValidations, + }; + } + + case CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE: { + return { + ...state, + dfspHubSCServerCertificate: action.certificate, + dfspHubSCServerCertificateInfo: initialState.dfspHubSCServerCertificateInfo, + dfspHubSCValidationState: initialState.dfspHubSCValidationState, + dfspHubSCValidations: initialState.dfspHubSCValidations, + }; + } + + case SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL: { + return { + ...state, + isDfspHubSCRootCertificateModalVisible: true, + }; + } + + case HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL: { + return { + ...state, + isDfspHubSCRootCertificateModalVisible: false, + }; + } + + case SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isDfspHubSCIntermediateChainModalVisible: true, + }; + } + + case HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL: { + return { + ...state, + isDfspHubSCIntermediateChainModalVisible: false, + }; + } + + case SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL: { + return { + ...state, + isDfspHubSCServerCertificateModalVisible: true, + }; + } + + case HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL: { + return { + ...state, + isDfspHubSCServerCertificateModalVisible: false, + }; + } + + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/sagas.ts index edcfd5f..70526ad 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/sagas.ts @@ -1,146 +1,146 @@ -import { all, put, select, takeLatest, call } from 'redux-saga/effects'; -import { is20x, is404 } from 'utils/http'; -import { downloadFile } from 'utils/html'; -import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; -import { showToast, showErrorModal } from 'App/actions'; -import apis from 'utils/apis'; -import { - setDfspHubSCRootCertificate, - setDfspHubSCIntermediateChain, - setDfspHubSCServerCertificate, - setDfspHubSCRootCertificateInfo, - setDfspHubSCIntermediateChainInfo, - setDfspHubSCServerCertificateInfo, - setDfspHubSCValidations, - setDfspHubSCValidationState, -} from './actions'; -import { - getDfspHubSCRootCertificate, - getDfspHubSCIntermediateChain, - getDfspHubSCServerCertificate, - getIsDfspHubSCEditingExistingModel, -} from './selectors'; -import { - SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, - STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, - DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, - DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, - DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, -} from './types'; - -function* storeDfspHubSCServerCertificate() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const response = yield call(apis.hubServerCerts.read, { environmentId }); - - if (is20x(response.status)) { - yield put(setDfspHubSCRootCertificate({ certificate: response.data.rootCertificate })); - yield put(setDfspHubSCIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDfspHubSCServerCertificate({ certificate: response.data.serverCertificate })); - yield put(setDfspHubSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); - yield put( - setDfspHubSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) - ); - yield put( - setDfspHubSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo }) - ); - yield put(setDfspHubSCValidations({ validations: response.data.validations })); - yield put(setDfspHubSCValidationState({ validationState: response.data.validationState })); - } else if (!is404(response.status)) { - yield put(showErrorModal('Error Loading SC Server Certificate')); - } - } catch (error) { - yield put(showErrorModal(error.message)); - } -} - -export function* StoreDfspHubSCServerCertificateSaga() { - yield takeLatest(STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, storeDfspHubSCServerCertificate); -} - -function* submitDfspHubSCServerCertificate() { - try { - const state = yield select(); - const environmentId = getEnvironmentId(state); - const rootCertificate = getDfspHubSCRootCertificate(state); - const intermediateChain = getDfspHubSCIntermediateChain(state); - const serverCertificate = getDfspHubSCServerCertificate(state); - const body = { rootCertificate, intermediateChain, serverCertificate }; - let response; - - if (getIsDfspHubSCEditingExistingModel(state)) { - response = yield call(apis.hubServerCerts.update, { environmentId, body }); - } else { - response = yield call(apis.hubServerCerts.create, { environmentId, body }); - } - - if (is20x(response.status)) { - yield put(showToast()); - - yield put(setDfspHubSCRootCertificate({ certificate: response.data.rootCertificate })); - yield put(setDfspHubSCIntermediateChain({ certificate: response.data.intermediateChain })); - yield put(setDfspHubSCServerCertificate({ certificate: response.data.serverCertificate })); - yield put(setDfspHubSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); - yield put( - setDfspHubSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) - ); - yield put( - setDfspHubSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo }) - ); - yield put(setDfspHubSCValidations({ validations: response.data.validations })); - yield put(setDfspHubSCValidationState({ validationState: response.data.validationState })); - } else { - yield put(showErrorModal('Error Submitting SC Server Certificate')); - } - } catch (error) { - yield put(showErrorModal(error.message)); - } -} - -export function* SubmitDfspHubSCServerCertificateSaga() { - yield takeLatest(SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, submitDfspHubSCServerCertificate); -} - -export function* downloadDfspHubSCRootCertificate() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const rootCertificate = getDfspHubSCRootCertificate(state); - downloadFile(rootCertificate, `${environmentName}-root.pem`); -} - -export function* DownloadDfspHubSCRootCertificateSaga() { - yield takeLatest(DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, downloadDfspHubSCRootCertificate); -} - -export function* downloadDfspHubSCIntermediateChain() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const intermediateChain = getDfspHubSCIntermediateChain(state); - downloadFile(intermediateChain, `${environmentName}-intermediates.pem`); -} - -export function* DownloadDfspHubSCIntermediateChainSaga() { - yield takeLatest(DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, downloadDfspHubSCIntermediateChain); -} - -export function* downloadDfspHubSCServerCertificate() { - const state = yield select(); - const environmentName = getEnvironmentName(state); - const rootCertificate = getDfspHubSCServerCertificate(state); - downloadFile(rootCertificate, `${environmentName}-server.pem`); -} - -export function* DownloadDfspHubSCServerCertificateSaga() { - yield takeLatest(DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, downloadDfspHubSCServerCertificate); -} - -export default function* rootSaga() { - yield all([ - StoreDfspHubSCServerCertificateSaga(), - SubmitDfspHubSCServerCertificateSaga(), - DownloadDfspHubSCRootCertificateSaga(), - DownloadDfspHubSCIntermediateChainSaga(), - DownloadDfspHubSCServerCertificateSaga(), - ]); -} +import { all, put, select, takeLatest, call } from 'redux-saga/effects'; +import { is20x, is404 } from 'utils/http'; +import { downloadFile } from 'utils/html'; +import { getEnvironmentName, getEnvironmentId } from 'App/ConnectionWizard/selectors'; +import { showToast, showErrorModal } from 'App/actions'; +import apis from 'utils/apis'; +import { + setDfspHubSCRootCertificate, + setDfspHubSCIntermediateChain, + setDfspHubSCServerCertificate, + setDfspHubSCRootCertificateInfo, + setDfspHubSCIntermediateChainInfo, + setDfspHubSCServerCertificateInfo, + setDfspHubSCValidations, + setDfspHubSCValidationState, +} from './actions'; +import { + getDfspHubSCRootCertificate, + getDfspHubSCIntermediateChain, + getDfspHubSCServerCertificate, + getIsDfspHubSCEditingExistingModel, +} from './selectors'; +import { + SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, + STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, + DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, + DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, + DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, +} from './types'; + +function* storeDfspHubSCServerCertificate() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const response = yield call(apis.hubServerCerts.read, { environmentId }); + + if (is20x(response.status)) { + yield put(setDfspHubSCRootCertificate({ certificate: response.data.rootCertificate })); + yield put(setDfspHubSCIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDfspHubSCServerCertificate({ certificate: response.data.serverCertificate })); + yield put(setDfspHubSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); + yield put( + setDfspHubSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) + ); + yield put( + setDfspHubSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo }) + ); + yield put(setDfspHubSCValidations({ validations: response.data.validations })); + yield put(setDfspHubSCValidationState({ validationState: response.data.validationState })); + } else if (!is404(response.status)) { + yield put(showErrorModal('Error Loading SC Server Certificate')); + } + } catch (error) { + yield put(showErrorModal(error.message)); + } +} + +export function* StoreDfspHubSCServerCertificateSaga() { + yield takeLatest(STORE_DFSP_HUB_SC_SERVER_CERTIFICATE, storeDfspHubSCServerCertificate); +} + +function* submitDfspHubSCServerCertificate() { + try { + const state = yield select(); + const environmentId = getEnvironmentId(state); + const rootCertificate = getDfspHubSCRootCertificate(state); + const intermediateChain = getDfspHubSCIntermediateChain(state); + const serverCertificate = getDfspHubSCServerCertificate(state); + const body = { rootCertificate, intermediateChain, serverCertificate }; + let response; + + if (getIsDfspHubSCEditingExistingModel(state)) { + response = yield call(apis.hubServerCerts.update, { environmentId, body }); + } else { + response = yield call(apis.hubServerCerts.create, { environmentId, body }); + } + + if (is20x(response.status)) { + yield put(showToast()); + + yield put(setDfspHubSCRootCertificate({ certificate: response.data.rootCertificate })); + yield put(setDfspHubSCIntermediateChain({ certificate: response.data.intermediateChain })); + yield put(setDfspHubSCServerCertificate({ certificate: response.data.serverCertificate })); + yield put(setDfspHubSCRootCertificateInfo({ certInfo: response.data.rootCertificateInfo })); + yield put( + setDfspHubSCIntermediateChainInfo({ certInfo: response.data.intermediateChainInfo[0] }) + ); + yield put( + setDfspHubSCServerCertificateInfo({ certInfo: response.data.serverCertificateInfo }) + ); + yield put(setDfspHubSCValidations({ validations: response.data.validations })); + yield put(setDfspHubSCValidationState({ validationState: response.data.validationState })); + } else { + yield put(showErrorModal('Error Submitting SC Server Certificate')); + } + } catch (error) { + yield put(showErrorModal(error.message)); + } +} + +export function* SubmitDfspHubSCServerCertificateSaga() { + yield takeLatest(SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE, submitDfspHubSCServerCertificate); +} + +export function* downloadDfspHubSCRootCertificate() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const rootCertificate = getDfspHubSCRootCertificate(state); + downloadFile(rootCertificate, `${environmentName}-root.pem`); +} + +export function* DownloadDfspHubSCRootCertificateSaga() { + yield takeLatest(DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE, downloadDfspHubSCRootCertificate); +} + +export function* downloadDfspHubSCIntermediateChain() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const intermediateChain = getDfspHubSCIntermediateChain(state); + downloadFile(intermediateChain, `${environmentName}-intermediates.pem`); +} + +export function* DownloadDfspHubSCIntermediateChainSaga() { + yield takeLatest(DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN, downloadDfspHubSCIntermediateChain); +} + +export function* downloadDfspHubSCServerCertificate() { + const state = yield select(); + const environmentName = getEnvironmentName(state); + const rootCertificate = getDfspHubSCServerCertificate(state); + downloadFile(rootCertificate, `${environmentName}-server.pem`); +} + +export function* DownloadDfspHubSCServerCertificateSaga() { + yield takeLatest(DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE, downloadDfspHubSCServerCertificate); +} + +export default function* rootSaga() { + yield all([ + StoreDfspHubSCServerCertificateSaga(), + SubmitDfspHubSCServerCertificateSaga(), + DownloadDfspHubSCRootCertificateSaga(), + DownloadDfspHubSCIntermediateChainSaga(), + DownloadDfspHubSCServerCertificateSaga(), + ]); +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/selectors.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/selectors.ts index 0aa929e..fd616ec 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/selectors.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/selectors.ts @@ -1,99 +1,99 @@ -import { State } from 'store/types'; -import { createSelector } from 'reselect'; -import { isPending } from 'utils/api'; - -import * as testers from 'utils/testers'; - -export const getDfspHubSCError = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCError; -export const getPreviousDfspHubSCRootCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.previousDfspHubSCRootCertificate || ''; -export const getPreviousDfspHubSCIntermediateChain = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.previousDfspHubSCIntermediateChain || ''; -export const getPreviousDfspHubSCServerCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.previousDfspHubSCServerCertificate || ''; -export const getDfspHubSCRootCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCRootCertificate || ''; -export const getDfspHubSCIntermediateChain = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCIntermediateChain || ''; -export const getDfspHubSCServerCertificate = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCServerCertificate || ''; -export const getDfspHubSCRootCertificateInfo = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCRootCertificateInfo; -export const getDfspHubSCIntermediateChainInfo = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCIntermediateChainInfo; -export const getDfspHubSCServerCertificateInfo = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCServerCertificateInfo; -export const getDfspHubSCValidations = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCValidations; -export const getDfspHubSCValidationState = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCValidationState; -export const getIsDfspHubSCRootCertificateModalVisible = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.isDfspHubSCRootCertificateModalVisible; -export const getIsDfspHubSCIntermediateChainModalVisible = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.isDfspHubSCIntermediateChainModalVisible; -export const getIsDfspHubSCServerCertificateModalVisible = (state: State) => - state.wizard.environment.tls.tlsserver.hubsc.isDfspHubSCServerCertificateModalVisible; - -export const getIsDfspHubSCReadPending = createSelector( - (state: State) => state.api, - isPending('dfspServerCerts.read') -); - -const buildDfspHubSCModel = ( - rootCertificate: string, - intermediateChain: string, - serverCertificate: string -) => ({ - rootCertificate, - intermediateChain, - serverCertificate, -}); -const getPreviousDfspHubSCModel = createSelector( - getPreviousDfspHubSCRootCertificate, - getPreviousDfspHubSCIntermediateChain, - getPreviousDfspHubSCServerCertificate, - buildDfspHubSCModel -); -export const getDfspHubSCModel = createSelector( - getDfspHubSCRootCertificate, - getDfspHubSCIntermediateChain, - getDfspHubSCServerCertificate, - buildDfspHubSCModel -); - -const getIsDfspHubSCModelChanged = createSelector( - getPreviousDfspHubSCModel, - getDfspHubSCModel, - testers.isNotEqual -); -const getIsDfspHubSCServerCertificateValid = createSelector( - getDfspHubSCServerCertificate, - testers.isNotNil -); - -export const getIsDfspHubSCEditingExistingModel = createSelector( - getPreviousDfspHubSCServerCertificate, - testers.isNotNil -); -export const getIsDfspHubSCSubmitEnabled = createSelector( - getIsDfspHubSCServerCertificateValid, - getIsDfspHubSCModelChanged, - testers.getAllAre(true) -); - -export const getIsDfspHubSCCreatePending = createSelector( - (state: State) => state.api, - isPending('hubServerCerts.create') -); - -export const getIsDfspHubSCUpdatePending = createSelector( - (state: State) => state.api, - isPending('hubServerCerts.update') -); - -export const getIsDfspHubSCSubmitPending = createSelector( - getIsDfspHubSCCreatePending, - getIsDfspHubSCUpdatePending, - testers.getAnyIs(true) -); +import { State } from 'store/types'; +import { createSelector } from 'reselect'; +import { isPending } from 'utils/api'; + +import * as testers from 'utils/testers'; + +export const getDfspHubSCError = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCError; +export const getPreviousDfspHubSCRootCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.previousDfspHubSCRootCertificate || ''; +export const getPreviousDfspHubSCIntermediateChain = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.previousDfspHubSCIntermediateChain || ''; +export const getPreviousDfspHubSCServerCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.previousDfspHubSCServerCertificate || ''; +export const getDfspHubSCRootCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCRootCertificate || ''; +export const getDfspHubSCIntermediateChain = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCIntermediateChain || ''; +export const getDfspHubSCServerCertificate = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCServerCertificate || ''; +export const getDfspHubSCRootCertificateInfo = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCRootCertificateInfo; +export const getDfspHubSCIntermediateChainInfo = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCIntermediateChainInfo; +export const getDfspHubSCServerCertificateInfo = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCServerCertificateInfo; +export const getDfspHubSCValidations = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCValidations; +export const getDfspHubSCValidationState = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.dfspHubSCValidationState; +export const getIsDfspHubSCRootCertificateModalVisible = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.isDfspHubSCRootCertificateModalVisible; +export const getIsDfspHubSCIntermediateChainModalVisible = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.isDfspHubSCIntermediateChainModalVisible; +export const getIsDfspHubSCServerCertificateModalVisible = (state: State) => + state.wizard.environment.tls.tlsserver.hubsc.isDfspHubSCServerCertificateModalVisible; + +export const getIsDfspHubSCReadPending = createSelector( + (state: State) => state.api, + isPending('dfspServerCerts.read') +); + +const buildDfspHubSCModel = ( + rootCertificate: string, + intermediateChain: string, + serverCertificate: string +) => ({ + rootCertificate, + intermediateChain, + serverCertificate, +}); +const getPreviousDfspHubSCModel = createSelector( + getPreviousDfspHubSCRootCertificate, + getPreviousDfspHubSCIntermediateChain, + getPreviousDfspHubSCServerCertificate, + buildDfspHubSCModel +); +export const getDfspHubSCModel = createSelector( + getDfspHubSCRootCertificate, + getDfspHubSCIntermediateChain, + getDfspHubSCServerCertificate, + buildDfspHubSCModel +); + +const getIsDfspHubSCModelChanged = createSelector( + getPreviousDfspHubSCModel, + getDfspHubSCModel, + testers.isNotEqual +); +const getIsDfspHubSCServerCertificateValid = createSelector( + getDfspHubSCServerCertificate, + testers.isNotNil +); + +export const getIsDfspHubSCEditingExistingModel = createSelector( + getPreviousDfspHubSCServerCertificate, + testers.isNotNil +); +export const getIsDfspHubSCSubmitEnabled = createSelector( + getIsDfspHubSCServerCertificateValid, + getIsDfspHubSCModelChanged, + testers.getAllAre(true) +); + +export const getIsDfspHubSCCreatePending = createSelector( + (state: State) => state.api, + isPending('hubServerCerts.create') +); + +export const getIsDfspHubSCUpdatePending = createSelector( + (state: State) => state.api, + isPending('hubServerCerts.update') +); + +export const getIsDfspHubSCSubmitPending = createSelector( + getIsDfspHubSCCreatePending, + getIsDfspHubSCUpdatePending, + testers.getAnyIs(true) +); diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/types.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/types.ts index 7ff40f2..61b9103 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/types.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/HubSC/types.ts @@ -1,179 +1,179 @@ -import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; - -export const RESET_DFSP_HUB_SC = 'DFSP HUB SC / Reset'; -export const SET_DFSP_HUB_SC_ERROR = 'DFSP HUB SC / Set Root Cert Error'; -export const SET_DFSP_HUB_SC_ROOT_CERTIFICATE = 'DFSP HUB SC / Set Root Certificate'; -export const SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN = 'DFSP HUB SC / Set Intermediate Chain'; -export const SET_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Set Server Certificate'; -export const SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO = 'DFSP HUB SC / Set Root Certificate Info'; -export const SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO = 'DFSP HUB SC / Set Intermediate Chain Info'; -export const SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO = 'DFSP HUB SC / Set Server Certificate Info'; -export const SET_DFSP_HUB_SC_VALIDATIONS = 'DFSP HUB SC / Set Validations'; -export const SET_DFSP_HUB_SC_VALIDATION_STATE = 'DFSP HUB SC / Set Validation State'; -export const SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL = 'DFSP HUB SC / Show Root Certificate Modal'; -export const HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL = 'DFSP HUB SC / Hide Root Certificate Modal'; -export const SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL = - 'DFSP HUB SC / Show Intermediate Chain Modal'; -export const HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL = - 'DFSP HUB SC / Hide Intermediate Chain Modal'; -export const SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL = - 'DFSP HUB SC / Show Server Certificate Modal'; -export const HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL = - 'DFSP HUB SC / Hide Server Certificate Modal'; -export const SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Submit Server Certificate'; -export const STORE_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Store Server Certificate'; -export const DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE = 'DFSP HUB SC / Download Root Certificate'; -export const DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN = 'DFSP HUB SC / Download Intermediate Chain'; -export const DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Download Server Certificate'; -export const CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE = 'DFSP HUB SC / Change Root Certificate'; -export const CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN = 'DFSP HUB SC / Change Intermediate Chain'; -export const CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Change Server Certificate'; - -export interface ResetDfspHubSCAction { - type: typeof RESET_DFSP_HUB_SC; -} - -export interface SetDfspHubSCErrorAction { - type: typeof SET_DFSP_HUB_SC_ERROR; - error: string; -} - -export interface SetDfspHubSCRootCertificateAction { - type: typeof SET_DFSP_HUB_SC_ROOT_CERTIFICATE; - certificate: string; -} - -export interface SetDfspHubSCIntermediateChainAction { - type: typeof SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface SetDfspHubSCServerCertificateAction { - type: typeof SET_DFSP_HUB_SC_SERVER_CERTIFICATE; - certificate: string; -} - -export interface SetDfspHubSCRootCertificateInfoAction { - type: typeof SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO; - certInfo: CertInfo; -} - -export interface SetDfspHubSCIntermediateChainInfoAction { - type: typeof SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO; - certInfo: CertInfo; -} - -export interface SetDfspHubSCServerCertificateInfoAction { - type: typeof SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO; - certInfo: CertInfo; -} - -export interface SetDfspHubSCValidationsAction { - type: typeof SET_DFSP_HUB_SC_VALIDATIONS; - validations: CertificateValidationResults[]; -} - -export interface SetDfspHubSCValidationStateAction { - type: typeof SET_DFSP_HUB_SC_VALIDATION_STATE; - validationState: string | undefined; -} - -export interface ShowDfspHubSCRootCertificateModalAction { - type: typeof SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL; -} - -export interface ChangeDfspHubSCRootCertificateAction { - type: typeof CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE; - certificate: string; -} - -export interface ChangeDfspHubSCIntermediateChainAction { - type: typeof CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN; - certificate: string; -} - -export interface ChangeDfspHubSCServerCertificateAction { - type: typeof CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE; - certificate: string; -} - -export interface HideDfspHubSCRootCertificateModalAction { - type: typeof HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL; -} - -export interface ShowDfspHubSCIntermediateChainModalAction { - type: typeof SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL; -} - -export interface HideDfspHubSCIntermediateChainModalAction { - type: typeof HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL; -} - -export interface ShowDfspHubSCServerCertificateModalAction { - type: typeof SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL; -} - -export interface HideDfspHubSCServerCertificateModalAction { - type: typeof HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL; -} - -export interface SubmitDfspHubSCServerCertificateAction { - type: typeof SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE; -} - -export interface StoreDfspHubSCServerCertificateAction { - type: typeof STORE_DFSP_HUB_SC_SERVER_CERTIFICATE; -} - -export interface DownloadDfspHubSCRootCertificateAction { - type: typeof DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE; -} - -export interface DownloadDfspHubSCIntermediateChainAction { - type: typeof DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN; -} - -export interface DownloadDfspHubSCServerCertificateAction { - type: typeof DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE; -} - -export type DfspHubSCActionTypes = - | SetDfspHubSCErrorAction - | ResetDfspHubSCAction - | SetDfspHubSCRootCertificateAction - | SetDfspHubSCIntermediateChainAction - | SetDfspHubSCServerCertificateAction - | SetDfspHubSCRootCertificateInfoAction - | SetDfspHubSCIntermediateChainInfoAction - | SetDfspHubSCServerCertificateInfoAction - | SetDfspHubSCValidationsAction - | SetDfspHubSCValidationStateAction - | ShowDfspHubSCRootCertificateModalAction - | ChangeDfspHubSCRootCertificateAction - | ChangeDfspHubSCIntermediateChainAction - | ChangeDfspHubSCServerCertificateAction - | HideDfspHubSCRootCertificateModalAction - | ShowDfspHubSCIntermediateChainModalAction - | HideDfspHubSCIntermediateChainModalAction - | ShowDfspHubSCServerCertificateModalAction - | HideDfspHubSCServerCertificateModalAction - | SubmitDfspHubSCServerCertificateAction - | StoreDfspHubSCServerCertificateAction; - -export interface DfspHubSCState { - dfspHubSCError?: ErrorMessage; - previousDfspHubSCRootCertificate?: string; - previousDfspHubSCIntermediateChain?: string; - previousDfspHubSCServerCertificate?: string; - dfspHubSCRootCertificate?: string; - dfspHubSCIntermediateChain?: string; - dfspHubSCServerCertificate?: string; - dfspHubSCRootCertificateInfo?: CertInfo; - dfspHubSCIntermediateChainInfo?: CertInfo; - dfspHubSCServerCertificateInfo?: CertInfo; - dfspHubSCValidations: CertificateValidationResults[]; - dfspHubSCValidationState?: string; - isDfspHubSCRootCertificateModalVisible: boolean; - isDfspHubSCIntermediateChainModalVisible: boolean; - isDfspHubSCServerCertificateModalVisible: boolean; -} +import { CertificateValidationResults, ErrorMessage, CertInfo } from 'App/types'; + +export const RESET_DFSP_HUB_SC = 'DFSP HUB SC / Reset'; +export const SET_DFSP_HUB_SC_ERROR = 'DFSP HUB SC / Set Root Cert Error'; +export const SET_DFSP_HUB_SC_ROOT_CERTIFICATE = 'DFSP HUB SC / Set Root Certificate'; +export const SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN = 'DFSP HUB SC / Set Intermediate Chain'; +export const SET_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Set Server Certificate'; +export const SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO = 'DFSP HUB SC / Set Root Certificate Info'; +export const SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO = 'DFSP HUB SC / Set Intermediate Chain Info'; +export const SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO = 'DFSP HUB SC / Set Server Certificate Info'; +export const SET_DFSP_HUB_SC_VALIDATIONS = 'DFSP HUB SC / Set Validations'; +export const SET_DFSP_HUB_SC_VALIDATION_STATE = 'DFSP HUB SC / Set Validation State'; +export const SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL = 'DFSP HUB SC / Show Root Certificate Modal'; +export const HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL = 'DFSP HUB SC / Hide Root Certificate Modal'; +export const SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL = + 'DFSP HUB SC / Show Intermediate Chain Modal'; +export const HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL = + 'DFSP HUB SC / Hide Intermediate Chain Modal'; +export const SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL = + 'DFSP HUB SC / Show Server Certificate Modal'; +export const HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL = + 'DFSP HUB SC / Hide Server Certificate Modal'; +export const SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Submit Server Certificate'; +export const STORE_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Store Server Certificate'; +export const DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE = 'DFSP HUB SC / Download Root Certificate'; +export const DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN = 'DFSP HUB SC / Download Intermediate Chain'; +export const DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Download Server Certificate'; +export const CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE = 'DFSP HUB SC / Change Root Certificate'; +export const CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN = 'DFSP HUB SC / Change Intermediate Chain'; +export const CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE = 'DFSP HUB SC / Change Server Certificate'; + +export interface ResetDfspHubSCAction { + type: typeof RESET_DFSP_HUB_SC; +} + +export interface SetDfspHubSCErrorAction { + type: typeof SET_DFSP_HUB_SC_ERROR; + error: string; +} + +export interface SetDfspHubSCRootCertificateAction { + type: typeof SET_DFSP_HUB_SC_ROOT_CERTIFICATE; + certificate: string; +} + +export interface SetDfspHubSCIntermediateChainAction { + type: typeof SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface SetDfspHubSCServerCertificateAction { + type: typeof SET_DFSP_HUB_SC_SERVER_CERTIFICATE; + certificate: string; +} + +export interface SetDfspHubSCRootCertificateInfoAction { + type: typeof SET_DFSP_HUB_SC_ROOT_CERTIFICATE_INFO; + certInfo: CertInfo; +} + +export interface SetDfspHubSCIntermediateChainInfoAction { + type: typeof SET_DFSP_HUB_SC_INTERMEDIATE_CHAIN_INFO; + certInfo: CertInfo; +} + +export interface SetDfspHubSCServerCertificateInfoAction { + type: typeof SET_DFSP_HUB_SC_SERVER_CERTIFICATE_INFO; + certInfo: CertInfo; +} + +export interface SetDfspHubSCValidationsAction { + type: typeof SET_DFSP_HUB_SC_VALIDATIONS; + validations: CertificateValidationResults[]; +} + +export interface SetDfspHubSCValidationStateAction { + type: typeof SET_DFSP_HUB_SC_VALIDATION_STATE; + validationState: string | undefined; +} + +export interface ShowDfspHubSCRootCertificateModalAction { + type: typeof SHOW_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL; +} + +export interface ChangeDfspHubSCRootCertificateAction { + type: typeof CHANGE_DFSP_HUB_SC_ROOT_CERTIFICATE; + certificate: string; +} + +export interface ChangeDfspHubSCIntermediateChainAction { + type: typeof CHANGE_DFSP_HUB_SC_INTERMEDIATE_CHAIN; + certificate: string; +} + +export interface ChangeDfspHubSCServerCertificateAction { + type: typeof CHANGE_DFSP_HUB_SC_SERVER_CERTIFICATE; + certificate: string; +} + +export interface HideDfspHubSCRootCertificateModalAction { + type: typeof HIDE_DFSP_HUB_SC_ROOT_CERTIFICATE_MODAL; +} + +export interface ShowDfspHubSCIntermediateChainModalAction { + type: typeof SHOW_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL; +} + +export interface HideDfspHubSCIntermediateChainModalAction { + type: typeof HIDE_DFSP_HUB_SC_INTERMEDIATE_CHAIN_MODAL; +} + +export interface ShowDfspHubSCServerCertificateModalAction { + type: typeof SHOW_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL; +} + +export interface HideDfspHubSCServerCertificateModalAction { + type: typeof HIDE_DFSP_HUB_SC_SERVER_CERTIFICATE_MODAL; +} + +export interface SubmitDfspHubSCServerCertificateAction { + type: typeof SUBMIT_DFSP_HUB_SC_SERVER_CERTIFICATE; +} + +export interface StoreDfspHubSCServerCertificateAction { + type: typeof STORE_DFSP_HUB_SC_SERVER_CERTIFICATE; +} + +export interface DownloadDfspHubSCRootCertificateAction { + type: typeof DOWNLOAD_DFSP_HUB_SC_ROOT_CERTIFICATE; +} + +export interface DownloadDfspHubSCIntermediateChainAction { + type: typeof DOWNLOAD_DFSP_HUB_SC_INTERMEDIATE_CHAIN; +} + +export interface DownloadDfspHubSCServerCertificateAction { + type: typeof DOWNLOAD_DFSP_HUB_SC_SERVER_CERTIFICATE; +} + +export type DfspHubSCActionTypes = + | SetDfspHubSCErrorAction + | ResetDfspHubSCAction + | SetDfspHubSCRootCertificateAction + | SetDfspHubSCIntermediateChainAction + | SetDfspHubSCServerCertificateAction + | SetDfspHubSCRootCertificateInfoAction + | SetDfspHubSCIntermediateChainInfoAction + | SetDfspHubSCServerCertificateInfoAction + | SetDfspHubSCValidationsAction + | SetDfspHubSCValidationStateAction + | ShowDfspHubSCRootCertificateModalAction + | ChangeDfspHubSCRootCertificateAction + | ChangeDfspHubSCIntermediateChainAction + | ChangeDfspHubSCServerCertificateAction + | HideDfspHubSCRootCertificateModalAction + | ShowDfspHubSCIntermediateChainModalAction + | HideDfspHubSCIntermediateChainModalAction + | ShowDfspHubSCServerCertificateModalAction + | HideDfspHubSCServerCertificateModalAction + | SubmitDfspHubSCServerCertificateAction + | StoreDfspHubSCServerCertificateAction; + +export interface DfspHubSCState { + dfspHubSCError?: ErrorMessage; + previousDfspHubSCRootCertificate?: string; + previousDfspHubSCIntermediateChain?: string; + previousDfspHubSCServerCertificate?: string; + dfspHubSCRootCertificate?: string; + dfspHubSCIntermediateChain?: string; + dfspHubSCServerCertificate?: string; + dfspHubSCRootCertificateInfo?: CertInfo; + dfspHubSCIntermediateChainInfo?: CertInfo; + dfspHubSCServerCertificateInfo?: CertInfo; + dfspHubSCValidations: CertificateValidationResults[]; + dfspHubSCValidationState?: string; + isDfspHubSCRootCertificateModalVisible: boolean; + isDfspHubSCIntermediateChainModalVisible: boolean; + isDfspHubSCServerCertificateModalVisible: boolean; +} diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/TLSServerCertificates.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/TLSServerCertificates.tsx index ce56940..4a64119 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/TLSServerCertificates.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/TLSServerCertificates.tsx @@ -1,25 +1,25 @@ -import React from 'react'; -import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; -import DFSPSC from './DFSPSC/DFSPSC'; -import HubSC from './HubSC/HubSC'; - -const TLSServerCertificates = () => ( -
- - - DFSP Server Certificates - Hub Server Certificates - - - - - - - - - - -
-); - -export default TLSServerCertificates; +import React from 'react'; +import { Tab, Tabs, TabList, TabPanel, TabPanels } from 'components'; +import DFSPSC from './DFSPSC/DFSPSC'; +import HubSC from './HubSC/HubSC'; + +const TLSServerCertificates = () => ( +
+ + + DFSP Server Certificates + Hub Server Certificates + + + + + + + + + + +
+); + +export default TLSServerCertificates; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/index.ts index f96fb10..6411413 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/index.ts @@ -1,6 +1,6 @@ -import TLSServerCertificates from './TLSServerCertificates'; -import reducer from './reducers'; -import sagas from './sagas'; - -export default TLSServerCertificates; -export { reducer, sagas }; +import TLSServerCertificates from './TLSServerCertificates'; +import reducer from './reducers'; +import sagas from './sagas'; + +export default TLSServerCertificates; +export { reducer, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/reducers.ts index 77f6b55..90cd57e 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/reducers.ts @@ -1,10 +1,10 @@ -import { Reducer, combineReducers } from 'redux'; -import { reducer as hubscReducer } from './HubSC'; -import { reducer as dfspscReducer } from './DFSPSC'; - -const reducer: Reducer = combineReducers({ - dfsps: dfspscReducer, - hubsc: hubscReducer, -}); - -export default reducer; +import { Reducer, combineReducers } from 'redux'; +import { reducer as hubscReducer } from './HubSC'; +import { reducer as dfspscReducer } from './DFSPSC'; + +const reducer: Reducer = combineReducers({ + dfsps: dfspscReducer, + hubsc: hubscReducer, +}); + +export default reducer; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/sagas.ts index f17fcb7..77284b3 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/TLSServerCertificates/sagas.ts @@ -1,9 +1,9 @@ -import { all } from 'redux-saga/effects'; -import { sagas as dfspscSagas } from './DFSPSC'; -import { sagas as hubscSagas } from './HubSC'; - -function* rootSaga() { - yield all([dfspscSagas(), hubscSagas()]); -} - -export default rootSaga; +import { all } from 'redux-saga/effects'; +import { sagas as dfspscSagas } from './DFSPSC'; +import { sagas as hubscSagas } from './HubSC'; + +function* rootSaga() { + yield all([dfspscSagas(), hubscSagas()]); +} + +export default rootSaga; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/index.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/index.ts index 46fc0f3..41a67fe 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/index.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/index.ts @@ -1,4 +1,4 @@ -import reducer from './reducers'; -import sagas from './sagas'; - -export { reducer, sagas }; +import reducer from './reducers'; +import sagas from './sagas'; + +export { reducer, sagas }; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/reducers.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/reducers.ts index 9bf644b..96b725f 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/reducers.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/reducers.ts @@ -1,11 +1,11 @@ -import { Reducer, combineReducers } from 'redux'; - -import { reducer as tlsClientReducer } from './TLSClient'; -import { reducer as tlsServerReducer } from './TLSServerCertificates'; - -const reducer: Reducer = combineReducers({ - tlsclient: tlsClientReducer, - tlsserver: tlsServerReducer, -}); - -export default reducer; +import { Reducer, combineReducers } from 'redux'; + +import { reducer as tlsClientReducer } from './TLSClient'; +import { reducer as tlsServerReducer } from './TLSServerCertificates'; + +const reducer: Reducer = combineReducers({ + tlsclient: tlsClientReducer, + tlsserver: tlsServerReducer, +}); + +export default reducer; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/sagas.ts b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/sagas.ts index 9445646..03774d5 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/sagas.ts +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TLS/sagas.ts @@ -1,9 +1,9 @@ -import { all } from 'redux-saga/effects'; -import tlsClientSagas from './TLSClient/sagas'; -import tlsServerCertSagas from './TLSServerCertificates/sagas'; - -function* rootSaga() { - yield all([tlsClientSagas(), tlsServerCertSagas()]); -} - -export default rootSaga; +import { all } from 'redux-saga/effects'; +import tlsClientSagas from './TLSClient/sagas'; +import tlsServerCertSagas from './TLSServerCertificates/sagas'; + +function* rootSaga() { + yield all([tlsClientSagas(), tlsServerCertSagas()]); +} + +export default rootSaga; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/TechnicalSetup.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/TechnicalSetup.tsx index a25834c..aeb25b8 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/TechnicalSetup.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/TechnicalSetup.tsx @@ -1,148 +1,148 @@ -import { Switch, Route, Redirect, useParams, useHistory, useRouteMatch } from 'react-router-dom'; -import React, { FC } from 'react'; -import { ProgressTabs, ProgressTab } from 'components'; -import { EnvironmentStep, EnvironmentStepIdentifiers } from '../../types'; - -import * as helpers from '../../helpers'; -import Endpoints from './Endpoints'; -import DFSPCertificateAuthority from './DFSPCertificateAuthority'; -import TLS from './TLS/TLSClient'; -import TLSServerCertificates from './TLS/TLSServerCertificates'; -import DFSPJWSCertificates from './JWSCertificates/DFSPJWSCertificates'; - -const technicalSetupSteps: string[] = ['Endpoints', 'TLSConfig', 'CertAuth', 'CertEx', 'JWSCert']; - -interface TechnicalSetupRouterProps { - steps: EnvironmentStep[]; - isEnvironmentsStatusesPending: boolean; -} - -const TechnicalSetupRouter: FC = ({ - steps, - isEnvironmentsStatusesPending, -}) => { - const match = useRouteMatch(); - return ( - - - - - - - - - ); -}; - -interface TechnicalSetupParams { - step: string; -} - -interface TechnicalSetupTabsProps { - steps: EnvironmentStep[]; - isEnvironmentsStatusesPending: boolean; -} - -const TechnicalSetup: FC = ({ steps, isEnvironmentsStatusesPending }) => { - const params = useParams(); - const history = useHistory(); - - const stepTabIndex = technicalSetupSteps.indexOf(params.step); - - function onTechnicalSetupTabClick(index: number) { - history.push(technicalSetupSteps[index]); - } - - const endpoints = helpers.getStepStatus( - steps, - EnvironmentStepIdentifiers.Endpoints, - isEnvironmentsStatusesPending - ); - const csrExchange = helpers.getStepStatus( - steps, - EnvironmentStepIdentifiers.CsrExchange, - isEnvironmentsStatusesPending - ); - const certificateAuthority = helpers.getStepStatus( - steps, - EnvironmentStepIdentifiers.CertificateAuthority, - isEnvironmentsStatusesPending - ); - const serverCertificatesExchange = helpers.getStepStatus( - steps, - EnvironmentStepIdentifiers.ServerCertificatesExchange, - isEnvironmentsStatusesPending - ); - const jwsCertificates = helpers.getStepStatus( - steps, - EnvironmentStepIdentifiers.JwsCertificates, - isEnvironmentsStatusesPending - ); - - return ( - <> - - - - - - - - - - - - - - - - - - - - - - - ); -}; - -export default TechnicalSetupRouter; +import { Switch, Route, Redirect, useParams, useHistory, useRouteMatch } from 'react-router-dom'; +import React, { FC } from 'react'; +import { ProgressTabs, ProgressTab } from 'components'; +import { EnvironmentStep, EnvironmentStepIdentifiers } from '../../types'; + +import * as helpers from '../../helpers'; +import Endpoints from './Endpoints'; +import DFSPCertificateAuthority from './DFSPCertificateAuthority'; +import TLS from './TLS/TLSClient'; +import TLSServerCertificates from './TLS/TLSServerCertificates'; +import DFSPJWSCertificates from './JWSCertificates/DFSPJWSCertificates'; + +const technicalSetupSteps: string[] = ['Endpoints', 'TLSConfig', 'CertAuth', 'CertEx', 'JWSCert']; + +interface TechnicalSetupRouterProps { + steps: EnvironmentStep[]; + isEnvironmentsStatusesPending: boolean; +} + +const TechnicalSetupRouter: FC = ({ + steps, + isEnvironmentsStatusesPending, +}) => { + const match = useRouteMatch(); + return ( + + + + + + + + + ); +}; + +interface TechnicalSetupParams { + step: string; +} + +interface TechnicalSetupTabsProps { + steps: EnvironmentStep[]; + isEnvironmentsStatusesPending: boolean; +} + +const TechnicalSetup: FC = ({ steps, isEnvironmentsStatusesPending }) => { + const params = useParams(); + const history = useHistory(); + + const stepTabIndex = technicalSetupSteps.indexOf(params.step); + + function onTechnicalSetupTabClick(index: number) { + history.push(technicalSetupSteps[index]); + } + + const endpoints = helpers.getStepStatus( + steps, + EnvironmentStepIdentifiers.Endpoints, + isEnvironmentsStatusesPending + ); + const csrExchange = helpers.getStepStatus( + steps, + EnvironmentStepIdentifiers.CsrExchange, + isEnvironmentsStatusesPending + ); + const certificateAuthority = helpers.getStepStatus( + steps, + EnvironmentStepIdentifiers.CertificateAuthority, + isEnvironmentsStatusesPending + ); + const serverCertificatesExchange = helpers.getStepStatus( + steps, + EnvironmentStepIdentifiers.ServerCertificatesExchange, + isEnvironmentsStatusesPending + ); + const jwsCertificates = helpers.getStepStatus( + steps, + EnvironmentStepIdentifiers.JwsCertificates, + isEnvironmentsStatusesPending + ); + + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +export default TechnicalSetupRouter; diff --git a/src/App/ConnectionWizard/Environment/TechnicalSetup/index.tsx b/src/App/ConnectionWizard/Environment/TechnicalSetup/index.tsx index bb5cd21..87d8428 100644 --- a/src/App/ConnectionWizard/Environment/TechnicalSetup/index.tsx +++ b/src/App/ConnectionWizard/Environment/TechnicalSetup/index.tsx @@ -1,3 +1,3 @@ -import TechnicalSetup from './TechnicalSetup'; - -export default TechnicalSetup; +import TechnicalSetup from './TechnicalSetup'; + +export default TechnicalSetup; diff --git a/src/App/ConnectionWizard/Environment/hocs/loadEnvironment.tsx b/src/App/ConnectionWizard/Environment/hocs/loadEnvironment.tsx index 8b53402..1919804 100644 --- a/src/App/ConnectionWizard/Environment/hocs/loadEnvironment.tsx +++ b/src/App/ConnectionWizard/Environment/hocs/loadEnvironment.tsx @@ -1,29 +1,29 @@ -import React, { Component, ComponentType } from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'store/types'; -import * as actions from '../Main/actions'; - -type EnvironmentLoaderProps = { - onEnvironmentMount: () => void; -}; - -export default function loadEnvironment(Cmp: ComponentType) { - class EnvironmentLoader extends Component { - componentDidMount() { - this.props.onEnvironmentMount(); - } - - render() { - /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ - const { onEnvironmentMount, ...props } = this.props; - return ; - } - } - return connect(null, (dispatch: Dispatch) => ({ - onEnvironmentMount: () => dispatch(actions.requestEnvironmentData()), - }))(EnvironmentLoader); -} - -type EnvironmentsStatusLoaderProps = { - onEnvironmentsMount: () => void; -}; +import React, { Component, ComponentType } from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'store/types'; +import * as actions from '../Main/actions'; + +type EnvironmentLoaderProps = { + onEnvironmentMount: () => void; +}; + +export default function loadEnvironment(Cmp: ComponentType) { + class EnvironmentLoader extends Component { + componentDidMount() { + this.props.onEnvironmentMount(); + } + + render() { + /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ + const { onEnvironmentMount, ...props } = this.props; + return ; + } + } + return connect(null, (dispatch: Dispatch) => ({ + onEnvironmentMount: () => dispatch(actions.requestEnvironmentData()), + }))(EnvironmentLoader); +} + +type EnvironmentsStatusLoaderProps = { + onEnvironmentsMount: () => void; +}; diff --git a/src/App/ConnectionWizard/Environment/index.ts b/src/App/ConnectionWizard/Environment/index.ts index d5340f8..740f80e 100644 --- a/src/App/ConnectionWizard/Environment/index.ts +++ b/src/App/ConnectionWizard/Environment/index.ts @@ -1,6 +1,6 @@ -import reducer from './reducers'; -import * as types from './types'; -import Environment from './Router'; - -export default Environment; -export { reducer, types }; +import reducer from './reducers'; +import * as types from './types'; +import Environment from './Router'; + +export default Environment; +export { reducer, types }; diff --git a/src/App/ConnectionWizard/Environment/reducers.ts b/src/App/ConnectionWizard/Environment/reducers.ts index df1515d..4794433 100644 --- a/src/App/ConnectionWizard/Environment/reducers.ts +++ b/src/App/ConnectionWizard/Environment/reducers.ts @@ -1,16 +1,16 @@ -import { Reducer, combineReducers } from 'redux'; -import { reducer as mainReducer } from './Main'; -import { reducer as endpointsReducer } from './TechnicalSetup/Endpoints'; -import { reducer as dfspCAReducer } from './TechnicalSetup/DFSPCertificateAuthority'; -import { reducer as tlsReducer } from './TechnicalSetup/TLS'; -import { reducer as jwsReducer } from './TechnicalSetup/JWSCertificates'; - -const reducer: Reducer = combineReducers({ - main: mainReducer, - dfspca: dfspCAReducer, - endpoints: endpointsReducer, - tls: tlsReducer, - jws: jwsReducer, -}); - -export default reducer; +import { Reducer, combineReducers } from 'redux'; +import { reducer as mainReducer } from './Main'; +import { reducer as endpointsReducer } from './TechnicalSetup/Endpoints'; +import { reducer as dfspCAReducer } from './TechnicalSetup/DFSPCertificateAuthority'; +import { reducer as tlsReducer } from './TechnicalSetup/TLS'; +import { reducer as jwsReducer } from './TechnicalSetup/JWSCertificates'; + +const reducer: Reducer = combineReducers({ + main: mainReducer, + dfspca: dfspCAReducer, + endpoints: endpointsReducer, + tls: tlsReducer, + jws: jwsReducer, +}); + +export default reducer; diff --git a/src/App/ConnectionWizard/Environment/sagas.ts b/src/App/ConnectionWizard/Environment/sagas.ts index 8997041..d6e1846 100644 --- a/src/App/ConnectionWizard/Environment/sagas.ts +++ b/src/App/ConnectionWizard/Environment/sagas.ts @@ -1,10 +1,10 @@ -import { all } from 'redux-saga/effects'; -import mainSagas from './Main/sagas'; -import endpointsSagas from './TechnicalSetup/Endpoints/sagas'; -import dfspCASagas from './TechnicalSetup/DFSPCertificateAuthority/sagas'; -import tlsSagas from './TechnicalSetup/TLS/sagas'; -import jwsSagas from './TechnicalSetup/JWSCertificates/sagas'; - -export default function* rootSaga() { - yield all([mainSagas(), endpointsSagas(), dfspCASagas(), tlsSagas(), jwsSagas()]); -} +import { all } from 'redux-saga/effects'; +import mainSagas from './Main/sagas'; +import endpointsSagas from './TechnicalSetup/Endpoints/sagas'; +import dfspCASagas from './TechnicalSetup/DFSPCertificateAuthority/sagas'; +import tlsSagas from './TechnicalSetup/TLS/sagas'; +import jwsSagas from './TechnicalSetup/JWSCertificates/sagas'; + +export default function* rootSaga() { + yield all([mainSagas(), endpointsSagas(), dfspCASagas(), tlsSagas(), jwsSagas()]); +} diff --git a/src/App/ConnectionWizard/Environment/types.ts b/src/App/ConnectionWizard/Environment/types.ts index 7f24953..7b90fe3 100644 --- a/src/App/ConnectionWizard/Environment/types.ts +++ b/src/App/ConnectionWizard/Environment/types.ts @@ -1,63 +1,63 @@ -import { MainActionTypes, MainState } from './Main/types'; -import { IngressActionTypes, IngressState } from './TechnicalSetup/Endpoints/Ingress/types'; -import { EgressActionTypes, EgressState } from './TechnicalSetup/Endpoints/Egress/types'; -import { HubActionTypes, HubState } from './TechnicalSetup/Endpoints/Hub/types'; -import { DFSPCertificateAuthorityState } from './TechnicalSetup/DFSPCertificateAuthority/types'; -import { DfspCSRActionTypes, CSRState } from './TechnicalSetup/TLS/TLSClient/CSR/types'; -import { - DfspSentCSRsActionTypes, - SentCSRsState, -} from './TechnicalSetup/TLS/TLSClient/SentCSRs/types'; -import { - DfspHubCSRsActionTypes, - DfspHubCSRsState, -} from './TechnicalSetup/TLS/TLSClient/HubCSRs/types'; -import { - DfspSCActionTypes, - DfspSCState, -} from './TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/types'; -import { - DfspHubSCActionTypes, - DfspHubSCState, -} from './TechnicalSetup/TLS/TLSServerCertificates/HubSC/types'; -import { DFSPJWSActionTypes, DFSPJWSState } from './TechnicalSetup/JWSCertificates/DFSPJWS/types'; -import { - OtherDFSPsJWSActionTypes, - OtherDFSPsJWSState, -} from './TechnicalSetup/JWSCertificates/OtherDFSPsJWS/types'; - -export type EnvironmentActionTypes = - | MainActionTypes - | IngressActionTypes - | EgressActionTypes - | HubActionTypes - | DFSPCertificateAuthorityState - | DfspCSRActionTypes - | DfspCSRActionTypes - | DfspSentCSRsActionTypes - | DfspHubCSRsActionTypes - | DfspSCActionTypes - | DfspHubSCActionTypes - | DFSPJWSActionTypes - | OtherDFSPsJWSActionTypes; - -export interface EnvironmentState { - main: MainState; - endpoints: { - ingress: IngressState; - egress: EgressState; - hub: HubState; - }; - dfspca: DFSPCertificateAuthorityState; - tls: { - tlsclient: { csr: CSRState; csrs: SentCSRsState; hub: DfspHubCSRsState }; - tlsserver: { - dfsps: DfspSCState; - hubsc: DfspHubSCState; - }; - }; - jws: { - dfspjws: DFSPJWSState; - otherdfspjws: OtherDFSPsJWSState; - }; -} +import { MainActionTypes, MainState } from './Main/types'; +import { IngressActionTypes, IngressState } from './TechnicalSetup/Endpoints/Ingress/types'; +import { EgressActionTypes, EgressState } from './TechnicalSetup/Endpoints/Egress/types'; +import { HubActionTypes, HubState } from './TechnicalSetup/Endpoints/Hub/types'; +import { DFSPCertificateAuthorityState } from './TechnicalSetup/DFSPCertificateAuthority/types'; +import { DfspCSRActionTypes, CSRState } from './TechnicalSetup/TLS/TLSClient/CSR/types'; +import { + DfspSentCSRsActionTypes, + SentCSRsState, +} from './TechnicalSetup/TLS/TLSClient/SentCSRs/types'; +import { + DfspHubCSRsActionTypes, + DfspHubCSRsState, +} from './TechnicalSetup/TLS/TLSClient/HubCSRs/types'; +import { + DfspSCActionTypes, + DfspSCState, +} from './TechnicalSetup/TLS/TLSServerCertificates/DFSPSC/types'; +import { + DfspHubSCActionTypes, + DfspHubSCState, +} from './TechnicalSetup/TLS/TLSServerCertificates/HubSC/types'; +import { DFSPJWSActionTypes, DFSPJWSState } from './TechnicalSetup/JWSCertificates/DFSPJWS/types'; +import { + OtherDFSPsJWSActionTypes, + OtherDFSPsJWSState, +} from './TechnicalSetup/JWSCertificates/OtherDFSPsJWS/types'; + +export type EnvironmentActionTypes = + | MainActionTypes + | IngressActionTypes + | EgressActionTypes + | HubActionTypes + | DFSPCertificateAuthorityState + | DfspCSRActionTypes + | DfspCSRActionTypes + | DfspSentCSRsActionTypes + | DfspHubCSRsActionTypes + | DfspSCActionTypes + | DfspHubSCActionTypes + | DFSPJWSActionTypes + | OtherDFSPsJWSActionTypes; + +export interface EnvironmentState { + main: MainState; + endpoints: { + ingress: IngressState; + egress: EgressState; + hub: HubState; + }; + dfspca: DFSPCertificateAuthorityState; + tls: { + tlsclient: { csr: CSRState; csrs: SentCSRsState; hub: DfspHubCSRsState }; + tlsserver: { + dfsps: DfspSCState; + hubsc: DfspHubSCState; + }; + }; + jws: { + dfspjws: DFSPJWSState; + otherdfspjws: OtherDFSPsJWSState; + }; +} diff --git a/src/App/ConnectionWizard/Environments/Environments.tsx b/src/App/ConnectionWizard/Environments/Environments.tsx index c59e4f3..9319ec1 100644 --- a/src/App/ConnectionWizard/Environments/Environments.tsx +++ b/src/App/ConnectionWizard/Environments/Environments.tsx @@ -1,70 +1,70 @@ -import React, { FC } from 'react'; -import { AnimateFadeIn, Accordion, AccordionItem } from 'components'; -import * as helpers from '../helpers'; -import { Environment, EnvironmentStatus } from '../types'; - -interface EnvironmentsOverviewProps { - environments: Environment[]; - isEnvironmentsStatusesPending: boolean; - environmentsStatuses: EnvironmentStatus[]; - environmentsStatusesError: string | null; -} - -const EnvironmentsOverview: FC = ({ - environments, - isEnvironmentsStatusesPending, - environmentsStatuses, - environmentsStatusesError, -}) => { - return ( - - {environments.map((environment) => { - const phases = helpers.getEnvironmentPhases( - environmentsStatuses, - environment, - isEnvironmentsStatusesPending - ); - const { status, statusColor, progress } = helpers.getEnvironmentStatus( - environmentsStatuses, - environment, - phases, - isEnvironmentsStatusesPending - ); - - return ( - {}} - > - {helpers.environmentPhases.map((phase) => { - const phaseStatus = helpers.getPhaseStatus( - phases, - phase.identifier, - isEnvironmentsStatusesPending - ); - - return ( - {}} - /> - ); - })} - - ); - })} - - ); -}; - -export default EnvironmentsOverview; +import React, { FC } from 'react'; +import { AnimateFadeIn, Accordion, AccordionItem } from 'components'; +import * as helpers from '../helpers'; +import { Environment, EnvironmentStatus } from '../types'; + +interface EnvironmentsOverviewProps { + environments: Environment[]; + isEnvironmentsStatusesPending: boolean; + environmentsStatuses: EnvironmentStatus[]; + environmentsStatusesError: string | null; +} + +const EnvironmentsOverview: FC = ({ + environments, + isEnvironmentsStatusesPending, + environmentsStatuses, + environmentsStatusesError, +}) => { + return ( + + {environments.map((environment) => { + const phases = helpers.getEnvironmentPhases( + environmentsStatuses, + environment, + isEnvironmentsStatusesPending + ); + const { status, statusColor, progress } = helpers.getEnvironmentStatus( + environmentsStatuses, + environment, + phases, + isEnvironmentsStatusesPending + ); + + return ( + {}} + > + {helpers.environmentPhases.map((phase) => { + const phaseStatus = helpers.getPhaseStatus( + phases, + phase.identifier, + isEnvironmentsStatusesPending + ); + + return ( + {}} + /> + ); + })} + + ); + })} + + ); +}; + +export default EnvironmentsOverview; diff --git a/src/App/ConnectionWizard/Environments/actions.ts b/src/App/ConnectionWizard/Environments/actions.ts index 952c3ff..71852da 100644 --- a/src/App/ConnectionWizard/Environments/actions.ts +++ b/src/App/ConnectionWizard/Environments/actions.ts @@ -1,72 +1,72 @@ -import { ErrorMessage } from 'App/types'; -import { Environment } from '../types'; -import { - INIT_ENVIRONMENTS, - REQUEST_ENVIRONMENTS, - SET_ENVIRONMENTS, - SET_ENVIRONMENTS_ERROR, - REQUEST_MONETARY_ZONES, - SET_MONETARY_ZONES, - SET_MONETARY_ZONES_ERROR, - InitEnvironmentsAction, - RequestEnvironmentsAction, - SetEnvironmentsAction, - SetEnvironmentsErrorAction, - RequestMonetaryZonesAction, - SetMonetaryZonesAction, - SetMonetaryZonesErrorAction, - MonetaryZone, -} from './types'; - -export function initEnvironments(): InitEnvironmentsAction { - return { - type: INIT_ENVIRONMENTS, - }; -} - -export function requestEnvironments(): RequestEnvironmentsAction { - return { - type: REQUEST_ENVIRONMENTS, - }; -} - -export function setEnvironments({ data }: { data: Environment[] }): SetEnvironmentsAction { - return { - type: SET_ENVIRONMENTS, - data, - }; -} - -export function setEnvironmentsError({ - error, -}: { - error: ErrorMessage; -}): SetEnvironmentsErrorAction { - return { - type: SET_ENVIRONMENTS_ERROR, - error, - }; -} - -export function setMonetaryZones({ data }: { data: MonetaryZone[] }): SetMonetaryZonesAction { - return { - type: SET_MONETARY_ZONES, - data, - }; -} -export function requestMonetaryZones(): RequestMonetaryZonesAction { - return { - type: REQUEST_MONETARY_ZONES, - }; -} - -export function setMonetaryZonesError({ - error, -}: { - error: ErrorMessage; -}): SetMonetaryZonesErrorAction { - return { - type: SET_MONETARY_ZONES_ERROR, - error, - }; -} +import { ErrorMessage } from 'App/types'; +import { Environment } from '../types'; +import { + INIT_ENVIRONMENTS, + REQUEST_ENVIRONMENTS, + SET_ENVIRONMENTS, + SET_ENVIRONMENTS_ERROR, + REQUEST_MONETARY_ZONES, + SET_MONETARY_ZONES, + SET_MONETARY_ZONES_ERROR, + InitEnvironmentsAction, + RequestEnvironmentsAction, + SetEnvironmentsAction, + SetEnvironmentsErrorAction, + RequestMonetaryZonesAction, + SetMonetaryZonesAction, + SetMonetaryZonesErrorAction, + MonetaryZone, +} from './types'; + +export function initEnvironments(): InitEnvironmentsAction { + return { + type: INIT_ENVIRONMENTS, + }; +} + +export function requestEnvironments(): RequestEnvironmentsAction { + return { + type: REQUEST_ENVIRONMENTS, + }; +} + +export function setEnvironments({ data }: { data: Environment[] }): SetEnvironmentsAction { + return { + type: SET_ENVIRONMENTS, + data, + }; +} + +export function setEnvironmentsError({ + error, +}: { + error: ErrorMessage; +}): SetEnvironmentsErrorAction { + return { + type: SET_ENVIRONMENTS_ERROR, + error, + }; +} + +export function setMonetaryZones({ data }: { data: MonetaryZone[] }): SetMonetaryZonesAction { + return { + type: SET_MONETARY_ZONES, + data, + }; +} +export function requestMonetaryZones(): RequestMonetaryZonesAction { + return { + type: REQUEST_MONETARY_ZONES, + }; +} + +export function setMonetaryZonesError({ + error, +}: { + error: ErrorMessage; +}): SetMonetaryZonesErrorAction { + return { + type: SET_MONETARY_ZONES_ERROR, + error, + }; +} diff --git a/src/App/ConnectionWizard/Environments/hocs/loadEnvironments.tsx b/src/App/ConnectionWizard/Environments/hocs/loadEnvironments.tsx index 840a65e..0c5513d 100644 --- a/src/App/ConnectionWizard/Environments/hocs/loadEnvironments.tsx +++ b/src/App/ConnectionWizard/Environments/hocs/loadEnvironments.tsx @@ -1,29 +1,29 @@ -import React, { Component, ComponentType } from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'store/types'; -import * as actions from '../actions'; - -type EnvironmentsLoaderProps = { - onComponentMount: () => void; -}; - -export default function initEnvironments(Cmp: ComponentType) { - class EnvironmentsLoader extends Component { - componentDidMount() { - this.props.onComponentMount(); - } - - render() { - /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ - const { onComponentMount, ...props } = this.props; - return ; - } - } - return connect(null, (dispatch: Dispatch) => ({ - onComponentMount: () => dispatch(actions.initEnvironments()), - }))(EnvironmentsLoader); -} - -type EnvironmentsStatusLoaderProps = { - onComponentMount: () => void; -}; +import React, { Component, ComponentType } from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'store/types'; +import * as actions from '../actions'; + +type EnvironmentsLoaderProps = { + onComponentMount: () => void; +}; + +export default function initEnvironments(Cmp: ComponentType) { + class EnvironmentsLoader extends Component { + componentDidMount() { + this.props.onComponentMount(); + } + + render() { + /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ + const { onComponentMount, ...props } = this.props; + return ; + } + } + return connect(null, (dispatch: Dispatch) => ({ + onComponentMount: () => dispatch(actions.initEnvironments()), + }))(EnvironmentsLoader); +} + +type EnvironmentsStatusLoaderProps = { + onComponentMount: () => void; +}; diff --git a/src/App/ConnectionWizard/Environments/index.ts b/src/App/ConnectionWizard/Environments/index.ts index 71d07cb..a4fbad3 100644 --- a/src/App/ConnectionWizard/Environments/index.ts +++ b/src/App/ConnectionWizard/Environments/index.ts @@ -1,8 +1,8 @@ -import reducer from './reducers'; -import * as actions from './actions'; -import sagas from './sagas'; -import * as types from './types'; -import Environments from './Environments'; - -export default Environments; -export { reducer, sagas, actions, types }; +import reducer from './reducers'; +import * as actions from './actions'; +import sagas from './sagas'; +import * as types from './types'; +import Environments from './Environments'; + +export default Environments; +export { reducer, sagas, actions, types }; diff --git a/src/App/ConnectionWizard/Environments/reducers.ts b/src/App/ConnectionWizard/Environments/reducers.ts index b95d799..cac856a 100644 --- a/src/App/ConnectionWizard/Environments/reducers.ts +++ b/src/App/ConnectionWizard/Environments/reducers.ts @@ -1,90 +1,90 @@ -import { - INIT_ENVIRONMENTS, - REQUEST_ENVIRONMENTS, - SET_ENVIRONMENTS, - SET_ENVIRONMENTS_ERROR, - REQUEST_MONETARY_ZONES, - SET_MONETARY_ZONES, - SET_MONETARY_ZONES_ERROR, - EnvironmentsActionTypes, - EnvironmentsState, -} from './types'; - -const initialState = { - isEnvironmentsPending: false, - environments: [], - environmentsError: null, - isMonetaryZonesPending: false, - monetaryZones: [], - monetaryZonesError: null, -}; - -export default function appReducer( - state: EnvironmentsState = initialState, - action: EnvironmentsActionTypes -): EnvironmentsState { - switch (action.type) { - case INIT_ENVIRONMENTS: { - return { - ...state, - isEnvironmentsPending: true, - environments: initialState.environments, - environmentsError: initialState.environmentsError, - isMonetaryZonesPending: true, - monetaryZones: initialState.monetaryZones, - monetaryZonesError: initialState.monetaryZonesError, - }; - } - - case REQUEST_ENVIRONMENTS: { - return { - ...state, - isEnvironmentsPending: true, - environments: initialState.environments, - environmentsError: initialState.environmentsError, - }; - } - case SET_ENVIRONMENTS: { - return { - ...state, - isEnvironmentsPending: false, - environments: action.data, - environmentsError: initialState.environmentsError, - }; - } - case SET_ENVIRONMENTS_ERROR: { - return { - ...state, - isEnvironmentsPending: false, - environments: initialState.environments, - environmentsError: action.error, - }; - } - case REQUEST_MONETARY_ZONES: { - return { - ...state, - isMonetaryZonesPending: true, - monetaryZones: initialState.monetaryZones, - monetaryZonesError: initialState.monetaryZonesError, - }; - } - case SET_MONETARY_ZONES: { - return { - ...state, - isMonetaryZonesPending: false, - monetaryZones: action.data, - monetaryZonesError: initialState.monetaryZonesError, - }; - } - case SET_MONETARY_ZONES_ERROR: { - return { - ...state, - isMonetaryZonesPending: false, - monetaryZones: initialState.monetaryZones, - monetaryZonesError: action.error, - }; - } - default: - return state; - } -} +import { + INIT_ENVIRONMENTS, + REQUEST_ENVIRONMENTS, + SET_ENVIRONMENTS, + SET_ENVIRONMENTS_ERROR, + REQUEST_MONETARY_ZONES, + SET_MONETARY_ZONES, + SET_MONETARY_ZONES_ERROR, + EnvironmentsActionTypes, + EnvironmentsState, +} from './types'; + +const initialState = { + isEnvironmentsPending: false, + environments: [], + environmentsError: null, + isMonetaryZonesPending: false, + monetaryZones: [], + monetaryZonesError: null, +}; + +export default function appReducer( + state: EnvironmentsState = initialState, + action: EnvironmentsActionTypes +): EnvironmentsState { + switch (action.type) { + case INIT_ENVIRONMENTS: { + return { + ...state, + isEnvironmentsPending: true, + environments: initialState.environments, + environmentsError: initialState.environmentsError, + isMonetaryZonesPending: true, + monetaryZones: initialState.monetaryZones, + monetaryZonesError: initialState.monetaryZonesError, + }; + } + + case REQUEST_ENVIRONMENTS: { + return { + ...state, + isEnvironmentsPending: true, + environments: initialState.environments, + environmentsError: initialState.environmentsError, + }; + } + case SET_ENVIRONMENTS: { + return { + ...state, + isEnvironmentsPending: false, + environments: action.data, + environmentsError: initialState.environmentsError, + }; + } + case SET_ENVIRONMENTS_ERROR: { + return { + ...state, + isEnvironmentsPending: false, + environments: initialState.environments, + environmentsError: action.error, + }; + } + case REQUEST_MONETARY_ZONES: { + return { + ...state, + isMonetaryZonesPending: true, + monetaryZones: initialState.monetaryZones, + monetaryZonesError: initialState.monetaryZonesError, + }; + } + case SET_MONETARY_ZONES: { + return { + ...state, + isMonetaryZonesPending: false, + monetaryZones: action.data, + monetaryZonesError: initialState.monetaryZonesError, + }; + } + case SET_MONETARY_ZONES_ERROR: { + return { + ...state, + isMonetaryZonesPending: false, + monetaryZones: initialState.monetaryZones, + monetaryZonesError: action.error, + }; + } + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Environments/sagas.ts b/src/App/ConnectionWizard/Environments/sagas.ts index 518f33b..b730a72 100644 --- a/src/App/ConnectionWizard/Environments/sagas.ts +++ b/src/App/ConnectionWizard/Environments/sagas.ts @@ -1,51 +1,51 @@ -import { Action } from 'redux'; -import apis from 'utils/apis'; -import { is200 } from 'utils/http'; -import { all, call, put, takeLatest } from 'redux-saga/effects'; -import { - INIT_ENVIRONMENTS, - REQUEST_ENVIRONMENTS, - REQUEST_MONETARY_ZONES, - RequestEnvironmentsAction, - RequestMonetaryZonesAction, -} from './types'; -import { setEnvironments, setMonetaryZones, setMonetaryZonesError } from './actions'; - -function* fetchEnvironments(action: RequestEnvironmentsAction) { - const data = [{ id: '1', name: 'Environment' }]; - yield put(setEnvironments({ data })); -} - -export function* requestEnvironmentsSaga() { - yield takeLatest([REQUEST_ENVIRONMENTS], fetchEnvironments); -} - -function* fetchMonetaryZones(action: RequestMonetaryZonesAction) { - try { - const response = yield call(apis.monetaryZones.read, {}); - - if (is200(response.status)) { - yield put(setMonetaryZones({ data: response.data })); - } else { - yield put(setMonetaryZonesError({ error: 'Error Fetching Monetary Zones' })); - } - } catch (e) { - yield put(setMonetaryZonesError({ error: e.message })); - } -} - -export function* requestMonetaryZonesSaga() { - yield takeLatest([REQUEST_MONETARY_ZONES], fetchMonetaryZones); -} - -export function* fetchEnvironmentsAndMonetaryZones(action: Action) { - yield all([fetchEnvironments(action), fetchMonetaryZones(action)]); -} - -export function* initEnvironmentsSaga() { - yield takeLatest([INIT_ENVIRONMENTS], fetchEnvironmentsAndMonetaryZones); -} - -export default function* rootSaga() { - yield all([initEnvironmentsSaga(), requestEnvironmentsSaga()]); -} +import { Action } from 'redux'; +import apis from 'utils/apis'; +import { is200 } from 'utils/http'; +import { all, call, put, takeLatest } from 'redux-saga/effects'; +import { + INIT_ENVIRONMENTS, + REQUEST_ENVIRONMENTS, + REQUEST_MONETARY_ZONES, + RequestEnvironmentsAction, + RequestMonetaryZonesAction, +} from './types'; +import { setEnvironments, setMonetaryZones, setMonetaryZonesError } from './actions'; + +function* fetchEnvironments(action: RequestEnvironmentsAction) { + const data = [{ id: '1', name: 'Environment' }]; + yield put(setEnvironments({ data })); +} + +export function* requestEnvironmentsSaga() { + yield takeLatest([REQUEST_ENVIRONMENTS], fetchEnvironments); +} + +function* fetchMonetaryZones(action: RequestMonetaryZonesAction) { + try { + const response = yield call(apis.monetaryZones.read, {}); + + if (is200(response.status)) { + yield put(setMonetaryZones({ data: response.data })); + } else { + yield put(setMonetaryZonesError({ error: 'Error Fetching Monetary Zones' })); + } + } catch (e) { + yield put(setMonetaryZonesError({ error: e.message })); + } +} + +export function* requestMonetaryZonesSaga() { + yield takeLatest([REQUEST_MONETARY_ZONES], fetchMonetaryZones); +} + +export function* fetchEnvironmentsAndMonetaryZones(action: Action) { + yield all([fetchEnvironments(action), fetchMonetaryZones(action)]); +} + +export function* initEnvironmentsSaga() { + yield takeLatest([INIT_ENVIRONMENTS], fetchEnvironmentsAndMonetaryZones); +} + +export default function* rootSaga() { + yield all([initEnvironmentsSaga(), requestEnvironmentsSaga()]); +} diff --git a/src/App/ConnectionWizard/Environments/types.ts b/src/App/ConnectionWizard/Environments/types.ts index 815da58..f82801c 100644 --- a/src/App/ConnectionWizard/Environments/types.ts +++ b/src/App/ConnectionWizard/Environments/types.ts @@ -1,84 +1,84 @@ -import { ErrorMessage } from 'App/types'; -// TODO: Use import type as soon as it's available in order to avoid type dependency cycles -/* eslint-disable-next-line import/no-cycle */ -import { Environment, EnvironmentStatus } from '../types'; - -export const INIT_ENVIRONMENTS = 'Environments / Init'; -export const REQUEST_ENVIRONMENTS = 'Environments / Request Environments'; -export const SET_ENVIRONMENTS = 'Environments / Set Environments'; -export const SET_ENVIRONMENTS_ERROR = 'Environments / Set Environments Error'; -export const REQUEST_ENVIRONMENTS_STATUSES = 'Environments / Request Environments Statuses'; -export const SET_ENVIRONMENTS_STATUSES = 'Environments / Set Environments Statuses'; -export const SET_ENVIRONMENTS_STATUSES_ERROR = 'Environments / Set Environments Statuses Error'; -export const REQUEST_MONETARY_ZONES = 'Environment / Request Monetary zones'; -export const SET_MONETARY_ZONES = 'Environment / Set Monetary zones'; -export const SET_MONETARY_ZONES_ERROR = 'Environment / Set Monetary Zones Error'; - -export interface EnvironmentsState { - isEnvironmentsPending: boolean; - environments: Environment[]; - environmentsError: ErrorMessage; - isMonetaryZonesPending: boolean; - monetaryZones: MonetaryZone[]; - monetaryZonesError: ErrorMessage; -} - -export interface MonetaryZone { - monetaryZoneId: string; - name: string; -} - -export interface InitEnvironmentsAction { - type: typeof INIT_ENVIRONMENTS; -} - -export interface RequestEnvironmentsAction { - type: typeof REQUEST_ENVIRONMENTS; -} - -export interface SetEnvironmentsAction { - type: typeof SET_ENVIRONMENTS; - data: Environment[]; -} - -export interface SetEnvironmentsErrorAction { - type: typeof SET_ENVIRONMENTS_ERROR; - error: ErrorMessage; -} - -export interface RequestEnvironmentsStatusesAction { - type: typeof REQUEST_ENVIRONMENTS_STATUSES; -} - -export interface SetEnvironmentsStatusesAction { - type: typeof SET_ENVIRONMENTS_STATUSES; - data: EnvironmentStatus[]; -} - -export interface SetEnvironmentsStatusesErrorAction { - type: typeof SET_ENVIRONMENTS_STATUSES_ERROR; - error: ErrorMessage; -} - -export interface RequestMonetaryZonesAction { - type: typeof REQUEST_MONETARY_ZONES; -} - -export interface SetMonetaryZonesAction { - type: typeof SET_MONETARY_ZONES; - data: MonetaryZone[]; -} - -export interface SetMonetaryZonesErrorAction { - type: typeof SET_MONETARY_ZONES_ERROR; - error: ErrorMessage; -} - -export type EnvironmentsActionTypes = - | InitEnvironmentsAction - | RequestEnvironmentsAction - | SetEnvironmentsAction - | SetEnvironmentsErrorAction - | RequestMonetaryZonesAction - | SetMonetaryZonesAction - | SetMonetaryZonesErrorAction; +import { ErrorMessage } from 'App/types'; +// TODO: Use import type as soon as it's available in order to avoid type dependency cycles +/* eslint-disable-next-line import/no-cycle */ +import { Environment, EnvironmentStatus } from '../types'; + +export const INIT_ENVIRONMENTS = 'Environments / Init'; +export const REQUEST_ENVIRONMENTS = 'Environments / Request Environments'; +export const SET_ENVIRONMENTS = 'Environments / Set Environments'; +export const SET_ENVIRONMENTS_ERROR = 'Environments / Set Environments Error'; +export const REQUEST_ENVIRONMENTS_STATUSES = 'Environments / Request Environments Statuses'; +export const SET_ENVIRONMENTS_STATUSES = 'Environments / Set Environments Statuses'; +export const SET_ENVIRONMENTS_STATUSES_ERROR = 'Environments / Set Environments Statuses Error'; +export const REQUEST_MONETARY_ZONES = 'Environment / Request Monetary zones'; +export const SET_MONETARY_ZONES = 'Environment / Set Monetary zones'; +export const SET_MONETARY_ZONES_ERROR = 'Environment / Set Monetary Zones Error'; + +export interface EnvironmentsState { + isEnvironmentsPending: boolean; + environments: Environment[]; + environmentsError: ErrorMessage; + isMonetaryZonesPending: boolean; + monetaryZones: MonetaryZone[]; + monetaryZonesError: ErrorMessage; +} + +export interface MonetaryZone { + monetaryZoneId: string; + name: string; +} + +export interface InitEnvironmentsAction { + type: typeof INIT_ENVIRONMENTS; +} + +export interface RequestEnvironmentsAction { + type: typeof REQUEST_ENVIRONMENTS; +} + +export interface SetEnvironmentsAction { + type: typeof SET_ENVIRONMENTS; + data: Environment[]; +} + +export interface SetEnvironmentsErrorAction { + type: typeof SET_ENVIRONMENTS_ERROR; + error: ErrorMessage; +} + +export interface RequestEnvironmentsStatusesAction { + type: typeof REQUEST_ENVIRONMENTS_STATUSES; +} + +export interface SetEnvironmentsStatusesAction { + type: typeof SET_ENVIRONMENTS_STATUSES; + data: EnvironmentStatus[]; +} + +export interface SetEnvironmentsStatusesErrorAction { + type: typeof SET_ENVIRONMENTS_STATUSES_ERROR; + error: ErrorMessage; +} + +export interface RequestMonetaryZonesAction { + type: typeof REQUEST_MONETARY_ZONES; +} + +export interface SetMonetaryZonesAction { + type: typeof SET_MONETARY_ZONES; + data: MonetaryZone[]; +} + +export interface SetMonetaryZonesErrorAction { + type: typeof SET_MONETARY_ZONES_ERROR; + error: ErrorMessage; +} + +export type EnvironmentsActionTypes = + | InitEnvironmentsAction + | RequestEnvironmentsAction + | SetEnvironmentsAction + | SetEnvironmentsErrorAction + | RequestMonetaryZonesAction + | SetMonetaryZonesAction + | SetMonetaryZonesErrorAction; diff --git a/src/App/ConnectionWizard/Shared/actions.ts b/src/App/ConnectionWizard/Shared/actions.ts index 36642fa..6bb6662 100644 --- a/src/App/ConnectionWizard/Shared/actions.ts +++ b/src/App/ConnectionWizard/Shared/actions.ts @@ -1,72 +1,72 @@ -import { ErrorMessage } from 'App/types'; -import { EnvironmentStatus } from '../types'; -import { - REQUEST_ENVIRONMENTS_STATUSES, - SET_ENVIRONMENTS_STATUSES, - SET_ENVIRONMENTS_STATUSES_ERROR, - REQUEST_ENVIRONMENT_STATUS, - SET_ENVIRONMENT_STATUS, - SET_ENVIRONMENT_STATUS_ERROR, - RequestEnvironmentsStatusesAction, - SetEnvironmentsStatusesAction, - SetEnvironmentsStatusesErrorAction, - RequestEnvironmentStatusAction, - SetEnvironmentStatusAction, - SetEnvironmentStatusErrorAction, -} from './types'; - -export function requestEnvironmentsStatuses(): RequestEnvironmentsStatusesAction { - return { - type: REQUEST_ENVIRONMENTS_STATUSES, - }; -} - -export function setEnvironmentsStatuses({ - data, -}: { - data: EnvironmentStatus[]; -}): SetEnvironmentsStatusesAction { - return { - type: SET_ENVIRONMENTS_STATUSES, - data, - }; -} - -export function setEnvironmentsStatusesError({ - error, -}: { - error: ErrorMessage; -}): SetEnvironmentsStatusesErrorAction { - return { - type: SET_ENVIRONMENTS_STATUSES_ERROR, - error, - }; -} - -export function requestEnvironmentStatus(): RequestEnvironmentStatusAction { - return { - type: REQUEST_ENVIRONMENT_STATUS, - }; -} - -export function setEnvironmentStatus({ - data, -}: { - data: EnvironmentStatus; -}): SetEnvironmentStatusAction { - return { - type: SET_ENVIRONMENT_STATUS, - data, - }; -} - -export function setEnvironmentStatusError({ - error, -}: { - error: ErrorMessage; -}): SetEnvironmentStatusErrorAction { - return { - type: SET_ENVIRONMENT_STATUS_ERROR, - error, - }; -} +import { ErrorMessage } from 'App/types'; +import { EnvironmentStatus } from '../types'; +import { + REQUEST_ENVIRONMENTS_STATUSES, + SET_ENVIRONMENTS_STATUSES, + SET_ENVIRONMENTS_STATUSES_ERROR, + REQUEST_ENVIRONMENT_STATUS, + SET_ENVIRONMENT_STATUS, + SET_ENVIRONMENT_STATUS_ERROR, + RequestEnvironmentsStatusesAction, + SetEnvironmentsStatusesAction, + SetEnvironmentsStatusesErrorAction, + RequestEnvironmentStatusAction, + SetEnvironmentStatusAction, + SetEnvironmentStatusErrorAction, +} from './types'; + +export function requestEnvironmentsStatuses(): RequestEnvironmentsStatusesAction { + return { + type: REQUEST_ENVIRONMENTS_STATUSES, + }; +} + +export function setEnvironmentsStatuses({ + data, +}: { + data: EnvironmentStatus[]; +}): SetEnvironmentsStatusesAction { + return { + type: SET_ENVIRONMENTS_STATUSES, + data, + }; +} + +export function setEnvironmentsStatusesError({ + error, +}: { + error: ErrorMessage; +}): SetEnvironmentsStatusesErrorAction { + return { + type: SET_ENVIRONMENTS_STATUSES_ERROR, + error, + }; +} + +export function requestEnvironmentStatus(): RequestEnvironmentStatusAction { + return { + type: REQUEST_ENVIRONMENT_STATUS, + }; +} + +export function setEnvironmentStatus({ + data, +}: { + data: EnvironmentStatus; +}): SetEnvironmentStatusAction { + return { + type: SET_ENVIRONMENT_STATUS, + data, + }; +} + +export function setEnvironmentStatusError({ + error, +}: { + error: ErrorMessage; +}): SetEnvironmentStatusErrorAction { + return { + type: SET_ENVIRONMENT_STATUS_ERROR, + error, + }; +} diff --git a/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentStatus.tsx b/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentStatus.tsx index 4c936fc..a9106c2 100644 --- a/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentStatus.tsx +++ b/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentStatus.tsx @@ -1,42 +1,42 @@ -import React, { PureComponent, ComponentType } from 'react'; -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { EnvironmentStatus } from '../../types'; -import { requestEnvironmentStatus } from '../actions'; -import { getEnvironmentsStatuses } from '../selectors'; -import { getEnvironmentId } from '../../selectors'; - -type EnvironmentStatusLoaderProps = { - onEnvironmentMount: () => void; - environmentId: string | undefined; - environmentsStatuses: EnvironmentStatus[]; -}; - -export default function loadEnvironmentStatus(Cmp: ComponentType) { - class EnvironmentStatusLoader extends PureComponent { - componentDidMount() { - const { environmentId, environmentsStatuses, onEnvironmentMount } = this.props; - if ( - !(environmentId && environmentsStatuses.find((env) => env.environmentId === environmentId)) - ) { - onEnvironmentMount(); - } - } - - render() { - /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ - const { onEnvironmentMount, ...props } = this.props; - // @ts-ignore - return ; - } - } - return connect( - (state: State) => ({ - environmentsStatuses: getEnvironmentsStatuses(state), - environmentId: getEnvironmentId(state), - }), - (dispatch: Dispatch) => ({ - onEnvironmentMount: () => dispatch(requestEnvironmentStatus()), - }) - )(EnvironmentStatusLoader); -} +import React, { PureComponent, ComponentType } from 'react'; +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { EnvironmentStatus } from '../../types'; +import { requestEnvironmentStatus } from '../actions'; +import { getEnvironmentsStatuses } from '../selectors'; +import { getEnvironmentId } from '../../selectors'; + +type EnvironmentStatusLoaderProps = { + onEnvironmentMount: () => void; + environmentId: string | undefined; + environmentsStatuses: EnvironmentStatus[]; +}; + +export default function loadEnvironmentStatus(Cmp: ComponentType) { + class EnvironmentStatusLoader extends PureComponent { + componentDidMount() { + const { environmentId, environmentsStatuses, onEnvironmentMount } = this.props; + if ( + !(environmentId && environmentsStatuses.find((env) => env.environmentId === environmentId)) + ) { + onEnvironmentMount(); + } + } + + render() { + /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ + const { onEnvironmentMount, ...props } = this.props; + // @ts-ignore + return ; + } + } + return connect( + (state: State) => ({ + environmentsStatuses: getEnvironmentsStatuses(state), + environmentId: getEnvironmentId(state), + }), + (dispatch: Dispatch) => ({ + onEnvironmentMount: () => dispatch(requestEnvironmentStatus()), + }) + )(EnvironmentStatusLoader); +} diff --git a/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentsStatus.tsx b/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentsStatus.tsx index 93a693e..7510367 100644 --- a/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentsStatus.tsx +++ b/src/App/ConnectionWizard/Shared/hocs/loadEnvironmentsStatus.tsx @@ -1,25 +1,25 @@ -import React, { PureComponent, ComponentType } from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'store/types'; -import { requestEnvironmentsStatuses } from '../actions'; - -type EnvironmentsStatusLoaderProps = { - onEnvironmentsMount: () => void; -}; - -export default function loadEnvironmentsStatus(Cmp: ComponentType) { - class EnvironmentsStatusLoader extends PureComponent { - componentDidMount() { - this.props.onEnvironmentsMount(); - } - - render() { - /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ - const { onEnvironmentsMount, ...props } = this.props; - return ; - } - } - return connect(null, (dispatch: Dispatch) => ({ - onEnvironmentsMount: () => dispatch(requestEnvironmentsStatuses()), - }))(EnvironmentsStatusLoader); -} +import React, { PureComponent, ComponentType } from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'store/types'; +import { requestEnvironmentsStatuses } from '../actions'; + +type EnvironmentsStatusLoaderProps = { + onEnvironmentsMount: () => void; +}; + +export default function loadEnvironmentsStatus(Cmp: ComponentType) { + class EnvironmentsStatusLoader extends PureComponent { + componentDidMount() { + this.props.onEnvironmentsMount(); + } + + render() { + /* eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars */ + const { onEnvironmentsMount, ...props } = this.props; + return ; + } + } + return connect(null, (dispatch: Dispatch) => ({ + onEnvironmentsMount: () => dispatch(requestEnvironmentsStatuses()), + }))(EnvironmentsStatusLoader); +} diff --git a/src/App/ConnectionWizard/Shared/index.ts b/src/App/ConnectionWizard/Shared/index.ts index 08b07aa..fe866a9 100644 --- a/src/App/ConnectionWizard/Shared/index.ts +++ b/src/App/ConnectionWizard/Shared/index.ts @@ -1,6 +1,6 @@ -import reducer from './reducers'; -import * as actions from './actions'; -import sagas from './sagas'; -import * as types from './types'; - -export { reducer, sagas, actions, types }; +import reducer from './reducers'; +import * as actions from './actions'; +import sagas from './sagas'; +import * as types from './types'; + +export { reducer, sagas, actions, types }; diff --git a/src/App/ConnectionWizard/Shared/reducers.ts b/src/App/ConnectionWizard/Shared/reducers.ts index 240bf1d..ccb02b2 100644 --- a/src/App/ConnectionWizard/Shared/reducers.ts +++ b/src/App/ConnectionWizard/Shared/reducers.ts @@ -1,89 +1,89 @@ -import { - REQUEST_ENVIRONMENTS_STATUSES, - SET_ENVIRONMENTS_STATUSES, - SET_ENVIRONMENTS_STATUSES_ERROR, - REQUEST_ENVIRONMENT_STATUS, - SET_ENVIRONMENT_STATUS, - SET_ENVIRONMENT_STATUS_ERROR, - SharedState, - SharedActionTypes, -} from './types'; - -const initialState = { - isEnvironmentsStatusesPending: false, - environmentsStatuses: [], - environmentsStatusesError: null, -}; - -export default function appReducer( - state: SharedState = initialState, - action: SharedActionTypes -): SharedState { - switch (action.type) { - case REQUEST_ENVIRONMENTS_STATUSES: { - return { - ...state, - isEnvironmentsStatusesPending: true, - environmentsStatuses: initialState.environmentsStatuses, - environmentsStatusesError: initialState.environmentsStatusesError, - }; - } - case SET_ENVIRONMENTS_STATUSES: { - return { - ...state, - isEnvironmentsStatusesPending: false, - environmentsStatuses: action.data, - environmentsStatusesError: initialState.environmentsStatusesError, - }; - } - case SET_ENVIRONMENTS_STATUSES_ERROR: { - return { - ...state, - isEnvironmentsStatusesPending: false, - environmentsStatuses: initialState.environmentsStatuses, - environmentsStatusesError: action.error, - }; - } - case REQUEST_ENVIRONMENT_STATUS: { - return { - ...state, - isEnvironmentsStatusesPending: true, - environmentsStatusesError: initialState.environmentsStatusesError, - }; - } - case SET_ENVIRONMENT_STATUS: { - const { environmentId } = action.data; - const index = state.environmentsStatuses.findIndex( - (status) => status.environmentId === environmentId - ); - if (index) { - return { - ...state, - isEnvironmentsStatusesPending: false, - environmentsStatuses: [ - ...state.environmentsStatuses.slice(0, index - 1), - { ...action.data }, - ...state.environmentsStatuses.slice(index + 1), - ], - environmentsStatusesError: initialState.environmentsStatusesError, - }; - } - return { - ...state, - isEnvironmentsStatusesPending: false, - environmentsStatuses: [action.data], - environmentsStatusesError: initialState.environmentsStatusesError, - }; - } - case SET_ENVIRONMENT_STATUS_ERROR: { - return { - ...state, - isEnvironmentsStatusesPending: false, - environmentsStatuses: initialState.environmentsStatuses, - environmentsStatusesError: action.error, - }; - } - default: - return state; - } -} +import { + REQUEST_ENVIRONMENTS_STATUSES, + SET_ENVIRONMENTS_STATUSES, + SET_ENVIRONMENTS_STATUSES_ERROR, + REQUEST_ENVIRONMENT_STATUS, + SET_ENVIRONMENT_STATUS, + SET_ENVIRONMENT_STATUS_ERROR, + SharedState, + SharedActionTypes, +} from './types'; + +const initialState = { + isEnvironmentsStatusesPending: false, + environmentsStatuses: [], + environmentsStatusesError: null, +}; + +export default function appReducer( + state: SharedState = initialState, + action: SharedActionTypes +): SharedState { + switch (action.type) { + case REQUEST_ENVIRONMENTS_STATUSES: { + return { + ...state, + isEnvironmentsStatusesPending: true, + environmentsStatuses: initialState.environmentsStatuses, + environmentsStatusesError: initialState.environmentsStatusesError, + }; + } + case SET_ENVIRONMENTS_STATUSES: { + return { + ...state, + isEnvironmentsStatusesPending: false, + environmentsStatuses: action.data, + environmentsStatusesError: initialState.environmentsStatusesError, + }; + } + case SET_ENVIRONMENTS_STATUSES_ERROR: { + return { + ...state, + isEnvironmentsStatusesPending: false, + environmentsStatuses: initialState.environmentsStatuses, + environmentsStatusesError: action.error, + }; + } + case REQUEST_ENVIRONMENT_STATUS: { + return { + ...state, + isEnvironmentsStatusesPending: true, + environmentsStatusesError: initialState.environmentsStatusesError, + }; + } + case SET_ENVIRONMENT_STATUS: { + const { environmentId } = action.data; + const index = state.environmentsStatuses.findIndex( + (status) => status.environmentId === environmentId + ); + if (index) { + return { + ...state, + isEnvironmentsStatusesPending: false, + environmentsStatuses: [ + ...state.environmentsStatuses.slice(0, index - 1), + { ...action.data }, + ...state.environmentsStatuses.slice(index + 1), + ], + environmentsStatusesError: initialState.environmentsStatusesError, + }; + } + return { + ...state, + isEnvironmentsStatusesPending: false, + environmentsStatuses: [action.data], + environmentsStatusesError: initialState.environmentsStatusesError, + }; + } + case SET_ENVIRONMENT_STATUS_ERROR: { + return { + ...state, + isEnvironmentsStatusesPending: false, + environmentsStatuses: initialState.environmentsStatuses, + environmentsStatusesError: action.error, + }; + } + default: + return state; + } +} diff --git a/src/App/ConnectionWizard/Shared/sagas.ts b/src/App/ConnectionWizard/Shared/sagas.ts index bc303cf..0951dca 100644 --- a/src/App/ConnectionWizard/Shared/sagas.ts +++ b/src/App/ConnectionWizard/Shared/sagas.ts @@ -1,64 +1,64 @@ -import apis from 'utils/apis'; -import { is200 } from 'utils/http'; -import { all, call, put, select, takeLatest } from 'redux-saga/effects'; -import { getEnvironments, getEnvironmentId } from '../selectors'; -import { Environment } from '../types'; -import { - REQUEST_ENVIRONMENTS_STATUSES, - REQUEST_ENVIRONMENT_STATUS, - RequestEnvironmentsStatusesAction, - RequestEnvironmentStatusAction, -} from './types'; -import { - setEnvironmentsStatuses, - setEnvironmentsStatusesError, - setEnvironmentStatus, - setEnvironmentStatusError, -} from './actions'; - -function* fetchSingleEnvironmentStatus(environmentId: string) { - const { data, status } = yield call(apis.environmentStatus.read, { environmentId }); - if (!is200(status)) { - throw Error('Error Fetching Environment Status'); - } - return { - environmentId, - phases: data, - }; -} - -function* fetchEnvironmentStatus(action: RequestEnvironmentStatusAction) { - const environmentId = yield select(getEnvironmentId); - try { - const data = yield call(fetchSingleEnvironmentStatus, environmentId); - yield put(setEnvironmentStatus({ data })); - } catch (e) { - yield put(setEnvironmentStatusError({ error: e.message })); - } -} - -export function* requestEnvironmentStatusSaga() { - yield takeLatest([REQUEST_ENVIRONMENT_STATUS], fetchEnvironmentStatus); -} - -function* fetchEnvironmentsStatuses(action: RequestEnvironmentsStatusesAction) { - const environments = yield select(getEnvironments); - try { - const data = yield all( - environments.map((environment: Environment) => - call(fetchSingleEnvironmentStatus, environment.id) - ) - ); - yield put(setEnvironmentsStatuses({ data })); - } catch (e) { - yield put(setEnvironmentsStatusesError({ error: e.message })); - } -} - -export function* requestEnvironmentsStatusesSaga() { - yield takeLatest([REQUEST_ENVIRONMENTS_STATUSES], fetchEnvironmentsStatuses); -} - -export default function* rootSaga() { - yield all([requestEnvironmentsStatusesSaga(), requestEnvironmentStatusSaga()]); -} +import apis from 'utils/apis'; +import { is200 } from 'utils/http'; +import { all, call, put, select, takeLatest } from 'redux-saga/effects'; +import { getEnvironments, getEnvironmentId } from '../selectors'; +import { Environment } from '../types'; +import { + REQUEST_ENVIRONMENTS_STATUSES, + REQUEST_ENVIRONMENT_STATUS, + RequestEnvironmentsStatusesAction, + RequestEnvironmentStatusAction, +} from './types'; +import { + setEnvironmentsStatuses, + setEnvironmentsStatusesError, + setEnvironmentStatus, + setEnvironmentStatusError, +} from './actions'; + +function* fetchSingleEnvironmentStatus(environmentId: string) { + const { data, status } = yield call(apis.environmentStatus.read, { environmentId }); + if (!is200(status)) { + throw Error('Error Fetching Environment Status'); + } + return { + environmentId, + phases: data, + }; +} + +function* fetchEnvironmentStatus(action: RequestEnvironmentStatusAction) { + const environmentId = yield select(getEnvironmentId); + try { + const data = yield call(fetchSingleEnvironmentStatus, environmentId); + yield put(setEnvironmentStatus({ data })); + } catch (e) { + yield put(setEnvironmentStatusError({ error: e.message })); + } +} + +export function* requestEnvironmentStatusSaga() { + yield takeLatest([REQUEST_ENVIRONMENT_STATUS], fetchEnvironmentStatus); +} + +function* fetchEnvironmentsStatuses(action: RequestEnvironmentsStatusesAction) { + const environments = yield select(getEnvironments); + try { + const data = yield all( + environments.map((environment: Environment) => + call(fetchSingleEnvironmentStatus, environment.id) + ) + ); + yield put(setEnvironmentsStatuses({ data })); + } catch (e) { + yield put(setEnvironmentsStatusesError({ error: e.message })); + } +} + +export function* requestEnvironmentsStatusesSaga() { + yield takeLatest([REQUEST_ENVIRONMENTS_STATUSES], fetchEnvironmentsStatuses); +} + +export default function* rootSaga() { + yield all([requestEnvironmentsStatusesSaga(), requestEnvironmentStatusSaga()]); +} diff --git a/src/App/ConnectionWizard/Shared/selectors.ts b/src/App/ConnectionWizard/Shared/selectors.ts index c796320..790f893 100644 --- a/src/App/ConnectionWizard/Shared/selectors.ts +++ b/src/App/ConnectionWizard/Shared/selectors.ts @@ -1,3 +1,3 @@ -import { State } from 'store/types'; - -export const getEnvironmentsStatuses = (state: State) => state.wizard.shared.environmentsStatuses; +import { State } from 'store/types'; + +export const getEnvironmentsStatuses = (state: State) => state.wizard.shared.environmentsStatuses; diff --git a/src/App/ConnectionWizard/Shared/types.ts b/src/App/ConnectionWizard/Shared/types.ts index b28feb2..fbb6ebb 100644 --- a/src/App/ConnectionWizard/Shared/types.ts +++ b/src/App/ConnectionWizard/Shared/types.ts @@ -1,52 +1,52 @@ -import { ErrorMessage } from 'App/types'; -// eslint-disable-next-line import/no-cycle -import { EnvironmentStatus } from '../types'; - -export const REQUEST_ENVIRONMENTS_STATUSES = 'Wizard / Request Environments Statuses'; -export const SET_ENVIRONMENTS_STATUSES = 'Wizard / Set Environments Statuses'; -export const SET_ENVIRONMENTS_STATUSES_ERROR = 'Wizard / Set Environments Statuses Error'; -export const REQUEST_ENVIRONMENT_STATUS = 'Wizard / Request Environment Status'; -export const SET_ENVIRONMENT_STATUS = 'Wizard / Set Environment Status'; -export const SET_ENVIRONMENT_STATUS_ERROR = 'Wizard / Set Environment Status Error'; - -export interface SharedState { - isEnvironmentsStatusesPending: boolean; - environmentsStatuses: EnvironmentStatus[]; - environmentsStatusesError: ErrorMessage; -} - -export interface RequestEnvironmentsStatusesAction { - type: typeof REQUEST_ENVIRONMENTS_STATUSES; -} - -export interface SetEnvironmentsStatusesAction { - type: typeof SET_ENVIRONMENTS_STATUSES; - data: EnvironmentStatus[]; -} - -export interface SetEnvironmentsStatusesErrorAction { - type: typeof SET_ENVIRONMENTS_STATUSES_ERROR; - error: ErrorMessage; -} - -export interface RequestEnvironmentStatusAction { - type: typeof REQUEST_ENVIRONMENT_STATUS; -} - -export interface SetEnvironmentStatusAction { - type: typeof SET_ENVIRONMENT_STATUS; - data: EnvironmentStatus; -} - -export interface SetEnvironmentStatusErrorAction { - type: typeof SET_ENVIRONMENT_STATUS_ERROR; - error: ErrorMessage; -} - -export type SharedActionTypes = - | RequestEnvironmentsStatusesAction - | SetEnvironmentsStatusesAction - | SetEnvironmentsStatusesErrorAction - | RequestEnvironmentStatusAction - | SetEnvironmentStatusAction - | SetEnvironmentStatusErrorAction; +import { ErrorMessage } from 'App/types'; +// eslint-disable-next-line import/no-cycle +import { EnvironmentStatus } from '../types'; + +export const REQUEST_ENVIRONMENTS_STATUSES = 'Wizard / Request Environments Statuses'; +export const SET_ENVIRONMENTS_STATUSES = 'Wizard / Set Environments Statuses'; +export const SET_ENVIRONMENTS_STATUSES_ERROR = 'Wizard / Set Environments Statuses Error'; +export const REQUEST_ENVIRONMENT_STATUS = 'Wizard / Request Environment Status'; +export const SET_ENVIRONMENT_STATUS = 'Wizard / Set Environment Status'; +export const SET_ENVIRONMENT_STATUS_ERROR = 'Wizard / Set Environment Status Error'; + +export interface SharedState { + isEnvironmentsStatusesPending: boolean; + environmentsStatuses: EnvironmentStatus[]; + environmentsStatusesError: ErrorMessage; +} + +export interface RequestEnvironmentsStatusesAction { + type: typeof REQUEST_ENVIRONMENTS_STATUSES; +} + +export interface SetEnvironmentsStatusesAction { + type: typeof SET_ENVIRONMENTS_STATUSES; + data: EnvironmentStatus[]; +} + +export interface SetEnvironmentsStatusesErrorAction { + type: typeof SET_ENVIRONMENTS_STATUSES_ERROR; + error: ErrorMessage; +} + +export interface RequestEnvironmentStatusAction { + type: typeof REQUEST_ENVIRONMENT_STATUS; +} + +export interface SetEnvironmentStatusAction { + type: typeof SET_ENVIRONMENT_STATUS; + data: EnvironmentStatus; +} + +export interface SetEnvironmentStatusErrorAction { + type: typeof SET_ENVIRONMENT_STATUS_ERROR; + error: ErrorMessage; +} + +export type SharedActionTypes = + | RequestEnvironmentsStatusesAction + | SetEnvironmentsStatusesAction + | SetEnvironmentsStatusesErrorAction + | RequestEnvironmentStatusAction + | SetEnvironmentStatusAction + | SetEnvironmentStatusErrorAction; diff --git a/src/App/ConnectionWizard/_mockData.js b/src/App/ConnectionWizard/_mockData.js index 1dd86ef..b6b64a8 100644 --- a/src/App/ConnectionWizard/_mockData.js +++ b/src/App/ConnectionWizard/_mockData.js @@ -1,41 +1,41 @@ -export const environments = [ - { id: '1', name: 'qa' }, - { id: '2', name: 'test' }, -]; - -export const getEnvironmentStatus = (id) => [ - { - phase: 'BUSINESS_SETUP', - steps: [ - { - identifier: 'ID_GENERATION', - status: 'COMPLETED', - }, - ], - }, - { - phase: 'TECHNICAL_SETUP', - steps: [ - { - identifier: 'ENDPOINTS', - status: 'COMPLETED', - }, - { - identifier: 'CSR_EXCHANGE', - status: 'IN_PROGRESS', - }, - { - identifier: 'CERTIFICATE_AUTHORITY', - status: 'COMPLETED', - }, - { - identifier: 'SERVER_CERTIFICATES_EXCHANGE', - status: 'COMPLETED', - }, - { - identifier: 'JWS_CERTIFICATES', - status: 'COMPLETED', - }, - ], - }, -]; +export const environments = [ + { id: '1', name: 'qa' }, + { id: '2', name: 'test' }, +]; + +export const getEnvironmentStatus = (id) => [ + { + phase: 'BUSINESS_SETUP', + steps: [ + { + identifier: 'ID_GENERATION', + status: 'COMPLETED', + }, + ], + }, + { + phase: 'TECHNICAL_SETUP', + steps: [ + { + identifier: 'ENDPOINTS', + status: 'COMPLETED', + }, + { + identifier: 'CSR_EXCHANGE', + status: 'IN_PROGRESS', + }, + { + identifier: 'CERTIFICATE_AUTHORITY', + status: 'COMPLETED', + }, + { + identifier: 'SERVER_CERTIFICATES_EXCHANGE', + status: 'COMPLETED', + }, + { + identifier: 'JWS_CERTIFICATES', + status: 'COMPLETED', + }, + ], + }, +]; diff --git a/src/App/ConnectionWizard/connectors.ts b/src/App/ConnectionWizard/connectors.ts index ee0ff3d..d5d2c6a 100644 --- a/src/App/ConnectionWizard/connectors.ts +++ b/src/App/ConnectionWizard/connectors.ts @@ -1,13 +1,13 @@ -import { connect } from 'react-redux'; -import { State } from 'store/types'; -import * as selectors from './selectors'; - -const stateProps = (state: State) => ({ - environments: selectors.getEnvironments(state), - environmentsError: selectors.getEnvironmentsError(state), - environmentsStatuses: selectors.getEnvironmentsStatuses(state), - environmentsStatusesError: selectors.getEnvironmentsStatusesError(state), - isEnvironmentsStatusesPending: selectors.getIsEnvironmentsStatusesPending(state), -}); - -export default connect(stateProps); +import { connect } from 'react-redux'; +import { State } from 'store/types'; +import * as selectors from './selectors'; + +const stateProps = (state: State) => ({ + environments: selectors.getEnvironments(state), + environmentsError: selectors.getEnvironmentsError(state), + environmentsStatuses: selectors.getEnvironmentsStatuses(state), + environmentsStatusesError: selectors.getEnvironmentsStatusesError(state), + isEnvironmentsStatusesPending: selectors.getIsEnvironmentsStatusesPending(state), +}); + +export default connect(stateProps); diff --git a/src/App/ConnectionWizard/helpers.ts b/src/App/ConnectionWizard/helpers.ts index 0936a61..ff2e394 100644 --- a/src/App/ConnectionWizard/helpers.ts +++ b/src/App/ConnectionWizard/helpers.ts @@ -1,215 +1,215 @@ -import { - Environment, - EnvironmentStatus, - EnvironmentPhaseStepStatuses, - EnvironmentPhase, - EnvironmentStep, - EnvironmentPhases, - EnvironmentStepIdentifiers, -} from './types'; - -enum LedColors { - Completed = '#12d670', - InProgress = '#ff9933', - ToDo = '#999999', - Unknown = '#000000', - Pending = '#DDDDDD', -} - -enum StatusMessages { - Completed = 'Completed', - InProgress = 'In Progress', - ToDo = 'To Do', - Unknown = 'Unknown', - Pending = 'Pending', -} - -interface ItemStatus { - status: StatusMessages; - statusColor: LedColors; - progress: string; -} - -const PendingResponse: ItemStatus = { - status: StatusMessages.Pending, - statusColor: LedColors.Pending, - progress: 'Pending', -}; - -const UnknownResponse: ItemStatus = { - status: StatusMessages.Unknown, - statusColor: LedColors.Unknown, - progress: 'Not Defined', -}; - -function isStepCompleted(step: EnvironmentStep) { - return step.status === EnvironmentPhaseStepStatuses.Completed; -} - -function getStepsPercentage(subset: EnvironmentStep[], items: EnvironmentStep[]) { - return Math.floor((subset.length / items.length) * 100); -} - -function getStatusLedColor(completed: number, total: number): LedColors { - const ratio = completed / total; - if (ratio === 1) { - return LedColors.Completed; - } - if (ratio > 0) { - return LedColors.InProgress; - } - return LedColors.ToDo; -} - -function getStatusMessage(completed: number, total: number): StatusMessages { - const ratio = completed / total; - if (ratio === 1) { - return StatusMessages.Completed; - } - if (ratio > 0) { - return StatusMessages.InProgress; - } - return StatusMessages.ToDo; -} - -function getStepStatusColor(status: EnvironmentPhaseStepStatuses) { - if (status === EnvironmentPhaseStepStatuses.ToDo) { - return LedColors.ToDo; - } - if (status === EnvironmentPhaseStepStatuses.InProgress) { - return LedColors.InProgress; - } - if (status === EnvironmentPhaseStepStatuses.Completed) { - return LedColors.Completed; - } - return LedColors.Unknown; -} - -function getStepStatusMessage(status: EnvironmentPhaseStepStatuses) { - if (status === EnvironmentPhaseStepStatuses.ToDo) { - return StatusMessages.ToDo; - } - if (status === EnvironmentPhaseStepStatuses.InProgress) { - return StatusMessages.InProgress; - } - if (status === EnvironmentPhaseStepStatuses.Completed) { - return StatusMessages.Completed; - } - return StatusMessages.Unknown; -} - -interface EnvironmentPhaseConfig { - title: string; - identifier: EnvironmentPhases; - param: string; -} - -export const environmentPhases: EnvironmentPhaseConfig[] = [ - { - title: 'Phase 1: Business Setup', - identifier: EnvironmentPhases.BusinessSetup, - param: 'businessSetup', - }, - { - title: 'Phase 2: Technical Setup', - identifier: EnvironmentPhases.TechnicalSetup, - param: 'technicalSetup', - }, -]; - -export function getPhaseConfig(identifier: EnvironmentPhases): EnvironmentPhaseConfig { - return environmentPhases.find( - (phase) => phase.identifier === identifier - ) as EnvironmentPhaseConfig; -} - -export function getPhaseSteps( - phases: EnvironmentPhase[], - phaseIdentifier: EnvironmentPhases, - pending: boolean -): EnvironmentStep[] { - if (pending) { - return []; - } - const phase = phases.find((item) => item.phase === phaseIdentifier); - return phase?.steps || []; -} - -export function getPhaseStatus( - phases: EnvironmentPhase[], - identifier: EnvironmentPhases, - pending: boolean -): ItemStatus { - if (pending) { - return PendingResponse; - } - const phase = phases?.find((item) => item.phase === identifier); - if (!phase) { - return UnknownResponse; - } - const { steps } = phase; - const completedSteps = steps.filter(isStepCompleted); - return { - progress: `${completedSteps.length}/${steps.length} Steps Completed`, - status: getStatusMessage(completedSteps.length, steps.length), - statusColor: getStatusLedColor(completedSteps.length, steps.length), - }; -} - -export function getEnvironmentPhases( - environmentsStatuses: EnvironmentStatus[], - environment: Environment, - pending: boolean -): EnvironmentPhase[] { - if (pending) { - return []; - } - const environmentsStatus = environmentsStatuses.find( - (status) => status.environmentId === environment.id - ); - return environmentsStatus?.phases || []; -} - -export function getEnvironmentStatus( - environmentsStatuses: EnvironmentStatus[], - environment: Environment, - phases: EnvironmentPhase[], - pending: boolean -): ItemStatus { - if (pending) { - return PendingResponse; - } - const environmentsStatus = environmentsStatuses.find( - (status) => status.environmentId === environment.id - ); - if (!environmentsStatus) { - return UnknownResponse; - } - const steps = phases.map((phase) => phase.steps); - const allSteps = steps.flat(); - const completedSteps = allSteps.filter(isStepCompleted); - return { - status: getStatusMessage(completedSteps.length, allSteps.length), - statusColor: getStatusLedColor(completedSteps.length, allSteps.length), - progress: `${getStepsPercentage(completedSteps, allSteps)}% Completed`, - }; -} - -export function getStepStatus( - steps: EnvironmentStep[], - identifier: EnvironmentStepIdentifiers, - pending: boolean -): ItemStatus { - if (pending) { - return PendingResponse; - } - const step = steps.find((currentStep) => currentStep.identifier === identifier); - if (!step) { - return UnknownResponse; - } - return { - status: getStepStatusMessage(step.status), - statusColor: getStepStatusColor(step.status), - progress: '0', - }; -} +import { + Environment, + EnvironmentStatus, + EnvironmentPhaseStepStatuses, + EnvironmentPhase, + EnvironmentStep, + EnvironmentPhases, + EnvironmentStepIdentifiers, +} from './types'; + +enum LedColors { + Completed = '#12d670', + InProgress = '#ff9933', + ToDo = '#999999', + Unknown = '#000000', + Pending = '#DDDDDD', +} + +enum StatusMessages { + Completed = 'Completed', + InProgress = 'In Progress', + ToDo = 'To Do', + Unknown = 'Unknown', + Pending = 'Pending', +} + +interface ItemStatus { + status: StatusMessages; + statusColor: LedColors; + progress: string; +} + +const PendingResponse: ItemStatus = { + status: StatusMessages.Pending, + statusColor: LedColors.Pending, + progress: 'Pending', +}; + +const UnknownResponse: ItemStatus = { + status: StatusMessages.Unknown, + statusColor: LedColors.Unknown, + progress: 'Not Defined', +}; + +function isStepCompleted(step: EnvironmentStep) { + return step.status === EnvironmentPhaseStepStatuses.Completed; +} + +function getStepsPercentage(subset: EnvironmentStep[], items: EnvironmentStep[]) { + return Math.floor((subset.length / items.length) * 100); +} + +function getStatusLedColor(completed: number, total: number): LedColors { + const ratio = completed / total; + if (ratio === 1) { + return LedColors.Completed; + } + if (ratio > 0) { + return LedColors.InProgress; + } + return LedColors.ToDo; +} + +function getStatusMessage(completed: number, total: number): StatusMessages { + const ratio = completed / total; + if (ratio === 1) { + return StatusMessages.Completed; + } + if (ratio > 0) { + return StatusMessages.InProgress; + } + return StatusMessages.ToDo; +} + +function getStepStatusColor(status: EnvironmentPhaseStepStatuses) { + if (status === EnvironmentPhaseStepStatuses.ToDo) { + return LedColors.ToDo; + } + if (status === EnvironmentPhaseStepStatuses.InProgress) { + return LedColors.InProgress; + } + if (status === EnvironmentPhaseStepStatuses.Completed) { + return LedColors.Completed; + } + return LedColors.Unknown; +} + +function getStepStatusMessage(status: EnvironmentPhaseStepStatuses) { + if (status === EnvironmentPhaseStepStatuses.ToDo) { + return StatusMessages.ToDo; + } + if (status === EnvironmentPhaseStepStatuses.InProgress) { + return StatusMessages.InProgress; + } + if (status === EnvironmentPhaseStepStatuses.Completed) { + return StatusMessages.Completed; + } + return StatusMessages.Unknown; +} + +interface EnvironmentPhaseConfig { + title: string; + identifier: EnvironmentPhases; + param: string; +} + +export const environmentPhases: EnvironmentPhaseConfig[] = [ + { + title: 'Phase 1: Business Setup', + identifier: EnvironmentPhases.BusinessSetup, + param: 'businessSetup', + }, + { + title: 'Phase 2: Technical Setup', + identifier: EnvironmentPhases.TechnicalSetup, + param: 'technicalSetup', + }, +]; + +export function getPhaseConfig(identifier: EnvironmentPhases): EnvironmentPhaseConfig { + return environmentPhases.find( + (phase) => phase.identifier === identifier + ) as EnvironmentPhaseConfig; +} + +export function getPhaseSteps( + phases: EnvironmentPhase[], + phaseIdentifier: EnvironmentPhases, + pending: boolean +): EnvironmentStep[] { + if (pending) { + return []; + } + const phase = phases.find((item) => item.phase === phaseIdentifier); + return phase?.steps || []; +} + +export function getPhaseStatus( + phases: EnvironmentPhase[], + identifier: EnvironmentPhases, + pending: boolean +): ItemStatus { + if (pending) { + return PendingResponse; + } + const phase = phases?.find((item) => item.phase === identifier); + if (!phase) { + return UnknownResponse; + } + const { steps } = phase; + const completedSteps = steps.filter(isStepCompleted); + return { + progress: `${completedSteps.length}/${steps.length} Steps Completed`, + status: getStatusMessage(completedSteps.length, steps.length), + statusColor: getStatusLedColor(completedSteps.length, steps.length), + }; +} + +export function getEnvironmentPhases( + environmentsStatuses: EnvironmentStatus[], + environment: Environment, + pending: boolean +): EnvironmentPhase[] { + if (pending) { + return []; + } + const environmentsStatus = environmentsStatuses.find( + (status) => status.environmentId === environment.id + ); + return environmentsStatus?.phases || []; +} + +export function getEnvironmentStatus( + environmentsStatuses: EnvironmentStatus[], + environment: Environment, + phases: EnvironmentPhase[], + pending: boolean +): ItemStatus { + if (pending) { + return PendingResponse; + } + const environmentsStatus = environmentsStatuses.find( + (status) => status.environmentId === environment.id + ); + if (!environmentsStatus) { + return UnknownResponse; + } + const steps = phases.map((phase) => phase.steps); + const allSteps = steps.flat(); + const completedSteps = allSteps.filter(isStepCompleted); + return { + status: getStatusMessage(completedSteps.length, allSteps.length), + statusColor: getStatusLedColor(completedSteps.length, allSteps.length), + progress: `${getStepsPercentage(completedSteps, allSteps)}% Completed`, + }; +} + +export function getStepStatus( + steps: EnvironmentStep[], + identifier: EnvironmentStepIdentifiers, + pending: boolean +): ItemStatus { + if (pending) { + return PendingResponse; + } + const step = steps.find((currentStep) => currentStep.identifier === identifier); + if (!step) { + return UnknownResponse; + } + return { + status: getStepStatusMessage(step.status), + statusColor: getStepStatusColor(step.status), + progress: '0', + }; +} diff --git a/src/App/ConnectionWizard/index.ts b/src/App/ConnectionWizard/index.ts index 72df08b..7da17b4 100644 --- a/src/App/ConnectionWizard/index.ts +++ b/src/App/ConnectionWizard/index.ts @@ -1,8 +1,8 @@ -import withErrorBoundary from 'utils/hocs/withErrorBoundary'; -import { ComponentType } from 'react'; -import ConnectionWizardRouter from './ConnectionWizardRouter'; -import reducer from './reducers'; -import * as types from './types'; - -export default withErrorBoundary(ConnectionWizardRouter as ComponentType); -export { reducer, types }; +import withErrorBoundary from 'utils/hocs/withErrorBoundary'; +import { ComponentType } from 'react'; +import ConnectionWizardRouter from './ConnectionWizardRouter'; +import reducer from './reducers'; +import * as types from './types'; + +export default withErrorBoundary(ConnectionWizardRouter as ComponentType); +export { reducer, types }; diff --git a/src/App/ConnectionWizard/reducers.ts b/src/App/ConnectionWizard/reducers.ts index f478748..606e9e2 100644 --- a/src/App/ConnectionWizard/reducers.ts +++ b/src/App/ConnectionWizard/reducers.ts @@ -1,12 +1,12 @@ -import { Reducer, combineReducers } from 'redux'; -import { reducer as environmentReducer } from './Environment'; -import { reducer as environmentsReducer } from './Environments'; -import { reducer as sharedReducer } from './Shared'; - -const reducer: Reducer = combineReducers({ - environment: environmentReducer, - environments: environmentsReducer, - shared: sharedReducer, -}); - -export default reducer; +import { Reducer, combineReducers } from 'redux'; +import { reducer as environmentReducer } from './Environment'; +import { reducer as environmentsReducer } from './Environments'; +import { reducer as sharedReducer } from './Shared'; + +const reducer: Reducer = combineReducers({ + environment: environmentReducer, + environments: environmentsReducer, + shared: sharedReducer, +}); + +export default reducer; diff --git a/src/App/ConnectionWizard/sagas.ts b/src/App/ConnectionWizard/sagas.ts index ad0e404..c73792b 100644 --- a/src/App/ConnectionWizard/sagas.ts +++ b/src/App/ConnectionWizard/sagas.ts @@ -1,8 +1,8 @@ -import { all } from 'redux-saga/effects'; -import sharedSagas from './Shared/sagas'; -import environmentSagas from './Environment/sagas'; -import environmentsSagas from './Environments/sagas'; - -export default function* rootSaga() { - yield all([sharedSagas(), environmentSagas(), environmentsSagas()]); -} +import { all } from 'redux-saga/effects'; +import sharedSagas from './Shared/sagas'; +import environmentSagas from './Environment/sagas'; +import environmentsSagas from './Environments/sagas'; + +export default function* rootSaga() { + yield all([sharedSagas(), environmentSagas(), environmentsSagas()]); +} diff --git a/src/App/ConnectionWizard/selectors.ts b/src/App/ConnectionWizard/selectors.ts index 794d37d..52a3c04 100644 --- a/src/App/ConnectionWizard/selectors.ts +++ b/src/App/ConnectionWizard/selectors.ts @@ -1,47 +1,47 @@ -import { createMatchSelector } from 'connected-react-router'; -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; - -export const getEnvironments = (state: State) => state.wizard.environments.environments; -export const getEnvironmentsError = (state: State) => state.wizard.environments.environmentsError; - -export const getIsEnvironmentsStatusesPending = (state: State) => - state.wizard.shared.isEnvironmentsStatusesPending; -export const getEnvironmentsStatuses = (state: State) => state.wizard.shared.environmentsStatuses; -export const getEnvironmentsStatusesError = (state: State) => - state.wizard.shared.environmentsStatusesError; - -export const getDfsp = (state: State) => state.wizard.environment.main.dfsp; -export const getDfsps = (state: State) => state.wizard.environment.main.dfsps; - -export const getDfspName = createSelector(getDfsp, (dfsp) => dfsp?.name); -export const getDfspId = createSelector(getDfsp, (dfsp) => dfsp?.id); -export const getDfspMonetaryZoneId = createSelector(getDfsp, (dfsp) => dfsp?.monetaryZoneId); -export const getIsDfspReadPending = createSelector( - (state: State) => state.api, - isPending('dfsp.read') -); - -// and the connected react router keeps in state -export const getMatchedEnvironmentName = createSelector( - createMatchSelector('/connections/:environmentName'), - // @ts-ignore - (match) => match && match.params?.environmentName -); - -// We try to find such environment name in the environemnts we have loaded from the api -export const getEnvironment = createSelector( - getEnvironments, - getMatchedEnvironmentName, - (environments, matchedEnvironmentName) => - environments.find((environment) => environment.name === matchedEnvironmentName) -); - -// If we have the environment, we can get the real name and the ID -export const getEnvironmentId = createSelector(getEnvironment, (environment) => environment?.id); -// this selector makes sure the environment is found: the getMatchedEnvironmentName does not guarantee the environment exists -export const getEnvironmentName = createSelector( - getEnvironment, - (environment) => environment?.name -); +import { createMatchSelector } from 'connected-react-router'; +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; + +export const getEnvironments = (state: State) => state.wizard.environments.environments; +export const getEnvironmentsError = (state: State) => state.wizard.environments.environmentsError; + +export const getIsEnvironmentsStatusesPending = (state: State) => + state.wizard.shared.isEnvironmentsStatusesPending; +export const getEnvironmentsStatuses = (state: State) => state.wizard.shared.environmentsStatuses; +export const getEnvironmentsStatusesError = (state: State) => + state.wizard.shared.environmentsStatusesError; + +export const getDfsp = (state: State) => state.wizard.environment.main.dfsp; +export const getDfsps = (state: State) => state.wizard.environment.main.dfsps; + +export const getDfspName = createSelector(getDfsp, (dfsp) => dfsp?.name); +export const getDfspId = createSelector(getDfsp, (dfsp) => dfsp?.id); +export const getDfspMonetaryZoneId = createSelector(getDfsp, (dfsp) => dfsp?.monetaryZoneId); +export const getIsDfspReadPending = createSelector( + (state: State) => state.api, + isPending('dfsp.read') +); + +// and the connected react router keeps in state +export const getMatchedEnvironmentName = createSelector( + createMatchSelector('/connections/:environmentName'), + // @ts-ignore + (match) => match && match.params?.environmentName +); + +// We try to find such environment name in the environemnts we have loaded from the api +export const getEnvironment = createSelector( + getEnvironments, + getMatchedEnvironmentName, + (environments, matchedEnvironmentName) => + environments.find((environment) => environment.name === matchedEnvironmentName) +); + +// If we have the environment, we can get the real name and the ID +export const getEnvironmentId = createSelector(getEnvironment, (environment) => environment?.id); +// this selector makes sure the environment is found: the getMatchedEnvironmentName does not guarantee the environment exists +export const getEnvironmentName = createSelector( + getEnvironment, + (environment) => environment?.name +); diff --git a/src/App/ConnectionWizard/types.ts b/src/App/ConnectionWizard/types.ts index 00ec3d8..20de03b 100644 --- a/src/App/ConnectionWizard/types.ts +++ b/src/App/ConnectionWizard/types.ts @@ -1,58 +1,58 @@ -// TODO: Use import type as soon as it's available in order to avoid type dependency cycles -/* eslint-disable-next-line import/no-cycle */ -import { SharedActionTypes, SharedState } from './Shared/types'; -import { EnvironmentActionTypes, EnvironmentState } from './Environment/types'; -// TODO: Use import type as soon as it's available in order to avoid type dependency cycles -/* eslint-disable-next-line import/no-cycle */ -import { EnvironmentsActionTypes, EnvironmentsState } from './Environments/types'; - -export type WizardActionTypes = - | SharedActionTypes - | EnvironmentActionTypes - | EnvironmentsActionTypes; - -export interface WizardState { - shared: SharedState; - environment: EnvironmentState; - environments: EnvironmentsState; -} - -export interface Environment { - id: string; - name: string; -} - -export interface EnvironmentStatus { - environmentId: string; - phases: EnvironmentPhase[]; -} - -export interface EnvironmentPhase { - phase: EnvironmentPhases; - steps: EnvironmentStep[]; -} - -export enum EnvironmentPhases { - BusinessSetup = 'BUSINESS_SETUP', - TechnicalSetup = 'TECHNICAL_SETUP', -} - -export interface EnvironmentStep { - identifier: EnvironmentStepIdentifiers; - status: EnvironmentPhaseStepStatuses; -} - -export enum EnvironmentStepIdentifiers { - IdGeneration = 'ID_GENERATION', - Endpoints = 'ENDPOINTS', - CsrExchange = 'CSR_EXCHANGE', - CertificateAuthority = 'CERTIFICATE_AUTHORITY', - ServerCertificatesExchange = 'SERVER_CERTIFICATES_EXCHANGE', - JwsCertificates = 'JWS_CERTIFICATES', -} - -export enum EnvironmentPhaseStepStatuses { - ToDo = 'NOT_STARTED', - InProgress = 'IN_PROGRESS', - Completed = 'COMPLETED', -} +// TODO: Use import type as soon as it's available in order to avoid type dependency cycles +/* eslint-disable-next-line import/no-cycle */ +import { SharedActionTypes, SharedState } from './Shared/types'; +import { EnvironmentActionTypes, EnvironmentState } from './Environment/types'; +// TODO: Use import type as soon as it's available in order to avoid type dependency cycles +/* eslint-disable-next-line import/no-cycle */ +import { EnvironmentsActionTypes, EnvironmentsState } from './Environments/types'; + +export type WizardActionTypes = + | SharedActionTypes + | EnvironmentActionTypes + | EnvironmentsActionTypes; + +export interface WizardState { + shared: SharedState; + environment: EnvironmentState; + environments: EnvironmentsState; +} + +export interface Environment { + id: string; + name: string; +} + +export interface EnvironmentStatus { + environmentId: string; + phases: EnvironmentPhase[]; +} + +export interface EnvironmentPhase { + phase: EnvironmentPhases; + steps: EnvironmentStep[]; +} + +export enum EnvironmentPhases { + BusinessSetup = 'BUSINESS_SETUP', + TechnicalSetup = 'TECHNICAL_SETUP', +} + +export interface EnvironmentStep { + identifier: EnvironmentStepIdentifiers; + status: EnvironmentPhaseStepStatuses; +} + +export enum EnvironmentStepIdentifiers { + IdGeneration = 'ID_GENERATION', + Endpoints = 'ENDPOINTS', + CsrExchange = 'CSR_EXCHANGE', + CertificateAuthority = 'CERTIFICATE_AUTHORITY', + ServerCertificatesExchange = 'SERVER_CERTIFICATES_EXCHANGE', + JwsCertificates = 'JWS_CERTIFICATES', +} + +export enum EnvironmentPhaseStepStatuses { + ToDo = 'NOT_STARTED', + InProgress = 'IN_PROGRESS', + Completed = 'COMPLETED', +} diff --git a/src/App/Dashboard/Dashboard.css b/src/App/Dashboard/Dashboard.css index 284f937..2b90625 100644 --- a/src/App/Dashboard/Dashboard.css +++ b/src/App/Dashboard/Dashboard.css @@ -1,88 +1,88 @@ -.dashboard { -} - -.dashboard__today__graph-loader, -.dashboard__flow__graph-loader { - height: 300px; - align-items: center; - justify-content: center; - display: flex; -} -.dashboard__today__graph-container, -.dashboard__flow__graph-container { - background: #fff; - height: 300px; - width: 100%; -} - -.dashboard__today__recap-container, -.dashboard__flow__recap-container { - border: 1px solid #39f; - min-height: 250px; - height: 100%; - min-width: 200px; - align-items: center; - justify-content: center; - display: flex; - flex-direction: column; -} - -.dashboard__flow__section, -.dashboard__today__section { - margin-bottom: 20px; -} - -.dashboard__overview__section { - margin-bottom: 20px; -} -.dashboard__overview__loader { - height: 100px; - width: 100%; - display: flex; - justify-content: center; - flex-direction: row; -} -.dashboard__overview__list { - margin: 10px; -} - -.dashboard__overview__list__status-indicator.el-datalist__header-cell, -.dashboard__overview__list__status-indicator.el-datalist__item-cell { - flex: 0 0 40px; - justify-content: center; -} - -.dashboard__overview-status { - color: #053035; - margin: 5px; -} -.dashboard__overview-status--open { - background: #4fc7e7; -} -.dashboard__overview-status--on-track { - background: #12d670; -} -.dashboard__overview-status--has-errors { - background: #e23a54; -} -.dashboard__overview-status--overdue { - background: #ff9016; -} - -.dashboard__overview-status__indicator { - height: 14px; - width: 14px; - border-radius: 50%; -} - -.dashboard__overview__window { -} -.dashboard__overview__window__batch-details-block { - margin-right: 20px; -} - -.dashboard__overview__window__batch-dates-block { - display: flex; - flex-direction: column; - margin-bottom: 10px; -} +.dashboard { +} + +.dashboard__today__graph-loader, +.dashboard__flow__graph-loader { + height: 300px; + align-items: center; + justify-content: center; + display: flex; +} +.dashboard__today__graph-container, +.dashboard__flow__graph-container { + background: #fff; + height: 300px; + width: 100%; +} + +.dashboard__today__recap-container, +.dashboard__flow__recap-container { + border: 1px solid #39f; + min-height: 250px; + height: 100%; + min-width: 200px; + align-items: center; + justify-content: center; + display: flex; + flex-direction: column; +} + +.dashboard__flow__section, +.dashboard__today__section { + margin-bottom: 20px; +} + +.dashboard__overview__section { + margin-bottom: 20px; +} +.dashboard__overview__loader { + height: 100px; + width: 100%; + display: flex; + justify-content: center; + flex-direction: row; +} +.dashboard__overview__list { + margin: 10px; +} + +.dashboard__overview__list__status-indicator.el-datalist__header-cell, +.dashboard__overview__list__status-indicator.el-datalist__item-cell { + flex: 0 0 40px; + justify-content: center; +} + +.dashboard__overview-status { + color: #053035; + margin: 5px; +} +.dashboard__overview-status--open { + background: #4fc7e7; +} +.dashboard__overview-status--on-track { + background: #12d670; +} +.dashboard__overview-status--has-errors { + background: #e23a54; +} +.dashboard__overview-status--overdue { + background: #ff9016; +} + +.dashboard__overview-status__indicator { + height: 14px; + width: 14px; + border-radius: 50%; +} + +.dashboard__overview__window { +} +.dashboard__overview__window__batch-details-block { + margin-right: 20px; +} + +.dashboard__overview__window__batch-dates-block { + display: flex; + flex-direction: column; + margin-bottom: 10px; +} diff --git a/src/App/Dashboard/Dashboard.tsx b/src/App/Dashboard/Dashboard.tsx index 84af640..83f609d 100644 --- a/src/App/Dashboard/Dashboard.tsx +++ b/src/App/Dashboard/Dashboard.tsx @@ -1,89 +1,89 @@ -/* eslint-disable no-console */ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { Heading } from 'components'; -import { State, Dispatch } from 'store/types'; -import TransfersErrorsChart from 'App/Transfers/components/TransfersErrorsChart'; -import { ReconciliationOverviewBatch, WeeklyPosition, WeeklyFlow } from './types'; -import { loadDashboard } from './hocs'; -import * as selectors from './selectors'; -import * as actions from './actions'; -import ReconciliationOverview from './components/ReconciliationOverview'; -import TodayPositionGraph from './components/TodayPositionGraph'; -import FlowGraph from './components/FlowGraph'; -import './Dashboard.css'; - -const stateProps = (state: State) => ({ - reconciliationOverviewBatches: selectors.getReconciliationOverviewBatches(state), - reconciliationOverviewBatchesError: selectors.getReconciliationOverviewBatchesError(state), - selectedReconciliationOverviewBatch: selectors.getSelectedReconciliationOverviewBatch(state), - isReconciliationOverviewBatchesPending: selectors.getIsReconciliationOverviewBatchesPending( - state - ), - - weeklyPositions: selectors.getWeeklyPositions(state), - weeklyPositionsError: selectors.getWeeklyPositionsError(state), - isWeeklyPositionsPending: selectors.getIsWeeklyPositionsPending(state), - - weeklyFlows: selectors.getWeeklyFlows(state), - weeklyFlowsError: selectors.getWeeklyFlowsError(state), - isWeeklyFlowsPending: selectors.getIsWeeklyFlowsPending(state), -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onSelectReconciliationOverviewBatch: (item: ReconciliationOverviewBatch) => - dispatch(actions.selectReconciliationOverviewBatch({ item })), -}); - -type DashboardProps = { - reconciliationOverviewBatches: ReconciliationOverviewBatch[]; - reconciliationOverviewBatchesError: string | null; - selectedReconciliationOverviewBatch: ReconciliationOverviewBatch | undefined; - isReconciliationOverviewBatchesPending?: boolean; - - weeklyPositions: WeeklyPosition[]; - weeklyPositionsError: string | null; - isWeeklyPositionsPending?: boolean; - - weeklyFlows: WeeklyFlow[]; - weeklyFlowsError: string | null; - isWeeklyFlowsPending?: boolean; - - onSelectReconciliationOverviewBatch: (item: ReconciliationOverviewBatch) => void; -}; - -const Dashboard: FC = ({ - reconciliationOverviewBatches, - reconciliationOverviewBatchesError, - selectedReconciliationOverviewBatch, - isReconciliationOverviewBatchesPending, - weeklyPositions, - weeklyPositionsError, - isWeeklyPositionsPending, - weeklyFlows, - weeklyFlowsError, - isWeeklyFlowsPending, - onSelectReconciliationOverviewBatch, -}) => { - return ( -
- Business Dashboard - - - - -
- ); -}; - -export default loadDashboard(connect(stateProps, dispatchProps)(Dashboard)); +/* eslint-disable no-console */ +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { Heading } from 'components'; +import { State, Dispatch } from 'store/types'; +import TransfersErrorsChart from 'App/Transfers/components/TransfersErrorsChart'; +import { ReconciliationOverviewBatch, WeeklyPosition, WeeklyFlow } from './types'; +import { loadDashboard } from './hocs'; +import * as selectors from './selectors'; +import * as actions from './actions'; +import ReconciliationOverview from './components/ReconciliationOverview'; +import TodayPositionGraph from './components/TodayPositionGraph'; +import FlowGraph from './components/FlowGraph'; +import './Dashboard.css'; + +const stateProps = (state: State) => ({ + reconciliationOverviewBatches: selectors.getReconciliationOverviewBatches(state), + reconciliationOverviewBatchesError: selectors.getReconciliationOverviewBatchesError(state), + selectedReconciliationOverviewBatch: selectors.getSelectedReconciliationOverviewBatch(state), + isReconciliationOverviewBatchesPending: selectors.getIsReconciliationOverviewBatchesPending( + state + ), + + weeklyPositions: selectors.getWeeklyPositions(state), + weeklyPositionsError: selectors.getWeeklyPositionsError(state), + isWeeklyPositionsPending: selectors.getIsWeeklyPositionsPending(state), + + weeklyFlows: selectors.getWeeklyFlows(state), + weeklyFlowsError: selectors.getWeeklyFlowsError(state), + isWeeklyFlowsPending: selectors.getIsWeeklyFlowsPending(state), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onSelectReconciliationOverviewBatch: (item: ReconciliationOverviewBatch) => + dispatch(actions.selectReconciliationOverviewBatch({ item })), +}); + +type DashboardProps = { + reconciliationOverviewBatches: ReconciliationOverviewBatch[]; + reconciliationOverviewBatchesError: string | null; + selectedReconciliationOverviewBatch: ReconciliationOverviewBatch | undefined; + isReconciliationOverviewBatchesPending?: boolean; + + weeklyPositions: WeeklyPosition[]; + weeklyPositionsError: string | null; + isWeeklyPositionsPending?: boolean; + + weeklyFlows: WeeklyFlow[]; + weeklyFlowsError: string | null; + isWeeklyFlowsPending?: boolean; + + onSelectReconciliationOverviewBatch: (item: ReconciliationOverviewBatch) => void; +}; + +const Dashboard: FC = ({ + reconciliationOverviewBatches, + reconciliationOverviewBatchesError, + selectedReconciliationOverviewBatch, + isReconciliationOverviewBatchesPending, + weeklyPositions, + weeklyPositionsError, + isWeeklyPositionsPending, + weeklyFlows, + weeklyFlowsError, + isWeeklyFlowsPending, + onSelectReconciliationOverviewBatch, +}) => { + return ( +
+ Business Dashboard + + + + +
+ ); +}; + +export default loadDashboard(connect(stateProps, dispatchProps)(Dashboard)); diff --git a/src/App/Dashboard/_mockData.ts b/src/App/Dashboard/_mockData.ts index e162882..d8779f2 100644 --- a/src/App/Dashboard/_mockData.ts +++ b/src/App/Dashboard/_mockData.ts @@ -1,195 +1,195 @@ -import { generatePoints } from 'utils/charts'; -import { TransferDirection, TransferType, TransferStatus } from 'App/types'; -import { BatchStatus } from './types'; - -function timestamp(): string { - return new Date().toISOString(); -} - -function id(): number { - return Math.ceil(Math.random() * 1000); -} - -export const reconciliationOverviewBatches = [ - { - id: Math.ceil(Math.random() * 1000), - status: BatchStatus.Open, - transferCount: 2390, - transferTotals: [ - { - netValue: 1234, - currency: 'USD', - }, - { - netValue: 2133, - currency: 'EUR', - }, - ], - errorCount: 0, - startingTimestamp: timestamp(), - closingTimestamp: timestamp(), - }, - { - id: Math.ceil(Math.random() * 1000), - status: BatchStatus.OnTrack, - transferCount: 2390, - transferTotals: [ - { - netValue: 1234, - currency: 'USD', - }, - { - netValue: 2133, - currency: 'EUR', - }, - ], - errorCount: 0, - startingTimestamp: timestamp(), - closingTimestamp: timestamp(), - }, - { - id: Math.ceil(Math.random() * 1000), - status: BatchStatus.HasErrors, - transferCount: 2390, - transferTotals: [ - { - netValue: 1234, - currency: 'USD', - }, - { - netValue: 2133, - currency: 'EUR', - }, - ], - errorCount: 0, - startingTimestamp: timestamp(), - closingTimestamp: timestamp(), - }, - { - id: Math.ceil(Math.random() * 1000), - status: BatchStatus.Overdue, - transferCount: 2390, - transferTotals: [ - { - netValue: 1234, - currency: 'USD', - }, - { - netValue: 2133, - currency: 'EUR', - }, - ], - errorCount: 0, - startingTimestamp: timestamp(), - closingTimestamp: timestamp(), - }, - { - id: Math.ceil(Math.random() * 1000), - status: BatchStatus.HasErrors, - transferCount: 2390, - transferTotals: [ - { - netValue: 1234, - currency: 'USD', - }, - { - netValue: 2133, - currency: 'EUR', - }, - ], - errorCount: 0, - startingTimestamp: timestamp(), - closingTimestamp: timestamp(), - }, - { - id: Math.ceil(Math.random() * 1000), - status: BatchStatus.Open, - transferCount: 2390, - transferTotals: [ - { - netValue: 1234, - currency: 'USD', - }, - { - netValue: 2133, - currency: 'EUR', - }, - ], - errorCount: 0, - startingTimestamp: timestamp(), - closingTimestamp: timestamp(), - }, -]; - -export const reconciliationOverviewBatchTransfer = [ - { - id: id(), - institution: 'DFSP 2', - direction: TransferDirection.Inbound, - type: TransferType.P2P, - transfers: 2390, - value: '$5430', - status: TransferStatus.Success, - initiatedTimestamp: timestamp(), - }, - { - id: id(), - institution: 'DFSP 3', - direction: TransferDirection.Outbound, - type: TransferType.P2P, - transfers: 2390, - value: '$5430', - status: TransferStatus.Pending, - initiatedTimestamp: timestamp(), - }, - { - id: id(), - institution: 'DFSP 1', - direction: TransferDirection.Inbound, - type: TransferType.P2P, - transfers: 2390, - value: '$5430', - status: TransferStatus.Error, - initiatedTimestamp: timestamp(), - }, - { - id: id(), - institution: 'DFSP 2', - direction: TransferDirection.Outbound, - type: TransferType.P2P, - transfers: 2390, - value: '$5430', - status: TransferStatus.Error, - initiatedTimestamp: timestamp(), - }, -]; - -export const reconciliationOverviewBatchTransferDetails = { - id: id(), - institution: 'DFSP 2', - direction: TransferDirection.Inbound, - type: TransferType.P2P, - transfers: 2390, - value: '$5430', - status: TransferStatus.Success, - initiatedTimestamp: timestamp(), -}; - -export const weeklyFlows = [ - { points: generatePoints(24 * 7, [0, 20000], 2000, 500), color: '#4fc7e7' }, - { points: generatePoints(24 * 7, [0, 20000], 2000, 500), color: '#e23a54' }, -]; - -const reserved = generatePoints(24 * 7, [-10000, 5000], 1000, 1000); -const committed = generatePoints(24 * 7, [0, 5000], 1000, 20); -const today = committed.map(function sumValue( - _: [number, number], - index: number -): [number, number] { - return [index, committed[index][1] + reserved[index][1]]; -}); -export const weeklyPositions = [ - { points: today, color: '#4fc7e7' }, - { points: reserved, color: '#12d670' }, - { points: committed, color: '#ff9016' }, -]; +import { generatePoints } from 'utils/charts'; +import { TransferDirection, TransferType, TransferStatus } from 'App/types'; +import { BatchStatus } from './types'; + +function timestamp(): string { + return new Date().toISOString(); +} + +function id(): number { + return Math.ceil(Math.random() * 1000); +} + +export const reconciliationOverviewBatches = [ + { + id: Math.ceil(Math.random() * 1000), + status: BatchStatus.Open, + transferCount: 2390, + transferTotals: [ + { + netValue: 1234, + currency: 'USD', + }, + { + netValue: 2133, + currency: 'EUR', + }, + ], + errorCount: 0, + startingTimestamp: timestamp(), + closingTimestamp: timestamp(), + }, + { + id: Math.ceil(Math.random() * 1000), + status: BatchStatus.OnTrack, + transferCount: 2390, + transferTotals: [ + { + netValue: 1234, + currency: 'USD', + }, + { + netValue: 2133, + currency: 'EUR', + }, + ], + errorCount: 0, + startingTimestamp: timestamp(), + closingTimestamp: timestamp(), + }, + { + id: Math.ceil(Math.random() * 1000), + status: BatchStatus.HasErrors, + transferCount: 2390, + transferTotals: [ + { + netValue: 1234, + currency: 'USD', + }, + { + netValue: 2133, + currency: 'EUR', + }, + ], + errorCount: 0, + startingTimestamp: timestamp(), + closingTimestamp: timestamp(), + }, + { + id: Math.ceil(Math.random() * 1000), + status: BatchStatus.Overdue, + transferCount: 2390, + transferTotals: [ + { + netValue: 1234, + currency: 'USD', + }, + { + netValue: 2133, + currency: 'EUR', + }, + ], + errorCount: 0, + startingTimestamp: timestamp(), + closingTimestamp: timestamp(), + }, + { + id: Math.ceil(Math.random() * 1000), + status: BatchStatus.HasErrors, + transferCount: 2390, + transferTotals: [ + { + netValue: 1234, + currency: 'USD', + }, + { + netValue: 2133, + currency: 'EUR', + }, + ], + errorCount: 0, + startingTimestamp: timestamp(), + closingTimestamp: timestamp(), + }, + { + id: Math.ceil(Math.random() * 1000), + status: BatchStatus.Open, + transferCount: 2390, + transferTotals: [ + { + netValue: 1234, + currency: 'USD', + }, + { + netValue: 2133, + currency: 'EUR', + }, + ], + errorCount: 0, + startingTimestamp: timestamp(), + closingTimestamp: timestamp(), + }, +]; + +export const reconciliationOverviewBatchTransfer = [ + { + id: id(), + institution: 'DFSP 2', + direction: TransferDirection.Inbound, + type: TransferType.P2P, + transfers: 2390, + value: '$5430', + status: TransferStatus.Success, + initiatedTimestamp: timestamp(), + }, + { + id: id(), + institution: 'DFSP 3', + direction: TransferDirection.Outbound, + type: TransferType.P2P, + transfers: 2390, + value: '$5430', + status: TransferStatus.Pending, + initiatedTimestamp: timestamp(), + }, + { + id: id(), + institution: 'DFSP 1', + direction: TransferDirection.Inbound, + type: TransferType.P2P, + transfers: 2390, + value: '$5430', + status: TransferStatus.Error, + initiatedTimestamp: timestamp(), + }, + { + id: id(), + institution: 'DFSP 2', + direction: TransferDirection.Outbound, + type: TransferType.P2P, + transfers: 2390, + value: '$5430', + status: TransferStatus.Error, + initiatedTimestamp: timestamp(), + }, +]; + +export const reconciliationOverviewBatchTransferDetails = { + id: id(), + institution: 'DFSP 2', + direction: TransferDirection.Inbound, + type: TransferType.P2P, + transfers: 2390, + value: '$5430', + status: TransferStatus.Success, + initiatedTimestamp: timestamp(), +}; + +export const weeklyFlows = [ + { points: generatePoints(24 * 7, [0, 20000], 2000, 500), color: '#4fc7e7' }, + { points: generatePoints(24 * 7, [0, 20000], 2000, 500), color: '#e23a54' }, +]; + +const reserved = generatePoints(24 * 7, [-10000, 5000], 1000, 1000); +const committed = generatePoints(24 * 7, [0, 5000], 1000, 20); +const today = committed.map(function sumValue( + _: [number, number], + index: number +): [number, number] { + return [index, committed[index][1] + reserved[index][1]]; +}); +export const weeklyPositions = [ + { points: today, color: '#4fc7e7' }, + { points: reserved, color: '#12d670' }, + { points: committed, color: '#ff9016' }, +]; diff --git a/src/App/Dashboard/actions.ts b/src/App/Dashboard/actions.ts index 91de23e..d905bb5 100644 --- a/src/App/Dashboard/actions.ts +++ b/src/App/Dashboard/actions.ts @@ -1,232 +1,232 @@ -import { - REQUEST_DASHBOARD_PAGE_DATA, - RequestDashboardPageDataAction, - REQUEST_RECONCILIATION_OVERVIEW_BATCHES, - SET_RECONCILIATION_OVERVIEW_BATCHES, - SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR, - SELECT_RECONCILIATION_OVERVIEW_BATCH, - HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL, - RequestReconciliationOverviewBatchesAction, - SetReconciliationOverviewBatchesAction, - SetReconciliationOverviewBatchesErrorAction, - SelectReconciliationOverviewBatchAction, - HideReconciliationOverviewBatchModalAction, - REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR, - RequestReconciliationOverviewBatchTransfersAction, - SetReconciliationOverviewBatchTransfersAction, - SetReconciliationOverviewBatchTransfersErrorAction, - SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, - HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL, - REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER, - SelectReconciliationOverviewBatchTransferAction, - HideReconciliationOverviewBatchTransferDetailsModalAction, - RequestReconciliationOverviewBatchTransferDetailsAction, - SetReconciliationOverviewBatchTransferDetailsAction, - SetReconciliationOverviewBatchTransferDetailsErrorAction, - SetReconciliationOverviewBatchTransfersStatusFilterAction, - REQUEST_WEEKLY_POSITIONS, - SET_WEEKLY_POSITIONS, - SET_WEEKLY_POSITIONS_ERROR, - REQUEST_WEEKLY_FLOWS, - SET_WEEKLY_FLOWS, - SET_WEEKLY_FLOWS_ERROR, - SetWeeklyPositionsAction, - SetWeeklyPositionsErrorAction, - RequestWeeklyPositionsAction, - SetWeeklyFlowsAction, - SetWeeklyFlowsErrorAction, - RequestWeeklyFlowsAction, - ReconciliationOverviewBatch, - ReconciliationOverviewBatchTransfer, - TransferDetails, - WeeklyPosition, - WeeklyFlow, -} from './types'; - -export function requestDashboardPageData(): RequestDashboardPageDataAction { - return { - type: REQUEST_DASHBOARD_PAGE_DATA, - }; -} - -export function setReconciliationOverviewBatches({ - data, -}: { - data: ReconciliationOverviewBatch[]; -}): SetReconciliationOverviewBatchesAction { - return { - type: SET_RECONCILIATION_OVERVIEW_BATCHES, - data, - }; -} - -export function setReconciliationOverviewBatchesError({ - error, -}: { - error: string; -}): SetReconciliationOverviewBatchesErrorAction { - return { - type: SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR, - error, - }; -} - -export function requestReconciliationOverviewBatches(): RequestReconciliationOverviewBatchesAction { - return { - type: REQUEST_RECONCILIATION_OVERVIEW_BATCHES, - }; -} - -export function selectReconciliationOverviewBatch({ - item, -}: { - item: ReconciliationOverviewBatch; -}): SelectReconciliationOverviewBatchAction { - return { - type: SELECT_RECONCILIATION_OVERVIEW_BATCH, - item, - }; -} - -export function hideReconciliationOverviewBatchModal(): HideReconciliationOverviewBatchModalAction { - return { - type: HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL, - }; -} - -export function setReconciliationOverviewBatchTransfers({ - data, -}: { - data: ReconciliationOverviewBatchTransfer[]; -}): SetReconciliationOverviewBatchTransfersAction { - return { - type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, - data, - }; -} - -export function setReconciliationOverviewBatchTransfersError({ - error, -}: { - error: string; -}): SetReconciliationOverviewBatchTransfersErrorAction { - return { - type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR, - error, - }; -} - -export function setReconciliationOverviewBatchTransfersStatusFilter({ - filter, -}: { - filter: string; -}): SetReconciliationOverviewBatchTransfersStatusFilterAction { - return { - type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER, - filter, - }; -} - -// eslint-disable-next-line max-len -export function requestReconciliationOverviewBatchTransfers(): RequestReconciliationOverviewBatchTransfersAction { - return { - type: REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, - }; -} - -export function selectReconciliationOverviewBatchTransfer({ - item, -}: { - item: ReconciliationOverviewBatchTransfer; -}): SelectReconciliationOverviewBatchTransferAction { - return { - type: SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, - item, - }; -} - -// eslint-disable-next-line max-len -export function hideReconciliationOverviewBatchTransferDetailsModal(): HideReconciliationOverviewBatchTransferDetailsModalAction { - return { - type: HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL, - }; -} - -export function setReconciliationOverviewBatchTransferDetails({ - data, -}: { - data: TransferDetails; -}): SetReconciliationOverviewBatchTransferDetailsAction { - return { - type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, - data, - }; -} - -export function setReconciliationOverviewBatchTransferDetailsError({ - error, -}: { - error: string; -}): SetReconciliationOverviewBatchTransferDetailsErrorAction { - return { - type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR, - error, - }; -} - -// eslint-disable-next-line max-len -export function requestReconciliationOverviewBatchTransferDetails(): RequestReconciliationOverviewBatchTransferDetailsAction { - return { - type: REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, - }; -} - -export function setWeeklyPositions({ data }: { data: WeeklyPosition[] }): SetWeeklyPositionsAction { - return { - type: SET_WEEKLY_POSITIONS, - data, - }; -} - -export function setWeeklyPositionsError({ - error, -}: { - error: string; -}): SetWeeklyPositionsErrorAction { - return { - type: SET_WEEKLY_POSITIONS_ERROR, - error, - }; -} - -export function requestWeeklyFlows(): RequestWeeklyFlowsAction { - return { - type: REQUEST_WEEKLY_FLOWS, - }; -} - -export function setWeeklyFlows({ data }: { data: WeeklyFlow[] }): SetWeeklyFlowsAction { - return { - type: SET_WEEKLY_FLOWS, - data, - }; -} - -export function setWeeklyFlowsError({ error }: { error: string }): SetWeeklyFlowsErrorAction { - return { - type: SET_WEEKLY_FLOWS_ERROR, - error, - }; -} - -// eslint-disable-next-line max-len -export function requestWeeklyPositions(): RequestWeeklyPositionsAction { - return { - type: REQUEST_WEEKLY_POSITIONS, - }; -} +import { + REQUEST_DASHBOARD_PAGE_DATA, + RequestDashboardPageDataAction, + REQUEST_RECONCILIATION_OVERVIEW_BATCHES, + SET_RECONCILIATION_OVERVIEW_BATCHES, + SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR, + SELECT_RECONCILIATION_OVERVIEW_BATCH, + HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL, + RequestReconciliationOverviewBatchesAction, + SetReconciliationOverviewBatchesAction, + SetReconciliationOverviewBatchesErrorAction, + SelectReconciliationOverviewBatchAction, + HideReconciliationOverviewBatchModalAction, + REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR, + RequestReconciliationOverviewBatchTransfersAction, + SetReconciliationOverviewBatchTransfersAction, + SetReconciliationOverviewBatchTransfersErrorAction, + SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, + HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL, + REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER, + SelectReconciliationOverviewBatchTransferAction, + HideReconciliationOverviewBatchTransferDetailsModalAction, + RequestReconciliationOverviewBatchTransferDetailsAction, + SetReconciliationOverviewBatchTransferDetailsAction, + SetReconciliationOverviewBatchTransferDetailsErrorAction, + SetReconciliationOverviewBatchTransfersStatusFilterAction, + REQUEST_WEEKLY_POSITIONS, + SET_WEEKLY_POSITIONS, + SET_WEEKLY_POSITIONS_ERROR, + REQUEST_WEEKLY_FLOWS, + SET_WEEKLY_FLOWS, + SET_WEEKLY_FLOWS_ERROR, + SetWeeklyPositionsAction, + SetWeeklyPositionsErrorAction, + RequestWeeklyPositionsAction, + SetWeeklyFlowsAction, + SetWeeklyFlowsErrorAction, + RequestWeeklyFlowsAction, + ReconciliationOverviewBatch, + ReconciliationOverviewBatchTransfer, + TransferDetails, + WeeklyPosition, + WeeklyFlow, +} from './types'; + +export function requestDashboardPageData(): RequestDashboardPageDataAction { + return { + type: REQUEST_DASHBOARD_PAGE_DATA, + }; +} + +export function setReconciliationOverviewBatches({ + data, +}: { + data: ReconciliationOverviewBatch[]; +}): SetReconciliationOverviewBatchesAction { + return { + type: SET_RECONCILIATION_OVERVIEW_BATCHES, + data, + }; +} + +export function setReconciliationOverviewBatchesError({ + error, +}: { + error: string; +}): SetReconciliationOverviewBatchesErrorAction { + return { + type: SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR, + error, + }; +} + +export function requestReconciliationOverviewBatches(): RequestReconciliationOverviewBatchesAction { + return { + type: REQUEST_RECONCILIATION_OVERVIEW_BATCHES, + }; +} + +export function selectReconciliationOverviewBatch({ + item, +}: { + item: ReconciliationOverviewBatch; +}): SelectReconciliationOverviewBatchAction { + return { + type: SELECT_RECONCILIATION_OVERVIEW_BATCH, + item, + }; +} + +export function hideReconciliationOverviewBatchModal(): HideReconciliationOverviewBatchModalAction { + return { + type: HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL, + }; +} + +export function setReconciliationOverviewBatchTransfers({ + data, +}: { + data: ReconciliationOverviewBatchTransfer[]; +}): SetReconciliationOverviewBatchTransfersAction { + return { + type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, + data, + }; +} + +export function setReconciliationOverviewBatchTransfersError({ + error, +}: { + error: string; +}): SetReconciliationOverviewBatchTransfersErrorAction { + return { + type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR, + error, + }; +} + +export function setReconciliationOverviewBatchTransfersStatusFilter({ + filter, +}: { + filter: string; +}): SetReconciliationOverviewBatchTransfersStatusFilterAction { + return { + type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER, + filter, + }; +} + +// eslint-disable-next-line max-len +export function requestReconciliationOverviewBatchTransfers(): RequestReconciliationOverviewBatchTransfersAction { + return { + type: REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, + }; +} + +export function selectReconciliationOverviewBatchTransfer({ + item, +}: { + item: ReconciliationOverviewBatchTransfer; +}): SelectReconciliationOverviewBatchTransferAction { + return { + type: SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, + item, + }; +} + +// eslint-disable-next-line max-len +export function hideReconciliationOverviewBatchTransferDetailsModal(): HideReconciliationOverviewBatchTransferDetailsModalAction { + return { + type: HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL, + }; +} + +export function setReconciliationOverviewBatchTransferDetails({ + data, +}: { + data: TransferDetails; +}): SetReconciliationOverviewBatchTransferDetailsAction { + return { + type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, + data, + }; +} + +export function setReconciliationOverviewBatchTransferDetailsError({ + error, +}: { + error: string; +}): SetReconciliationOverviewBatchTransferDetailsErrorAction { + return { + type: SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR, + error, + }; +} + +// eslint-disable-next-line max-len +export function requestReconciliationOverviewBatchTransferDetails(): RequestReconciliationOverviewBatchTransferDetailsAction { + return { + type: REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, + }; +} + +export function setWeeklyPositions({ data }: { data: WeeklyPosition[] }): SetWeeklyPositionsAction { + return { + type: SET_WEEKLY_POSITIONS, + data, + }; +} + +export function setWeeklyPositionsError({ + error, +}: { + error: string; +}): SetWeeklyPositionsErrorAction { + return { + type: SET_WEEKLY_POSITIONS_ERROR, + error, + }; +} + +export function requestWeeklyFlows(): RequestWeeklyFlowsAction { + return { + type: REQUEST_WEEKLY_FLOWS, + }; +} + +export function setWeeklyFlows({ data }: { data: WeeklyFlow[] }): SetWeeklyFlowsAction { + return { + type: SET_WEEKLY_FLOWS, + data, + }; +} + +export function setWeeklyFlowsError({ error }: { error: string }): SetWeeklyFlowsErrorAction { + return { + type: SET_WEEKLY_FLOWS_ERROR, + error, + }; +} + +// eslint-disable-next-line max-len +export function requestWeeklyPositions(): RequestWeeklyPositionsAction { + return { + type: REQUEST_WEEKLY_POSITIONS, + }; +} diff --git a/src/App/Dashboard/components/FlowGraph/index.tsx b/src/App/Dashboard/components/FlowGraph/index.tsx index 4968958..450cf87 100644 --- a/src/App/Dashboard/components/FlowGraph/index.tsx +++ b/src/App/Dashboard/components/FlowGraph/index.tsx @@ -1,104 +1,104 @@ -import React, { FC, useRef } from 'react'; -import { ChartLayout, ErrorBox, Spinner } from 'components'; -import LineChart from 'components/Charts/LineChart'; -import { ErrorMessage } from 'App/types'; -import { useWidth } from 'utils/hooks'; -import { generateDailyTimeLabels } from '../../helpers'; -import { WeeklyFlow } from '../../types'; - -interface FlowProps { - isPending: boolean | undefined; - items: WeeklyFlow[]; - error: ErrorMessage; -} - -const Flow: FC = ({ isPending, items, error }) => { - let content; - if (isPending) { - content = ( -
- -
- ); - } else if (error) { - content = Flows chart: Unable to load data; - } else { - content = ( - } - Recap={() =>
} - /> - ); - } - return
{content}
; -}; - -interface FlowGraphProps { - lines: WeeklyFlow[]; -} - -const FlowGraph: FC = ({ lines }) => { - const ref = useRef(document.createElement('div')); - const width = useWidth(ref); - const labels = generateDailyTimeLabels(6); - - return ( -
- -
- ); -}; - -export default Flow; +import React, { FC, useRef } from 'react'; +import { ChartLayout, ErrorBox, Spinner } from 'components'; +import LineChart from 'components/Charts/LineChart'; +import { ErrorMessage } from 'App/types'; +import { useWidth } from 'utils/hooks'; +import { generateDailyTimeLabels } from '../../helpers'; +import { WeeklyFlow } from '../../types'; + +interface FlowProps { + isPending: boolean | undefined; + items: WeeklyFlow[]; + error: ErrorMessage; +} + +const Flow: FC = ({ isPending, items, error }) => { + let content; + if (isPending) { + content = ( +
+ +
+ ); + } else if (error) { + content = Flows chart: Unable to load data; + } else { + content = ( + } + Recap={() =>
} + /> + ); + } + return
{content}
; +}; + +interface FlowGraphProps { + lines: WeeklyFlow[]; +} + +const FlowGraph: FC = ({ lines }) => { + const ref = useRef(document.createElement('div')); + const width = useWidth(ref); + const labels = generateDailyTimeLabels(6); + + return ( +
+ +
+ ); +}; + +export default Flow; diff --git a/src/App/Dashboard/components/ReconciliationOverview/BatchWindowModal.tsx b/src/App/Dashboard/components/ReconciliationOverview/BatchWindowModal.tsx index 9900437..f03dcaa 100644 --- a/src/App/Dashboard/components/ReconciliationOverview/BatchWindowModal.tsx +++ b/src/App/Dashboard/components/ReconciliationOverview/BatchWindowModal.tsx @@ -1,216 +1,216 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { getCurrencyValue } from 'utils/currencies'; -import { TransferStatus } from 'App/types'; -import { - AnimateFadeIn, - Column, - DataLabel, - DataList, - ErrorBox, - Modal, - Pill, - Row, - Select, - Spinner, -} from 'components'; -import * as actions from '../../actions'; -import * as selectors from '../../selectors'; -import { ReconciliationOverviewBatch, ReconciliationOverviewBatchTransfer } from '../../types'; -import * as helpers from '../../helpers'; -import TransferDetailsModal from './TransferDetailsModal'; - -const transferStatuses = [ - { label: helpers.toSpacedPascalCase(TransferStatus.Success), value: TransferStatus.Success }, - { label: helpers.toSpacedPascalCase(TransferStatus.Pending), value: TransferStatus.Pending }, - { label: helpers.toSpacedPascalCase(TransferStatus.Error), value: TransferStatus.Error }, -]; - -const stateProps = (state: State) => ({ - selectedReconciliationOverviewBatch: selectors.getSelectedReconciliationOverviewBatch( - state - ) as ReconciliationOverviewBatch, - // eslint-disable-next-line max-len - reconciliationOverviewBatchTransfers: selectors.getReconciliationOverviewBatchStatusFilteredTransfers( - state - ), - reconciliationOverviewBatchTransfersError: selectors.getReconciliationOverviewBatchTransfersError( - state - ), - // eslint-disable-next-line max-len - reconciliationOverviewBatchTransfersStatusFilter: selectors.getReconciliationOverviewBatchTransfersStatusFilter( - state - ), - // eslint-disable-next-line max-len - isReconciliationOverviewBatchTransfersPending: selectors.getIsReconciliationOverviewBatchTransfersPending( - state - ), - // eslint-disable-next-line max-len - selectedReconciliationOverviewBatchTransfer: selectors.getSelectedReconciliationOverviewBatchTransfer( - state - ) as ReconciliationOverviewBatchTransfer, -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onChangeReconciliationOverviewBatchTransferFilter: (filter: string) => - dispatch(actions.setReconciliationOverviewBatchTransfersStatusFilter({ filter })), - onSelectReconciliationOverviewBatchTransfer: (item: ReconciliationOverviewBatchTransfer) => - dispatch(actions.selectReconciliationOverviewBatchTransfer({ item })), - onModalCloseClick: () => dispatch(actions.hideReconciliationOverviewBatchModal()), -}); - -const reconciliationOverviewBathTransfersColumns = [ - { - label: 'ID', - key: 'id', - }, - { - label: 'Institution', - key: 'institution', - }, - { - label: 'Direction', - key: 'direction', - func: helpers.toSpacedPascalCase, - }, - { - label: 'Type', - key: 'type', - }, - { - label: 'Value', - key: 'amount', - func: (amount: string, item: ReconciliationOverviewBatchTransfer) => - `${item.currency} ${amount}`, - }, - { - label: 'Status', - key: 'status', - func: helpers.toSpacedPascalCase, - }, - { - label: 'Committed Date', - key: 'initiatedTimestamp', - func: helpers.toDashboardDate, - }, -]; - -interface BatchWindowModalProps { - selectedReconciliationOverviewBatch: ReconciliationOverviewBatch; - reconciliationOverviewBatchTransfers: ReconciliationOverviewBatchTransfer[]; - reconciliationOverviewBatchTransfersError: string | null; - reconciliationOverviewBatchTransfersStatusFilter: string | undefined; - isReconciliationOverviewBatchTransfersPending?: boolean; - selectedReconciliationOverviewBatchTransfer: ReconciliationOverviewBatchTransfer; - onChangeReconciliationOverviewBatchTransferFilter: (filter: string) => void; - onSelectReconciliationOverviewBatchTransfer: (item: ReconciliationOverviewBatchTransfer) => void; - onModalCloseClick: () => void; -} - -const BatchWindowModal: FC = ({ - selectedReconciliationOverviewBatch, - reconciliationOverviewBatchTransfers, - reconciliationOverviewBatchTransfersError, - reconciliationOverviewBatchTransfersStatusFilter, - isReconciliationOverviewBatchTransfersPending, - selectedReconciliationOverviewBatchTransfer, - onChangeReconciliationOverviewBatchTransferFilter, - onSelectReconciliationOverviewBatchTransfer, - onModalCloseClick, -}) => { - let content = null; - if (isReconciliationOverviewBatchTransfersPending) { - content = ( -
- -
- ); - } else if (reconciliationOverviewBatchTransfersError) { - content = Batch transfers: Unable to load data; - } else - content = ( - <> - - + + + + +
+ +
+ + ); + return ( + + + + + + + Batch ID + + {selectedReconciliationOverviewBatch.id} + + + + Status + + + {helpers.toSpacedPascalCase(selectedReconciliationOverviewBatch.status)} + + + + + Total Value + + $18,382.11 + + + + Volume + + + {getCurrencyValue('USD')(selectedReconciliationOverviewBatch.transferTotals)} + + + + + +
+ + Batch Opened + + + {helpers.toDashboardDate(selectedReconciliationOverviewBatch.startingTimestamp)} + +
+
+ + Batch Closed + + + {helpers.toDashboardDate(selectedReconciliationOverviewBatch.closingTimestamp)} + +
+
+
+ {content} + {selectedReconciliationOverviewBatchTransfer && } +
+ ); +}; + +export default connect(stateProps, dispatchProps)(BatchWindowModal); diff --git a/src/App/Dashboard/components/ReconciliationOverview/TransferDetailsModal.tsx b/src/App/Dashboard/components/ReconciliationOverview/TransferDetailsModal.tsx index 3753407..3966dea 100644 --- a/src/App/Dashboard/components/ReconciliationOverview/TransferDetailsModal.tsx +++ b/src/App/Dashboard/components/ReconciliationOverview/TransferDetailsModal.tsx @@ -1,119 +1,119 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { Column, FormInput, ErrorBox, Modal, Row, Spinner } from 'components'; -import * as actions from '../../actions'; -import * as selectors from '../../selectors'; -import { ReconciliationOverviewBatchTransfer, TransferDetails } from '../../types'; -import * as helpers from '../../helpers'; - -const stateProps = (state: State) => ({ - // eslint-disable-next-line max-len - selectedReconciliationOverviewBatchTransfer: selectors.getSelectedReconciliationOverviewBatchTransfer( - state - ) as ReconciliationOverviewBatchTransfer, - // eslint-disable-next-line max-len - reconciliationOverviewBatchTransferDetails: selectors.getReconciliationOverviewBatchTransferDetails( - state - ), - // eslint-disable-next-line max-len - reconciliationOverviewBatchTransferDetailsError: selectors.getReconciliationOverviewBatchTransferDetailsError( - state - ), - // eslint-disable-next-line max-len - isReconciliationOverviewBatchTransferDetailsPending: selectors.getIsReconciliationOverviewBatchTransferDetailsPending( - state - ), -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onModalCloseClick: () => dispatch(actions.hideReconciliationOverviewBatchTransferDetailsModal()), -}); - -interface TransferDetailsModalProps { - selectedReconciliationOverviewBatchTransfer: ReconciliationOverviewBatchTransfer; - reconciliationOverviewBatchTransferDetails?: TransferDetails; - reconciliationOverviewBatchTransferDetailsError: string | null; - isReconciliationOverviewBatchTransferDetailsPending?: boolean; - onModalCloseClick: () => void; -} - -const TransferDetailsModal: FC = ({ - selectedReconciliationOverviewBatchTransfer, - reconciliationOverviewBatchTransferDetails = {} as TransferDetails, - reconciliationOverviewBatchTransferDetailsError, - isReconciliationOverviewBatchTransferDetailsPending, - onModalCloseClick, -}) => { - let content = null; - if (isReconciliationOverviewBatchTransferDetailsPending) { - content = ( -
- -
- ); - } else if (reconciliationOverviewBatchTransferDetailsError) { - content = Transfers Details: Unable to load data; - } else { - content = ( - - - - - - - - - - - - - - - ); - } - return ( - - {content} - - ); -}; - -interface TransferDetailBlockProps { - label: string; - value?: string | number; -} - -const TransferDetailBlock: FC = ({ label, value = '' }) => ( - -); - -export default connect(stateProps, dispatchProps)(TransferDetailsModal); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { Column, FormInput, ErrorBox, Modal, Row, Spinner } from 'components'; +import * as actions from '../../actions'; +import * as selectors from '../../selectors'; +import { ReconciliationOverviewBatchTransfer, TransferDetails } from '../../types'; +import * as helpers from '../../helpers'; + +const stateProps = (state: State) => ({ + // eslint-disable-next-line max-len + selectedReconciliationOverviewBatchTransfer: selectors.getSelectedReconciliationOverviewBatchTransfer( + state + ) as ReconciliationOverviewBatchTransfer, + // eslint-disable-next-line max-len + reconciliationOverviewBatchTransferDetails: selectors.getReconciliationOverviewBatchTransferDetails( + state + ), + // eslint-disable-next-line max-len + reconciliationOverviewBatchTransferDetailsError: selectors.getReconciliationOverviewBatchTransferDetailsError( + state + ), + // eslint-disable-next-line max-len + isReconciliationOverviewBatchTransferDetailsPending: selectors.getIsReconciliationOverviewBatchTransferDetailsPending( + state + ), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onModalCloseClick: () => dispatch(actions.hideReconciliationOverviewBatchTransferDetailsModal()), +}); + +interface TransferDetailsModalProps { + selectedReconciliationOverviewBatchTransfer: ReconciliationOverviewBatchTransfer; + reconciliationOverviewBatchTransferDetails?: TransferDetails; + reconciliationOverviewBatchTransferDetailsError: string | null; + isReconciliationOverviewBatchTransferDetailsPending?: boolean; + onModalCloseClick: () => void; +} + +const TransferDetailsModal: FC = ({ + selectedReconciliationOverviewBatchTransfer, + reconciliationOverviewBatchTransferDetails = {} as TransferDetails, + reconciliationOverviewBatchTransferDetailsError, + isReconciliationOverviewBatchTransferDetailsPending, + onModalCloseClick, +}) => { + let content = null; + if (isReconciliationOverviewBatchTransferDetailsPending) { + content = ( +
+ +
+ ); + } else if (reconciliationOverviewBatchTransferDetailsError) { + content = Transfers Details: Unable to load data; + } else { + content = ( + + + + + + + + + + + + + + + ); + } + return ( + + {content} + + ); +}; + +interface TransferDetailBlockProps { + label: string; + value?: string | number; +} + +const TransferDetailBlock: FC = ({ label, value = '' }) => ( + +); + +export default connect(stateProps, dispatchProps)(TransferDetailsModal); diff --git a/src/App/Dashboard/components/ReconciliationOverview/index.tsx b/src/App/Dashboard/components/ReconciliationOverview/index.tsx index 9c69a80..73a53da 100644 --- a/src/App/Dashboard/components/ReconciliationOverview/index.tsx +++ b/src/App/Dashboard/components/ReconciliationOverview/index.tsx @@ -1,158 +1,158 @@ -import React, { FC } from 'react'; -import { - AnimateFadeIn, - Column, - DataLabel, - DataList, - ErrorBox, - Pill, - Row, - Spinner, -} from 'components'; -import { getFirstCurrencyValue } from 'utils/currencies'; -import { ErrorMessage } from 'App/types'; -import { ReconciliationOverviewBatch, BatchStatus } from '../../types'; -import * as helpers from '../../helpers'; -import BatchWindowModal from './BatchWindowModal'; - -const reconciliationOverviewColumns = [ - { - label: '', - key: 'status', - className: 'dashboard__overview__list__status-indicator', - sortable: false, - func: (status: BatchStatus) => , - }, - { - label: 'Status', - key: 'status', - func: helpers.toSpacedPascalCase, - }, - { - label: 'Txns', - key: 'transferCount', - }, - { - label: 'Value', - key: 'transferTotals', - func: getFirstCurrencyValue(['USD', 'EUR']), - }, - { - label: 'Errors', - key: 'errorCount', - }, - { - label: 'Block Opened', - key: 'startingTimestamp', - func: helpers.toDashboardDate, - }, - { - label: 'Block Closed', - key: 'closingTimestamp', - func: (date: string | undefined) => helpers.toDashboardDate(date) || '-', - }, -]; - -interface ReconciliationOverviewProps { - isPending: boolean | undefined; - items: ReconciliationOverviewBatch[]; - selectedItem: ReconciliationOverviewBatch | undefined; - error: ErrorMessage; - onSelectItem: (item: ReconciliationOverviewBatch) => void; -} - -const ReconciliationOverview: FC = ({ - isPending, - items, - selectedItem, - error, - onSelectItem, -}) => { - let content = null; - if (isPending) { - content = ( -
- -
- ); - } else if (error) { - content = Overview: Unable to load data; - } else { - content = ( - <> - -
- -
- {selectedItem && } - - ); - } - - return ( -
- Reconciliation Overview for Today (Time Blocks) -
- {content} -
- ); -}; - -interface OverviewStatusIndicatorProps { - status: BatchStatus; -} - -const OverviewStatusIndicator: FC = ({ status }) => { - return ( -
- ); -}; - -interface OverviewStatusProps { - items: ReconciliationOverviewBatch[]; -} - -const OverviewStatus: FC = ({ items }) => { - const { open, onTrack, hasErrors, overdue } = helpers.getAllStatusCount(items); - return ( - - - - - - - - - - - - - - - - - - ); -}; - -export default ReconciliationOverview; +import React, { FC } from 'react'; +import { + AnimateFadeIn, + Column, + DataLabel, + DataList, + ErrorBox, + Pill, + Row, + Spinner, +} from 'components'; +import { getFirstCurrencyValue } from 'utils/currencies'; +import { ErrorMessage } from 'App/types'; +import { ReconciliationOverviewBatch, BatchStatus } from '../../types'; +import * as helpers from '../../helpers'; +import BatchWindowModal from './BatchWindowModal'; + +const reconciliationOverviewColumns = [ + { + label: '', + key: 'status', + className: 'dashboard__overview__list__status-indicator', + sortable: false, + func: (status: BatchStatus) => , + }, + { + label: 'Status', + key: 'status', + func: helpers.toSpacedPascalCase, + }, + { + label: 'Txns', + key: 'transferCount', + }, + { + label: 'Value', + key: 'transferTotals', + func: getFirstCurrencyValue(['USD', 'EUR']), + }, + { + label: 'Errors', + key: 'errorCount', + }, + { + label: 'Block Opened', + key: 'startingTimestamp', + func: helpers.toDashboardDate, + }, + { + label: 'Block Closed', + key: 'closingTimestamp', + func: (date: string | undefined) => helpers.toDashboardDate(date) || '-', + }, +]; + +interface ReconciliationOverviewProps { + isPending: boolean | undefined; + items: ReconciliationOverviewBatch[]; + selectedItem: ReconciliationOverviewBatch | undefined; + error: ErrorMessage; + onSelectItem: (item: ReconciliationOverviewBatch) => void; +} + +const ReconciliationOverview: FC = ({ + isPending, + items, + selectedItem, + error, + onSelectItem, +}) => { + let content = null; + if (isPending) { + content = ( +
+ +
+ ); + } else if (error) { + content = Overview: Unable to load data; + } else { + content = ( + <> + +
+ +
+ {selectedItem && } + + ); + } + + return ( +
+ Reconciliation Overview for Today (Time Blocks) +
+ {content} +
+ ); +}; + +interface OverviewStatusIndicatorProps { + status: BatchStatus; +} + +const OverviewStatusIndicator: FC = ({ status }) => { + return ( +
+ ); +}; + +interface OverviewStatusProps { + items: ReconciliationOverviewBatch[]; +} + +const OverviewStatus: FC = ({ items }) => { + const { open, onTrack, hasErrors, overdue } = helpers.getAllStatusCount(items); + return ( + + + + + + + + + + + + + + + + + + ); +}; + +export default ReconciliationOverview; diff --git a/src/App/Dashboard/components/TodayPositionGraph/index.tsx b/src/App/Dashboard/components/TodayPositionGraph/index.tsx index fee72fc..4497340 100644 --- a/src/App/Dashboard/components/TodayPositionGraph/index.tsx +++ b/src/App/Dashboard/components/TodayPositionGraph/index.tsx @@ -1,157 +1,157 @@ -import React, { FC, useRef } from 'react'; -import { ChartLayout, DataLabel, ErrorBox, Spinner } from 'components'; -import LineChart from 'components/Charts/LineChart'; -import { ErrorMessage } from 'App/types'; -import { useWidth } from 'utils/hooks'; -import { generateDailyTimeLabels } from '../../helpers'; -import { WeeklyPosition } from '../../types'; - -function lastItemValue(items: WeeklyPosition): number | undefined { - if (!items?.points?.length) { - return undefined; - } - return items.points[items.points.length - 1][1]; -} - -interface TodayPositionProps { - isPending: boolean | undefined; - items: WeeklyPosition[]; - error: ErrorMessage; -} - -const TodayPosition: FC = ({ isPending, items, error }) => { - let content; - if (isPending) { - content = ( -
- -
- ); - } else if (error) { - content = Position Graph: Unable to load data; - } else { - content = ( - } - Recap={() => ( - - )} - /> - ); - } - return
{content}
; -}; - -interface TodayPositionGraphProps { - lines: WeeklyPosition[]; -} - -const TodayPositionGraph: FC = ({ lines }) => { - const ref = useRef(document.createElement('div')); - const width = useWidth(ref); - const labels = generateDailyTimeLabels(6); - - return ( -
- -
- ); -}; - -function signed(value: number): string { - return `${value > 0 ? '+' : ''}${value}`; -} - -interface GraphRecapProps { - reserved?: number; - committed?: number; - current?: number; -} - -const GraphRecap: FC = ({ reserved = 0, committed = 0, current = 0 }) => { - return ( -
- - Current Totals - -
- Current Position -
- - {signed(current)} - - /10000 -
-
- Reserved Funds - - {signed(reserved)} - -
- Transfers Committed - - {signed(committed)} - -
-
- ); -}; -export default TodayPosition; +import React, { FC, useRef } from 'react'; +import { ChartLayout, DataLabel, ErrorBox, Spinner } from 'components'; +import LineChart from 'components/Charts/LineChart'; +import { ErrorMessage } from 'App/types'; +import { useWidth } from 'utils/hooks'; +import { generateDailyTimeLabels } from '../../helpers'; +import { WeeklyPosition } from '../../types'; + +function lastItemValue(items: WeeklyPosition): number | undefined { + if (!items?.points?.length) { + return undefined; + } + return items.points[items.points.length - 1][1]; +} + +interface TodayPositionProps { + isPending: boolean | undefined; + items: WeeklyPosition[]; + error: ErrorMessage; +} + +const TodayPosition: FC = ({ isPending, items, error }) => { + let content; + if (isPending) { + content = ( +
+ +
+ ); + } else if (error) { + content = Position Graph: Unable to load data; + } else { + content = ( + } + Recap={() => ( + + )} + /> + ); + } + return
{content}
; +}; + +interface TodayPositionGraphProps { + lines: WeeklyPosition[]; +} + +const TodayPositionGraph: FC = ({ lines }) => { + const ref = useRef(document.createElement('div')); + const width = useWidth(ref); + const labels = generateDailyTimeLabels(6); + + return ( +
+ +
+ ); +}; + +function signed(value: number): string { + return `${value > 0 ? '+' : ''}${value}`; +} + +interface GraphRecapProps { + reserved?: number; + committed?: number; + current?: number; +} + +const GraphRecap: FC = ({ reserved = 0, committed = 0, current = 0 }) => { + return ( +
+ + Current Totals + +
+ Current Position +
+ + {signed(current)} + + /10000 +
+
+ Reserved Funds + + {signed(reserved)} + +
+ Transfers Committed + + {signed(committed)} + +
+
+ ); +}; +export default TodayPosition; diff --git a/src/App/Dashboard/helpers.ts b/src/App/Dashboard/helpers.ts index fca832a..09312e6 100644 --- a/src/App/Dashboard/helpers.ts +++ b/src/App/Dashboard/helpers.ts @@ -1,69 +1,69 @@ -import moment from 'moment'; -import camelCase from 'lodash/camelCase'; -import startCase from 'lodash/startCase'; -import { ReconciliationOverviewBatch, BatchStatus } from './types'; - -export function statusToClassName(status: BatchStatus): string { - const states = { - [BatchStatus.Open]: 'open', - [BatchStatus.OnTrack]: 'on-track', - [BatchStatus.HasErrors]: 'has-errors', - [BatchStatus.Overdue]: 'overdue', - }; - return states[status]; -} - -interface StatusMap { - open: number; - onTrack: number; - hasErrors: number; - overdue: number; -} - -export function getAllStatusCount(items: ReconciliationOverviewBatch[]): StatusMap { - function countStatus(overviewBatches: ReconciliationOverviewBatch[], status: BatchStatus) { - return overviewBatches.reduce((total: number, item: ReconciliationOverviewBatch): number => { - return total + (item.status === status ? 1 : 0); - }, 0); - } - return { - open: countStatus(items, BatchStatus.Open), - onTrack: countStatus(items, BatchStatus.OnTrack), - hasErrors: countStatus(items, BatchStatus.HasErrors), - overdue: countStatus(items, BatchStatus.Overdue), - }; -} - -export function toDashboardDate(timestamp: string | undefined): string | undefined { - if (!timestamp) { - return undefined; - } - return moment(timestamp).format('DD/MM/YYYY LT z'); -} - -export function toSpacedPascalCase(str: string): string { - return startCase(camelCase(str)); -} - -export function generateDailyTimeLabels(count: number) { - return new Array(count).fill(0).map((_, index) => - moment() - .subtract(index + 1, 'days') - .format('MM/DD/YYYY') - ); -} - -interface Mapping { - color: string; - key: keyof T; -} - -// eslint-disable-next-line -export function toLineChartData(items: any, mappings: any) { - // eslint-disable-next-line - return mappings.map((mapping: any) => ({ - color: mapping.color, - // eslint-disable-next-line - points: items.map((flow: any, index: number) => [index, parseInt(flow[mapping.key])]), - })); -} +import moment from 'moment'; +import camelCase from 'lodash/camelCase'; +import startCase from 'lodash/startCase'; +import { ReconciliationOverviewBatch, BatchStatus } from './types'; + +export function statusToClassName(status: BatchStatus): string { + const states = { + [BatchStatus.Open]: 'open', + [BatchStatus.OnTrack]: 'on-track', + [BatchStatus.HasErrors]: 'has-errors', + [BatchStatus.Overdue]: 'overdue', + }; + return states[status]; +} + +interface StatusMap { + open: number; + onTrack: number; + hasErrors: number; + overdue: number; +} + +export function getAllStatusCount(items: ReconciliationOverviewBatch[]): StatusMap { + function countStatus(overviewBatches: ReconciliationOverviewBatch[], status: BatchStatus) { + return overviewBatches.reduce((total: number, item: ReconciliationOverviewBatch): number => { + return total + (item.status === status ? 1 : 0); + }, 0); + } + return { + open: countStatus(items, BatchStatus.Open), + onTrack: countStatus(items, BatchStatus.OnTrack), + hasErrors: countStatus(items, BatchStatus.HasErrors), + overdue: countStatus(items, BatchStatus.Overdue), + }; +} + +export function toDashboardDate(timestamp: string | undefined): string | undefined { + if (!timestamp) { + return undefined; + } + return moment(timestamp).format('DD/MM/YYYY LT z'); +} + +export function toSpacedPascalCase(str: string): string { + return startCase(camelCase(str)); +} + +export function generateDailyTimeLabels(count: number) { + return new Array(count).fill(0).map((_, index) => + moment() + .subtract(index + 1, 'days') + .format('MM/DD/YYYY') + ); +} + +interface Mapping { + color: string; + key: keyof T; +} + +// eslint-disable-next-line +export function toLineChartData(items: any, mappings: any) { + // eslint-disable-next-line + return mappings.map((mapping: any) => ({ + color: mapping.color, + // eslint-disable-next-line + points: items.map((flow: any, index: number) => [index, parseInt(flow[mapping.key])]), + })); +} diff --git a/src/App/Dashboard/hocs.tsx b/src/App/Dashboard/hocs.tsx index 2a70f1e..222cdcf 100644 --- a/src/App/Dashboard/hocs.tsx +++ b/src/App/Dashboard/hocs.tsx @@ -1,25 +1,25 @@ -import React, { Component, FC } from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'store/types'; -import * as actions from './actions'; - -const dispatchProps = (dispatch: Dispatch) => ({ - onDashboardMount: () => dispatch(actions.requestDashboardPageData()), -}); - -type DashboardLoaderProps = { - onDashboardMount: () => void; -}; - -export function loadDashboard(Dashboard: FC) { - class DashboardLoader extends Component { - componentDidMount() { - this.props.onDashboardMount(); - } - - render() { - return ; - } - } - return connect(null, dispatchProps)(DashboardLoader); -} +import React, { Component, FC } from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'store/types'; +import * as actions from './actions'; + +const dispatchProps = (dispatch: Dispatch) => ({ + onDashboardMount: () => dispatch(actions.requestDashboardPageData()), +}); + +type DashboardLoaderProps = { + onDashboardMount: () => void; +}; + +export function loadDashboard(Dashboard: FC) { + class DashboardLoader extends Component { + componentDidMount() { + this.props.onDashboardMount(); + } + + render() { + return ; + } + } + return connect(null, dispatchProps)(DashboardLoader); +} diff --git a/src/App/Dashboard/index.ts b/src/App/Dashboard/index.ts index 143cd03..5fb9883 100644 --- a/src/App/Dashboard/index.ts +++ b/src/App/Dashboard/index.ts @@ -1,10 +1,10 @@ -import withErrorBoundary from 'utils/hocs/withErrorBoundary'; -import { ComponentType } from 'react'; -import Dashboard from './Dashboard'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; - -export default withErrorBoundary(Dashboard as ComponentType); -export { actions, reducer, selectors, types }; +import withErrorBoundary from 'utils/hocs/withErrorBoundary'; +import { ComponentType } from 'react'; +import Dashboard from './Dashboard'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; + +export default withErrorBoundary(Dashboard as ComponentType); +export { actions, reducer, selectors, types }; diff --git a/src/App/Dashboard/reducers.ts b/src/App/Dashboard/reducers.ts index 8c44a9a..3bd533a 100644 --- a/src/App/Dashboard/reducers.ts +++ b/src/App/Dashboard/reducers.ts @@ -1,124 +1,124 @@ -import { - SET_RECONCILIATION_OVERVIEW_BATCHES, - SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR, - SELECT_RECONCILIATION_OVERVIEW_BATCH, - HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER, - SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, - HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, - SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR, - SET_WEEKLY_POSITIONS, - SET_WEEKLY_POSITIONS_ERROR, - SET_WEEKLY_FLOWS, - SET_WEEKLY_FLOWS_ERROR, - DashboardActionTypes, - DashboardState, -} from './types'; - -export const initialState: DashboardState = { - reconciliationOverviewBatches: [], - reconciliationOverviewBatchesError: null, - selectedReconciliationOverviewBatch: undefined, - reconciliationOverviewBatchTransfers: [], - reconciliationOverviewBatchTransfersError: null, - selectedReconciliationOverviewBatchTransfer: undefined, - reconciliationOverviewBatchTransferDetails: undefined, - reconciliationOverviewBatchTransferDetailsError: null, - reconciliationOverviewBatchTransfersStatusFilter: undefined, - weeklyPositions: [], - weeklyPositionsError: null, - weeklyFlows: [], - weeklyFlowsError: null, -}; - -export default function dashboardReducer( - state = initialState, - action: DashboardActionTypes -): DashboardState { - switch (action.type) { - case SET_RECONCILIATION_OVERVIEW_BATCHES: - return { - ...state, - reconciliationOverviewBatches: action.data, - }; - case SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR: - return { - ...state, - reconciliationOverviewBatchesError: action.error, - }; - case SELECT_RECONCILIATION_OVERVIEW_BATCH: - return { - ...state, - selectedReconciliationOverviewBatch: action.item, - }; - case HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL: - return { - ...state, - selectedReconciliationOverviewBatch: initialState.selectedReconciliationOverviewBatch, - reconciliationOverviewBatchTransfersStatusFilter: - initialState.reconciliationOverviewBatchTransfersStatusFilter, - }; - case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS: - return { - ...state, - reconciliationOverviewBatchTransfers: action.data, - }; - case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR: - return { - ...state, - reconciliationOverviewBatchTransfersError: action.error, - }; - case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER: - return { - ...state, - reconciliationOverviewBatchTransfersStatusFilter: action.filter, - }; - case SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER: - return { - ...state, - selectedReconciliationOverviewBatchTransfer: action.item, - }; - case HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL: - return { - ...state, - selectedReconciliationOverviewBatchTransfer: - initialState.selectedReconciliationOverviewBatchTransfer, - }; - case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS: - return { - ...state, - reconciliationOverviewBatchTransferDetails: action.data, - }; - case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR: - return { - ...state, - reconciliationOverviewBatchTransferDetailsError: action.error, - }; - - case SET_WEEKLY_POSITIONS: - return { - ...state, - weeklyPositions: action.data, - }; - case SET_WEEKLY_POSITIONS_ERROR: - return { - ...state, - weeklyPositionsError: action.error, - }; - case SET_WEEKLY_FLOWS: - return { - ...state, - weeklyFlows: action.data, - }; - case SET_WEEKLY_FLOWS_ERROR: - return { - ...state, - weeklyFlowsError: action.error, - }; - default: - return state; - } -} +import { + SET_RECONCILIATION_OVERVIEW_BATCHES, + SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR, + SELECT_RECONCILIATION_OVERVIEW_BATCH, + HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER, + SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, + HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS, + SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR, + SET_WEEKLY_POSITIONS, + SET_WEEKLY_POSITIONS_ERROR, + SET_WEEKLY_FLOWS, + SET_WEEKLY_FLOWS_ERROR, + DashboardActionTypes, + DashboardState, +} from './types'; + +export const initialState: DashboardState = { + reconciliationOverviewBatches: [], + reconciliationOverviewBatchesError: null, + selectedReconciliationOverviewBatch: undefined, + reconciliationOverviewBatchTransfers: [], + reconciliationOverviewBatchTransfersError: null, + selectedReconciliationOverviewBatchTransfer: undefined, + reconciliationOverviewBatchTransferDetails: undefined, + reconciliationOverviewBatchTransferDetailsError: null, + reconciliationOverviewBatchTransfersStatusFilter: undefined, + weeklyPositions: [], + weeklyPositionsError: null, + weeklyFlows: [], + weeklyFlowsError: null, +}; + +export default function dashboardReducer( + state = initialState, + action: DashboardActionTypes +): DashboardState { + switch (action.type) { + case SET_RECONCILIATION_OVERVIEW_BATCHES: + return { + ...state, + reconciliationOverviewBatches: action.data, + }; + case SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR: + return { + ...state, + reconciliationOverviewBatchesError: action.error, + }; + case SELECT_RECONCILIATION_OVERVIEW_BATCH: + return { + ...state, + selectedReconciliationOverviewBatch: action.item, + }; + case HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL: + return { + ...state, + selectedReconciliationOverviewBatch: initialState.selectedReconciliationOverviewBatch, + reconciliationOverviewBatchTransfersStatusFilter: + initialState.reconciliationOverviewBatchTransfersStatusFilter, + }; + case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS: + return { + ...state, + reconciliationOverviewBatchTransfers: action.data, + }; + case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR: + return { + ...state, + reconciliationOverviewBatchTransfersError: action.error, + }; + case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER: + return { + ...state, + reconciliationOverviewBatchTransfersStatusFilter: action.filter, + }; + case SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER: + return { + ...state, + selectedReconciliationOverviewBatchTransfer: action.item, + }; + case HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL: + return { + ...state, + selectedReconciliationOverviewBatchTransfer: + initialState.selectedReconciliationOverviewBatchTransfer, + }; + case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS: + return { + ...state, + reconciliationOverviewBatchTransferDetails: action.data, + }; + case SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR: + return { + ...state, + reconciliationOverviewBatchTransferDetailsError: action.error, + }; + + case SET_WEEKLY_POSITIONS: + return { + ...state, + weeklyPositions: action.data, + }; + case SET_WEEKLY_POSITIONS_ERROR: + return { + ...state, + weeklyPositionsError: action.error, + }; + case SET_WEEKLY_FLOWS: + return { + ...state, + weeklyFlows: action.data, + }; + case SET_WEEKLY_FLOWS_ERROR: + return { + ...state, + weeklyFlowsError: action.error, + }; + default: + return state; + } +} diff --git a/src/App/Dashboard/sagas.ts b/src/App/Dashboard/sagas.ts index dec9cf1..33fae84 100644 --- a/src/App/Dashboard/sagas.ts +++ b/src/App/Dashboard/sagas.ts @@ -1,191 +1,191 @@ -import { all, call, put, takeLatest } from 'redux-saga/effects'; -import { Action } from 'redux'; -import apis from 'utils/apis'; -import { fetchTransfersErrors } from 'App/Transfers/sagas'; -import { is20x } from 'utils/http'; -import { - REQUEST_DASHBOARD_PAGE_DATA, - REQUEST_RECONCILIATION_OVERVIEW_BATCHES, - SELECT_RECONCILIATION_OVERVIEW_BATCH, - SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, - REQUEST_WEEKLY_POSITIONS, - REQUEST_WEEKLY_FLOWS, - SelectReconciliationOverviewBatchAction, - SelectReconciliationOverviewBatchTransferAction, - RequestReconciliationOverviewBatchesAction, - RequestWeeklyPositionsAction, - RequestWeeklyFlowsAction, -} from './types'; -import { - setReconciliationOverviewBatches, - setReconciliationOverviewBatchesError, - setReconciliationOverviewBatchTransfers, - setReconciliationOverviewBatchTransfersError, - setReconciliationOverviewBatchTransferDetails, - setReconciliationOverviewBatchTransferDetailsError, - setWeeklyPositions, - setWeeklyPositionsError, - setWeeklyFlows, - setWeeklyFlowsError, -} from './actions'; -// TODO: use helpers with api chart data import * as helpers from './helpers'; -import { weeklyPositions, weeklyFlows } from './_mockData'; - -function* fetchReconciliationOverviewBatches(action: RequestReconciliationOverviewBatchesAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.batches.read, {}); - if (is20x(response.status)) { - yield put(setReconciliationOverviewBatches({ data: response.data })); - } else { - yield put(setReconciliationOverviewBatchesError({ error: response.status })); - } - } catch (e) { - yield put(setReconciliationOverviewBatchesError({ error: e.message })); - } -} - -export function* reconciliationOverviewBatchesSaga() { - yield takeLatest([REQUEST_RECONCILIATION_OVERVIEW_BATCHES], fetchReconciliationOverviewBatches); -} - -function* fetchReconciliationOverviewBatchTransfers( - action: SelectReconciliationOverviewBatchAction -) { - try { - // eslint-disable-next-line - const response = yield call(apis.batchTransfers.read, { batchId: action.item.id }); - if (is20x(response.status)) { - yield put(setReconciliationOverviewBatchTransfers({ data: response.data.slice(0, 100) })); - } else { - yield put(setReconciliationOverviewBatchTransfersError({ error: response.status })); - } - } catch (e) { - yield put(setReconciliationOverviewBatchTransfersError({ error: e.message })); - } -} - -export function* reconciliationOverviewBatchTransfersSaga() { - yield takeLatest( - [SELECT_RECONCILIATION_OVERVIEW_BATCH], - fetchReconciliationOverviewBatchTransfers - ); -} - -function* fetchReconciliationOverviewBatchTransferDetails( - action: SelectReconciliationOverviewBatchTransferAction -) { - try { - // eslint-disable-next-line - const response = yield call(apis.transferDetails.read, { - transferId: action.item.id, - }); - if (is20x(response.status)) { - yield put( - setReconciliationOverviewBatchTransferDetails({ - data: response.data, - }) - ); - } else { - yield put(setReconciliationOverviewBatchTransferDetailsError({ error: response.status })); - } - } catch (e) { - yield put(setReconciliationOverviewBatchTransferDetailsError({ error: e.message })); - } -} - -export function* reconciliationOverviewBatchTransferDetailsSaga() { - yield takeLatest( - [SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER], - fetchReconciliationOverviewBatchTransferDetails - ); -} - -function* fetchWeeklyPositions(action: RequestWeeklyPositionsAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.weeklyPositions.read, { - params: { hoursPrevious: 24 * 7 }, - }); - yield put( - setWeeklyPositions({ - data: weeklyPositions, - // TODO: use real data - /* helpers.toLineChartData(response.data, [ - { key: 'position', color: '#4fc7e7' }, - { key: 'reserved', color: '#12d670' }, - { key: 'committed', color: '#ff9016' }, - { key: 'liquidity', color: '#e23a54' }, - ]), - */ - }) - ); - } catch (e) { - yield put(setWeeklyPositionsError({ error: e.message })); - } -} - -export function* weeklyPositionsSaga() { - yield takeLatest([REQUEST_WEEKLY_POSITIONS], fetchWeeklyPositions); -} - -interface Flow { - inbound: string; - outbound: string; - timestamp: string; -} -function* fetchWeeklyFlows(action: RequestWeeklyFlowsAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.weeklyFlows.read, { - params: { hoursPrevious: 24 * 7 }, - }); - yield put( - setWeeklyFlows({ - data: weeklyFlows, - // TODO use real api data helpers.toLineChartData(response.data, [ - /* - { - color: '#4fc7e7', - key: 'inbound', - }, - { - color: '#e23a54', - key: 'outbound', - }, - ]), - */ - }) - ); - } catch (e) { - yield put(setWeeklyFlowsError({ error: e.message })); - } -} - -export function* weeklyFlowsSaga() { - yield takeLatest([REQUEST_WEEKLY_FLOWS], fetchWeeklyFlows); -} - -function* fetchOverviewAllData(action: Action) { - yield all([ - call(fetchReconciliationOverviewBatches, action), - call(fetchWeeklyPositions, action), - call(fetchWeeklyFlows, action), - call(fetchTransfersErrors, action), - ]); -} - -export function* dashboardPageSaga() { - yield takeLatest([REQUEST_DASHBOARD_PAGE_DATA], fetchOverviewAllData); -} - -export default function* rootSaga() { - yield all([ - dashboardPageSaga(), - reconciliationOverviewBatchesSaga(), - reconciliationOverviewBatchTransfersSaga(), - reconciliationOverviewBatchTransferDetailsSaga(), - weeklyPositionsSaga(), - weeklyFlowsSaga(), - ]); -} +import { all, call, put, takeLatest } from 'redux-saga/effects'; +import { Action } from 'redux'; +import apis from 'utils/apis'; +import { fetchTransfersErrors } from 'App/Transfers/sagas'; +import { is20x } from 'utils/http'; +import { + REQUEST_DASHBOARD_PAGE_DATA, + REQUEST_RECONCILIATION_OVERVIEW_BATCHES, + SELECT_RECONCILIATION_OVERVIEW_BATCH, + SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER, + REQUEST_WEEKLY_POSITIONS, + REQUEST_WEEKLY_FLOWS, + SelectReconciliationOverviewBatchAction, + SelectReconciliationOverviewBatchTransferAction, + RequestReconciliationOverviewBatchesAction, + RequestWeeklyPositionsAction, + RequestWeeklyFlowsAction, +} from './types'; +import { + setReconciliationOverviewBatches, + setReconciliationOverviewBatchesError, + setReconciliationOverviewBatchTransfers, + setReconciliationOverviewBatchTransfersError, + setReconciliationOverviewBatchTransferDetails, + setReconciliationOverviewBatchTransferDetailsError, + setWeeklyPositions, + setWeeklyPositionsError, + setWeeklyFlows, + setWeeklyFlowsError, +} from './actions'; +// TODO: use helpers with api chart data import * as helpers from './helpers'; +import { weeklyPositions, weeklyFlows } from './_mockData'; + +function* fetchReconciliationOverviewBatches(action: RequestReconciliationOverviewBatchesAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.batches.read, {}); + if (is20x(response.status)) { + yield put(setReconciliationOverviewBatches({ data: response.data })); + } else { + yield put(setReconciliationOverviewBatchesError({ error: response.status })); + } + } catch (e) { + yield put(setReconciliationOverviewBatchesError({ error: e.message })); + } +} + +export function* reconciliationOverviewBatchesSaga() { + yield takeLatest([REQUEST_RECONCILIATION_OVERVIEW_BATCHES], fetchReconciliationOverviewBatches); +} + +function* fetchReconciliationOverviewBatchTransfers( + action: SelectReconciliationOverviewBatchAction +) { + try { + // eslint-disable-next-line + const response = yield call(apis.batchTransfers.read, { batchId: action.item.id }); + if (is20x(response.status)) { + yield put(setReconciliationOverviewBatchTransfers({ data: response.data.slice(0, 100) })); + } else { + yield put(setReconciliationOverviewBatchTransfersError({ error: response.status })); + } + } catch (e) { + yield put(setReconciliationOverviewBatchTransfersError({ error: e.message })); + } +} + +export function* reconciliationOverviewBatchTransfersSaga() { + yield takeLatest( + [SELECT_RECONCILIATION_OVERVIEW_BATCH], + fetchReconciliationOverviewBatchTransfers + ); +} + +function* fetchReconciliationOverviewBatchTransferDetails( + action: SelectReconciliationOverviewBatchTransferAction +) { + try { + // eslint-disable-next-line + const response = yield call(apis.transferDetails.read, { + transferId: action.item.id, + }); + if (is20x(response.status)) { + yield put( + setReconciliationOverviewBatchTransferDetails({ + data: response.data, + }) + ); + } else { + yield put(setReconciliationOverviewBatchTransferDetailsError({ error: response.status })); + } + } catch (e) { + yield put(setReconciliationOverviewBatchTransferDetailsError({ error: e.message })); + } +} + +export function* reconciliationOverviewBatchTransferDetailsSaga() { + yield takeLatest( + [SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER], + fetchReconciliationOverviewBatchTransferDetails + ); +} + +function* fetchWeeklyPositions(action: RequestWeeklyPositionsAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.weeklyPositions.read, { + params: { hoursPrevious: 24 * 7 }, + }); + yield put( + setWeeklyPositions({ + data: weeklyPositions, + // TODO: use real data + /* helpers.toLineChartData(response.data, [ + { key: 'position', color: '#4fc7e7' }, + { key: 'reserved', color: '#12d670' }, + { key: 'committed', color: '#ff9016' }, + { key: 'liquidity', color: '#e23a54' }, + ]), + */ + }) + ); + } catch (e) { + yield put(setWeeklyPositionsError({ error: e.message })); + } +} + +export function* weeklyPositionsSaga() { + yield takeLatest([REQUEST_WEEKLY_POSITIONS], fetchWeeklyPositions); +} + +interface Flow { + inbound: string; + outbound: string; + timestamp: string; +} +function* fetchWeeklyFlows(action: RequestWeeklyFlowsAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.weeklyFlows.read, { + params: { hoursPrevious: 24 * 7 }, + }); + yield put( + setWeeklyFlows({ + data: weeklyFlows, + // TODO use real api data helpers.toLineChartData(response.data, [ + /* + { + color: '#4fc7e7', + key: 'inbound', + }, + { + color: '#e23a54', + key: 'outbound', + }, + ]), + */ + }) + ); + } catch (e) { + yield put(setWeeklyFlowsError({ error: e.message })); + } +} + +export function* weeklyFlowsSaga() { + yield takeLatest([REQUEST_WEEKLY_FLOWS], fetchWeeklyFlows); +} + +function* fetchOverviewAllData(action: Action) { + yield all([ + call(fetchReconciliationOverviewBatches, action), + call(fetchWeeklyPositions, action), + call(fetchWeeklyFlows, action), + call(fetchTransfersErrors, action), + ]); +} + +export function* dashboardPageSaga() { + yield takeLatest([REQUEST_DASHBOARD_PAGE_DATA], fetchOverviewAllData); +} + +export default function* rootSaga() { + yield all([ + dashboardPageSaga(), + reconciliationOverviewBatchesSaga(), + reconciliationOverviewBatchTransfersSaga(), + reconciliationOverviewBatchTransferDetailsSaga(), + weeklyPositionsSaga(), + weeklyFlowsSaga(), + ]); +} diff --git a/src/App/Dashboard/selectors.ts b/src/App/Dashboard/selectors.ts index 2a98c94..299ef1e 100644 --- a/src/App/Dashboard/selectors.ts +++ b/src/App/Dashboard/selectors.ts @@ -1,60 +1,60 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; - -export const getReconciliationOverviewBatches = (state: State) => - state.dashboard.reconciliationOverviewBatches; -export const getReconciliationOverviewBatchesError = (state: State) => - state.dashboard.reconciliationOverviewBatchesError; -export const getIsReconciliationOverviewBatchesPending = createSelector( - (state: State) => state.api, - isPending('batches.read') -); - -export const getSelectedReconciliationOverviewBatch = (state: State) => - state.dashboard.selectedReconciliationOverviewBatch; -export const getReconciliationOverviewBatchTransfers = (state: State) => - state.dashboard.reconciliationOverviewBatchTransfers; -export const getReconciliationOverviewBatchTransfersError = (state: State) => - state.dashboard.reconciliationOverviewBatchTransfersError; -export const getReconciliationOverviewBatchTransfersStatusFilter = (state: State) => - state.dashboard.reconciliationOverviewBatchTransfersStatusFilter; -export const getIsReconciliationOverviewBatchTransfersPending = createSelector( - (state: State) => state.api, - isPending('batchTransfers.read') -); -export const getReconciliationOverviewBatchStatusFilteredTransfers = createSelector( - getReconciliationOverviewBatchTransfers, - getReconciliationOverviewBatchTransfersStatusFilter, - (transfers, status) => { - if (!status) { - return transfers; - } - return transfers.filter((transfer) => transfer.status === status); - } -); - -export const getSelectedReconciliationOverviewBatchTransfer = (state: State) => - state.dashboard.selectedReconciliationOverviewBatchTransfer; -export const getReconciliationOverviewBatchTransferDetails = (state: State) => - state.dashboard.reconciliationOverviewBatchTransferDetails; -export const getReconciliationOverviewBatchTransferDetailsError = (state: State) => - state.dashboard.reconciliationOverviewBatchTransferDetailsError; -export const getIsReconciliationOverviewBatchTransferDetailsPending = createSelector( - (state: State) => state.api, - isPending('transferDetails.read') -); - -export const getWeeklyPositions = (state: State) => state.dashboard.weeklyPositions; -export const getWeeklyPositionsError = (state: State) => state.dashboard.weeklyPositionsError; -export const getIsWeeklyPositionsPending = createSelector( - (state: State) => state.api, - isPending('weeklyPositions.read') -); - -export const getWeeklyFlows = (state: State) => state.dashboard.weeklyFlows; -export const getWeeklyFlowsError = (state: State) => state.dashboard.weeklyFlowsError; -export const getIsWeeklyFlowsPending = createSelector( - (state: State) => state.api, - isPending('weeklyFlows.read') -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; + +export const getReconciliationOverviewBatches = (state: State) => + state.dashboard.reconciliationOverviewBatches; +export const getReconciliationOverviewBatchesError = (state: State) => + state.dashboard.reconciliationOverviewBatchesError; +export const getIsReconciliationOverviewBatchesPending = createSelector( + (state: State) => state.api, + isPending('batches.read') +); + +export const getSelectedReconciliationOverviewBatch = (state: State) => + state.dashboard.selectedReconciliationOverviewBatch; +export const getReconciliationOverviewBatchTransfers = (state: State) => + state.dashboard.reconciliationOverviewBatchTransfers; +export const getReconciliationOverviewBatchTransfersError = (state: State) => + state.dashboard.reconciliationOverviewBatchTransfersError; +export const getReconciliationOverviewBatchTransfersStatusFilter = (state: State) => + state.dashboard.reconciliationOverviewBatchTransfersStatusFilter; +export const getIsReconciliationOverviewBatchTransfersPending = createSelector( + (state: State) => state.api, + isPending('batchTransfers.read') +); +export const getReconciliationOverviewBatchStatusFilteredTransfers = createSelector( + getReconciliationOverviewBatchTransfers, + getReconciliationOverviewBatchTransfersStatusFilter, + (transfers, status) => { + if (!status) { + return transfers; + } + return transfers.filter((transfer) => transfer.status === status); + } +); + +export const getSelectedReconciliationOverviewBatchTransfer = (state: State) => + state.dashboard.selectedReconciliationOverviewBatchTransfer; +export const getReconciliationOverviewBatchTransferDetails = (state: State) => + state.dashboard.reconciliationOverviewBatchTransferDetails; +export const getReconciliationOverviewBatchTransferDetailsError = (state: State) => + state.dashboard.reconciliationOverviewBatchTransferDetailsError; +export const getIsReconciliationOverviewBatchTransferDetailsPending = createSelector( + (state: State) => state.api, + isPending('transferDetails.read') +); + +export const getWeeklyPositions = (state: State) => state.dashboard.weeklyPositions; +export const getWeeklyPositionsError = (state: State) => state.dashboard.weeklyPositionsError; +export const getIsWeeklyPositionsPending = createSelector( + (state: State) => state.api, + isPending('weeklyPositions.read') +); + +export const getWeeklyFlows = (state: State) => state.dashboard.weeklyFlows; +export const getWeeklyFlowsError = (state: State) => state.dashboard.weeklyFlowsError; +export const getIsWeeklyFlowsPending = createSelector( + (state: State) => state.api, + isPending('weeklyFlows.read') +); diff --git a/src/App/Dashboard/types.ts b/src/App/Dashboard/types.ts index 026c733..104ab54 100644 --- a/src/App/Dashboard/types.ts +++ b/src/App/Dashboard/types.ts @@ -1,235 +1,235 @@ -import { - ErrorMessage, - LinesConfig, - TransferDirection, - TransferType, - TransferStatus, -} from 'App/types'; - -export const REQUEST_DASHBOARD_PAGE_DATA = 'Dashboard / Request Page Data'; -export const REQUEST_RECONCILIATION_OVERVIEW_BATCHES = - 'Dashboard / Request Reconciliation Overview Batches'; -export const SET_RECONCILIATION_OVERVIEW_BATCHES = - 'Dashboard / Set Reconciliation Overview Batches'; -export const SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR = - 'Dashboard / Set Reconciliation Overview Batches Error'; -export const SELECT_RECONCILIATION_OVERVIEW_BATCH = - 'Dashboard / Select Reconciliation Overview Batch'; -export const HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL = - 'Dashboard / Hide Reconciliation Overview Batch Modal'; -export const REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS = - 'Dashboard / Request Reconciliation Overview Batch Transfers'; -export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS = - 'Dashboard / Set Reconciliation Overview Batch Transfers'; -export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR = - 'Dashboard / Set Reconciliation Overview Batch Transfers Error'; -export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER = - 'Dashboard / Set Reconciliation Overview Batch Transfers Status Filter'; -export const REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS = - 'Dashboard / Request Reconciliation Overview Batch Transfer Details'; -export const SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER = - 'Dashboard / Select Reconciliation Overview Batch Transfer'; -export const HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL = - 'Dashboard / Hide Reconciliation Overview Batch Transfer Details Modal'; -export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS = - 'Dashboard / Set Reconciliation Overview Batch Transfer Details'; -export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR = - 'Dashboard / Set Reconciliation Overview Batch Transfer Details Error'; -export const REQUEST_WEEKLY_POSITIONS = 'Dashboard / Request Weekly Positions'; -export const SET_WEEKLY_POSITIONS = 'Dashboard / Set Weekly Positions'; -export const SET_WEEKLY_POSITIONS_ERROR = 'Dashboard / Set Weekly Positions Error'; -export const REQUEST_WEEKLY_FLOWS = 'Dashboard / Request Weekly Flows'; -export const SET_WEEKLY_FLOWS = 'Dashboard / Set Weekly Flows'; -export const SET_WEEKLY_FLOWS_ERROR = 'Dashboard / Set Weekly Flows Error'; - -export enum BatchStatus { - Open = 'OPEN', - OnTrack = 'ON TRACK', - HasErrors = 'HAS ERRORS', - Overdue = 'OVERDUE', -} - -export interface CurrencyValue { - netValue: number; - currency: string; -} - -export interface ReconciliationOverviewBatch { - id: number; - status: BatchStatus; - transferCount: number; - transferTotals: CurrencyValue[]; - errorCount: number; - startingTimestamp: string; - closingTimestamp: string; -} - -export interface TransferDetails { - amount: string; - confirmationNumber: number; - details: string; - id: string; - recipient: string; - sender: string; - status: TransferStatus; -} - -export interface ReconciliationOverviewBatchTransfer { - id: number; - institution: string; - direction: TransferDirection; - type: TransferType; - currency: string; - value: string; - status: TransferStatus; - initiatedTimestamp: string; -} - -export interface ReconciliationOverviewBatchTransferDetails { - amount: string; - confirmationNumber: number; - details: string; - id: string; - recipient: string; - sender: string; - status: TransferStatus; -} - -export interface WeeklyPosition extends LinesConfig {} -export interface WeeklyFlow extends LinesConfig {} - -export interface DashboardState { - reconciliationOverviewBatches: ReconciliationOverviewBatch[]; - reconciliationOverviewBatchesError: ErrorMessage; - selectedReconciliationOverviewBatch?: ReconciliationOverviewBatch; - reconciliationOverviewBatchTransfers: ReconciliationOverviewBatchTransfer[]; - reconciliationOverviewBatchTransfersError: ErrorMessage; - selectedReconciliationOverviewBatchTransfer?: ReconciliationOverviewBatchTransfer; - reconciliationOverviewBatchTransferDetails?: TransferDetails; - reconciliationOverviewBatchTransferDetailsError: ErrorMessage; - reconciliationOverviewBatchTransfersStatusFilter: string | undefined; - weeklyPositions: WeeklyPosition[]; - weeklyPositionsError: ErrorMessage; - weeklyFlows: WeeklyFlow[]; - weeklyFlowsError: ErrorMessage; -} - -export interface RequestDashboardPageDataAction { - type: typeof REQUEST_DASHBOARD_PAGE_DATA; -} - -export interface RequestReconciliationOverviewBatchesAction { - type: typeof REQUEST_RECONCILIATION_OVERVIEW_BATCHES; -} - -export interface SetReconciliationOverviewBatchesAction { - type: typeof SET_RECONCILIATION_OVERVIEW_BATCHES; - data: ReconciliationOverviewBatch[]; -} - -export interface SetReconciliationOverviewBatchesErrorAction { - type: typeof SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR; - error: string; -} - -export interface SelectReconciliationOverviewBatchAction { - type: typeof SELECT_RECONCILIATION_OVERVIEW_BATCH; - item: ReconciliationOverviewBatch; -} - -export interface HideReconciliationOverviewBatchModalAction { - type: typeof HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL; -} - -export interface RequestReconciliationOverviewBatchTransfersAction { - type: typeof REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS; -} - -export interface SetReconciliationOverviewBatchTransfersAction { - type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS; - data: ReconciliationOverviewBatchTransfer[]; -} - -export interface SetReconciliationOverviewBatchTransfersErrorAction { - type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR; - error: string; -} - -export interface SelectReconciliationOverviewBatchTransferAction { - type: typeof SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER; - item: ReconciliationOverviewBatchTransfer; -} - -export interface HideReconciliationOverviewBatchTransferDetailsModalAction { - type: typeof HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL; -} - -export interface RequestReconciliationOverviewBatchTransferDetailsAction { - type: typeof REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS; -} - -export interface SetReconciliationOverviewBatchTransferDetailsAction { - type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS; - data: TransferDetails; -} - -export interface SetReconciliationOverviewBatchTransferDetailsErrorAction { - type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR; - error: string; -} - -export interface SetReconciliationOverviewBatchTransfersStatusFilterAction { - type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER; - filter: string; -} - -export interface RequestWeeklyPositionsAction { - type: typeof REQUEST_WEEKLY_POSITIONS; -} - -export interface SetWeeklyPositionsAction { - type: typeof SET_WEEKLY_POSITIONS; - data: WeeklyPosition[]; -} - -export interface SetWeeklyPositionsErrorAction { - type: typeof SET_WEEKLY_POSITIONS_ERROR; - error: string; -} - -export interface RequestWeeklyFlowsAction { - type: typeof REQUEST_WEEKLY_FLOWS; -} - -export interface SetWeeklyFlowsAction { - type: typeof SET_WEEKLY_FLOWS; - data: WeeklyFlow[]; -} - -export interface SetWeeklyFlowsErrorAction { - type: typeof SET_WEEKLY_FLOWS_ERROR; - error: string; -} - -export type DashboardActionTypes = - | RequestDashboardPageDataAction - | SetReconciliationOverviewBatchesAction - | SetReconciliationOverviewBatchesErrorAction - | RequestReconciliationOverviewBatchesAction - | SelectReconciliationOverviewBatchAction - | HideReconciliationOverviewBatchModalAction - | SetReconciliationOverviewBatchTransfersAction - | SetReconciliationOverviewBatchTransfersErrorAction - | RequestReconciliationOverviewBatchTransfersAction - | SetReconciliationOverviewBatchTransferDetailsAction - | SetReconciliationOverviewBatchTransferDetailsErrorAction - | SetReconciliationOverviewBatchTransfersStatusFilterAction - | RequestReconciliationOverviewBatchTransferDetailsAction - | SelectReconciliationOverviewBatchTransferAction - | HideReconciliationOverviewBatchTransferDetailsModalAction - | SetWeeklyPositionsAction - | SetWeeklyPositionsErrorAction - | RequestWeeklyPositionsAction - | SetWeeklyFlowsAction - | SetWeeklyFlowsErrorAction - | RequestWeeklyFlowsAction; +import { + ErrorMessage, + LinesConfig, + TransferDirection, + TransferType, + TransferStatus, +} from 'App/types'; + +export const REQUEST_DASHBOARD_PAGE_DATA = 'Dashboard / Request Page Data'; +export const REQUEST_RECONCILIATION_OVERVIEW_BATCHES = + 'Dashboard / Request Reconciliation Overview Batches'; +export const SET_RECONCILIATION_OVERVIEW_BATCHES = + 'Dashboard / Set Reconciliation Overview Batches'; +export const SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR = + 'Dashboard / Set Reconciliation Overview Batches Error'; +export const SELECT_RECONCILIATION_OVERVIEW_BATCH = + 'Dashboard / Select Reconciliation Overview Batch'; +export const HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL = + 'Dashboard / Hide Reconciliation Overview Batch Modal'; +export const REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS = + 'Dashboard / Request Reconciliation Overview Batch Transfers'; +export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS = + 'Dashboard / Set Reconciliation Overview Batch Transfers'; +export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR = + 'Dashboard / Set Reconciliation Overview Batch Transfers Error'; +export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER = + 'Dashboard / Set Reconciliation Overview Batch Transfers Status Filter'; +export const REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS = + 'Dashboard / Request Reconciliation Overview Batch Transfer Details'; +export const SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER = + 'Dashboard / Select Reconciliation Overview Batch Transfer'; +export const HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL = + 'Dashboard / Hide Reconciliation Overview Batch Transfer Details Modal'; +export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS = + 'Dashboard / Set Reconciliation Overview Batch Transfer Details'; +export const SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR = + 'Dashboard / Set Reconciliation Overview Batch Transfer Details Error'; +export const REQUEST_WEEKLY_POSITIONS = 'Dashboard / Request Weekly Positions'; +export const SET_WEEKLY_POSITIONS = 'Dashboard / Set Weekly Positions'; +export const SET_WEEKLY_POSITIONS_ERROR = 'Dashboard / Set Weekly Positions Error'; +export const REQUEST_WEEKLY_FLOWS = 'Dashboard / Request Weekly Flows'; +export const SET_WEEKLY_FLOWS = 'Dashboard / Set Weekly Flows'; +export const SET_WEEKLY_FLOWS_ERROR = 'Dashboard / Set Weekly Flows Error'; + +export enum BatchStatus { + Open = 'OPEN', + OnTrack = 'ON TRACK', + HasErrors = 'HAS ERRORS', + Overdue = 'OVERDUE', +} + +export interface CurrencyValue { + netValue: number; + currency: string; +} + +export interface ReconciliationOverviewBatch { + id: number; + status: BatchStatus; + transferCount: number; + transferTotals: CurrencyValue[]; + errorCount: number; + startingTimestamp: string; + closingTimestamp: string; +} + +export interface TransferDetails { + amount: string; + confirmationNumber: number; + details: string; + id: string; + recipient: string; + sender: string; + status: TransferStatus; +} + +export interface ReconciliationOverviewBatchTransfer { + id: number; + institution: string; + direction: TransferDirection; + type: TransferType; + currency: string; + value: string; + status: TransferStatus; + initiatedTimestamp: string; +} + +export interface ReconciliationOverviewBatchTransferDetails { + amount: string; + confirmationNumber: number; + details: string; + id: string; + recipient: string; + sender: string; + status: TransferStatus; +} + +export interface WeeklyPosition extends LinesConfig {} +export interface WeeklyFlow extends LinesConfig {} + +export interface DashboardState { + reconciliationOverviewBatches: ReconciliationOverviewBatch[]; + reconciliationOverviewBatchesError: ErrorMessage; + selectedReconciliationOverviewBatch?: ReconciliationOverviewBatch; + reconciliationOverviewBatchTransfers: ReconciliationOverviewBatchTransfer[]; + reconciliationOverviewBatchTransfersError: ErrorMessage; + selectedReconciliationOverviewBatchTransfer?: ReconciliationOverviewBatchTransfer; + reconciliationOverviewBatchTransferDetails?: TransferDetails; + reconciliationOverviewBatchTransferDetailsError: ErrorMessage; + reconciliationOverviewBatchTransfersStatusFilter: string | undefined; + weeklyPositions: WeeklyPosition[]; + weeklyPositionsError: ErrorMessage; + weeklyFlows: WeeklyFlow[]; + weeklyFlowsError: ErrorMessage; +} + +export interface RequestDashboardPageDataAction { + type: typeof REQUEST_DASHBOARD_PAGE_DATA; +} + +export interface RequestReconciliationOverviewBatchesAction { + type: typeof REQUEST_RECONCILIATION_OVERVIEW_BATCHES; +} + +export interface SetReconciliationOverviewBatchesAction { + type: typeof SET_RECONCILIATION_OVERVIEW_BATCHES; + data: ReconciliationOverviewBatch[]; +} + +export interface SetReconciliationOverviewBatchesErrorAction { + type: typeof SET_RECONCILIATION_OVERVIEW_BATCHES_ERROR; + error: string; +} + +export interface SelectReconciliationOverviewBatchAction { + type: typeof SELECT_RECONCILIATION_OVERVIEW_BATCH; + item: ReconciliationOverviewBatch; +} + +export interface HideReconciliationOverviewBatchModalAction { + type: typeof HIDE_RECONCILIATION_OVERVIEW_BATCH_MODAL; +} + +export interface RequestReconciliationOverviewBatchTransfersAction { + type: typeof REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS; +} + +export interface SetReconciliationOverviewBatchTransfersAction { + type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS; + data: ReconciliationOverviewBatchTransfer[]; +} + +export interface SetReconciliationOverviewBatchTransfersErrorAction { + type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_ERROR; + error: string; +} + +export interface SelectReconciliationOverviewBatchTransferAction { + type: typeof SELECT_RECONCILIATION_OVERVIEW_BATCH_TRANSFER; + item: ReconciliationOverviewBatchTransfer; +} + +export interface HideReconciliationOverviewBatchTransferDetailsModalAction { + type: typeof HIDE_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_MODAL; +} + +export interface RequestReconciliationOverviewBatchTransferDetailsAction { + type: typeof REQUEST_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS; +} + +export interface SetReconciliationOverviewBatchTransferDetailsAction { + type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS; + data: TransferDetails; +} + +export interface SetReconciliationOverviewBatchTransferDetailsErrorAction { + type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFER_DETAILS_ERROR; + error: string; +} + +export interface SetReconciliationOverviewBatchTransfersStatusFilterAction { + type: typeof SET_RECONCILIATION_OVERVIEW_BATCH_TRANSFERS_STATUS_FILTER; + filter: string; +} + +export interface RequestWeeklyPositionsAction { + type: typeof REQUEST_WEEKLY_POSITIONS; +} + +export interface SetWeeklyPositionsAction { + type: typeof SET_WEEKLY_POSITIONS; + data: WeeklyPosition[]; +} + +export interface SetWeeklyPositionsErrorAction { + type: typeof SET_WEEKLY_POSITIONS_ERROR; + error: string; +} + +export interface RequestWeeklyFlowsAction { + type: typeof REQUEST_WEEKLY_FLOWS; +} + +export interface SetWeeklyFlowsAction { + type: typeof SET_WEEKLY_FLOWS; + data: WeeklyFlow[]; +} + +export interface SetWeeklyFlowsErrorAction { + type: typeof SET_WEEKLY_FLOWS_ERROR; + error: string; +} + +export type DashboardActionTypes = + | RequestDashboardPageDataAction + | SetReconciliationOverviewBatchesAction + | SetReconciliationOverviewBatchesErrorAction + | RequestReconciliationOverviewBatchesAction + | SelectReconciliationOverviewBatchAction + | HideReconciliationOverviewBatchModalAction + | SetReconciliationOverviewBatchTransfersAction + | SetReconciliationOverviewBatchTransfersErrorAction + | RequestReconciliationOverviewBatchTransfersAction + | SetReconciliationOverviewBatchTransferDetailsAction + | SetReconciliationOverviewBatchTransferDetailsErrorAction + | SetReconciliationOverviewBatchTransfersStatusFilterAction + | RequestReconciliationOverviewBatchTransferDetailsAction + | SelectReconciliationOverviewBatchTransferAction + | HideReconciliationOverviewBatchTransferDetailsModalAction + | SetWeeklyPositionsAction + | SetWeeklyPositionsErrorAction + | RequestWeeklyPositionsAction + | SetWeeklyFlowsAction + | SetWeeklyFlowsErrorAction + | RequestWeeklyFlowsAction; diff --git a/src/App/ErrorModal/ErrorModal.css b/src/App/ErrorModal/ErrorModal.css index 1a3d07e..80e85bc 100644 --- a/src/App/ErrorModal/ErrorModal.css +++ b/src/App/ErrorModal/ErrorModal.css @@ -1,15 +1,15 @@ -.error-modal__content { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; -} -.error-modal__icon { - fill: #c33; - stroke: #c33; -} - -.error-modal__message { - font-size: 18px; - margin: 30px 0px 10px; -} +.error-modal__content { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +.error-modal__icon { + fill: #c33; + stroke: #c33; +} + +.error-modal__message { + font-size: 18px; + margin: 30px 0px 10px; +} diff --git a/src/App/ErrorModal/index.tsx b/src/App/ErrorModal/index.tsx index bdcdf33..1d01f83 100644 --- a/src/App/ErrorModal/index.tsx +++ b/src/App/ErrorModal/index.tsx @@ -1,24 +1,24 @@ -import React, { FC } from 'react'; -import { Icon, Modal } from 'components'; -import './ErrorModal.css'; - -interface ErrorModalProps { - isVisible: boolean; - content?: string; - onClose: () => void; -} -const ErrorModal: FC = ({ isVisible, content, onClose }) => { - if (!isVisible) { - return null; - } - return ( - -
- -

{content}

-
-
- ); -}; - -export default ErrorModal; +import React, { FC } from 'react'; +import { Icon, Modal } from 'components'; +import './ErrorModal.css'; + +interface ErrorModalProps { + isVisible: boolean; + content?: string; + onClose: () => void; +} +const ErrorModal: FC = ({ isVisible, content, onClose }) => { + if (!isVisible) { + return null; + } + return ( + +
+ +

{content}

+
+
+ ); +}; + +export default ErrorModal; diff --git a/src/App/FxpConversions/FxpConversions.css b/src/App/FxpConversions/FxpConversions.css index 595cee2..d52fac4 100644 --- a/src/App/FxpConversions/FxpConversions.css +++ b/src/App/FxpConversions/FxpConversions.css @@ -1,94 +1,94 @@ -.fxpconversions { -} - -.transfers__errors__loader, -.transfers__transfers__loader, -.transfers__statuses__loader { - height: 100px; - width: 100%; - display: flex; - justify-content: center; - flex-direction: row; -} -.transfers__errors__list, -.transfers__transfers__list, -.transfers__statuses__list { - margin: 10px; -} - -.transfers__charts__loader { -} - -.transfers__successful-perc__section, -.transfers__avg-time__section { - margin-bottom: 20px; -} - -.transfers__successful-perc__graph-loader, -.transfers__avg-time__graph-loader { - display: flex; - height: 300px; - justify-content: center; - align-items: center; -} - -.transfers__successul-perc__graph-container, -.transfers__avg-time__graph-container { - height: 300px; -} - -.transfers__statuses__status { - background: transparent; - margin: 5px; -} -.transfers__statuses__status--successful { - border-color: #8721a9; - color: #8721a9; -} -.transfers__statuses__status--pending { - border-color: #12d670; - color: #12d670; -} -.transfers__statuses__status--has-errors { - border-color: #e23a54; - color: #e23a54; -} - -.transfers__errors__section { - margin-bottom: 20px; -} - -.transfers__errors__graph-display-label { - width: 120px; - height: 100%; - align-items: center; - justify-content: center; - display: flex; - flex-direction: column; -} -.transfers__errors__graph-chart-container { - align-items: center; - justify-content: center; - display: flex; - flex-direction: column; -} -.transfers__errors__graph-legend-container { - width: 300px; - height: 180px; -} -.transfers__errors__graph-container { -} - -.transfers__errors__graph-legend { - width: 100%; - margin-top: 10px; -} - -.transfers__errors__button, -.transfers__errors__download__button { - margin: 10px; -} - -.transfers__errors__list-container { - margin: 10px; -} +.fxpconversions { +} + +.transfers__errors__loader, +.transfers__transfers__loader, +.transfers__statuses__loader { + height: 100px; + width: 100%; + display: flex; + justify-content: center; + flex-direction: row; +} +.transfers__errors__list, +.transfers__transfers__list, +.transfers__statuses__list { + margin: 10px; +} + +.transfers__charts__loader { +} + +.transfers__successful-perc__section, +.transfers__avg-time__section { + margin-bottom: 20px; +} + +.transfers__successful-perc__graph-loader, +.transfers__avg-time__graph-loader { + display: flex; + height: 300px; + justify-content: center; + align-items: center; +} + +.transfers__successul-perc__graph-container, +.transfers__avg-time__graph-container { + height: 300px; +} + +.transfers__statuses__status { + background: transparent; + margin: 5px; +} +.transfers__statuses__status--successful { + border-color: #8721a9; + color: #8721a9; +} +.transfers__statuses__status--pending { + border-color: #12d670; + color: #12d670; +} +.transfers__statuses__status--has-errors { + border-color: #e23a54; + color: #e23a54; +} + +.transfers__errors__section { + margin-bottom: 20px; +} + +.transfers__errors__graph-display-label { + width: 120px; + height: 100%; + align-items: center; + justify-content: center; + display: flex; + flex-direction: column; +} +.transfers__errors__graph-chart-container { + align-items: center; + justify-content: center; + display: flex; + flex-direction: column; +} +.transfers__errors__graph-legend-container { + width: 300px; + height: 180px; +} +.transfers__errors__graph-container { +} + +.transfers__errors__graph-legend { + width: 100%; + margin-top: 10px; +} + +.transfers__errors__button, +.transfers__errors__download__button { + margin: 10px; +} + +.transfers__errors__list-container { + margin: 10px; +} diff --git a/src/App/FxpConversions/FxpConversions.tsx b/src/App/FxpConversions/FxpConversions.tsx index 0cc5974..81be0b9 100644 --- a/src/App/FxpConversions/FxpConversions.tsx +++ b/src/App/FxpConversions/FxpConversions.tsx @@ -1,123 +1,123 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { Button, Heading, Row } from 'components'; -import { State, Dispatch } from 'store/types'; -import { loadTransfers } from './hocs'; -import * as selectors from './selectors'; -import * as actions from './actions'; -import { TransfersStatus, TransferError } from './types'; -import { XYCoordinate } from '../types'; -import FxpConversionFinderModal from './components/FxpConversionFinderModal'; -import TransferDetailsModal from './components/FxpConversionDetails'; -import TransfersErrors from './components/FxpConversionErrors'; -import TransfersErrorsChart from './components/FxpConversionErrorsChart'; -import TransfersSuccessPerc from './components/FxpConversionSuccessPerc'; -import TransfersAvgTime from './components/FxpConversionAvgTime'; -import TransfersStatuses from './components/FxpConversionStatuses'; -import './FxpConversions.css'; - -const stateProps = (state: State) => ({ - transfersErrors: selectors.getTransfersErrors(state), - transfersErrorsError: selectors.getTransfersErrorsError(state), - isTransfersErrorsViewAllActive: selectors.getIsTransfersErrorsViewAllActive(state), - isTransfersErrorsPending: selectors.getIsTransfersErrorsPending(state), - transfersStatuses: selectors.getTransfersStatuses(state), - transfersStatusesError: selectors.getTransfersStatusesError(state), - isTransfersStatusesPending: selectors.getIsTransfersStatusesPending(state), - isTransferFinderModalVisible: selectors.getIsTransferFinderModalVisible(state), - transfersSuccessPerc: selectors.getTransfersSuccessPercTransformed(state), - transfersSuccessPercError: selectors.getTransfersSuccessPercError(state), - isTransfersSuccessPercPending: selectors.getIsTransfersSuccessPercPending(state), - transfersAvgTime: selectors.getTransfersAvgTimeTransformed(state), - transfersAvgTimeError: selectors.getTransfersAvgTimeError(state), - isTransfersAvgTimePending: selectors.getIsTransfersAvgTimePending(state), - isTransferDetailsModalVisible: selectors.getIsTransferDetailsModalVisible(state), -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onViewAllReconcilationErrorsButtonClick: () => dispatch(actions.toggleTransfersErrorsViewAll()), - onTransferFinderButtonClick: () => dispatch(actions.toggleTransferFinderModal()), - onModalCloseClick: () => dispatch(actions.toggleTransferFinderModal()), - onTransferRowClick: (transferError: TransferError) => { - dispatch(actions.requestTransferDetails({ transferId: transferError.id })); - }, -}); - -type FxpTransfersProps = { - transfersErrors: TransferError[]; - transfersErrorsError: string | null; - isTransfersErrorsViewAllActive: boolean; - isTransfersErrorsPending?: boolean; - isTransferFinderModalVisible: boolean; - isTransferDetailsModalVisible: boolean; - transfersStatuses: TransfersStatus[]; - transfersStatusesError: string | null; - isTransfersStatusesPending: boolean; - transfersSuccessPerc?: XYCoordinate[]; - transfersSuccessPercError: string | null; - isTransfersSuccessPercPending: boolean; - transfersAvgTime?: XYCoordinate[]; - transfersAvgTimeError: string | null; - isTransfersAvgTimePending: boolean; - onViewAllReconcilationErrorsButtonClick: () => void; - onTransferFinderButtonClick: () => void; - onTransferRowClick: (transferError: TransferError) => void; -}; - -const FxpTransfers: FC = ({ - transfersErrors, - transfersErrorsError, - isTransfersErrorsViewAllActive, - isTransfersErrorsPending, - isTransferFinderModalVisible, - isTransferDetailsModalVisible, - transfersStatuses, - transfersStatusesError, - isTransfersStatusesPending, - transfersSuccessPerc, - transfersSuccessPercError, - isTransfersSuccessPercPending, - transfersAvgTime, - transfersAvgTimeError, - isTransfersAvgTimePending, - onViewAllReconcilationErrorsButtonClick, - onTransferFinderButtonClick, - onTransferRowClick, -}) => { - return ( -
- FXP Conversions Overview - -
- ); -}; - -export default loadTransfers(connect(stateProps, dispatchProps)(FxpTransfers)); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { Button, Heading, Row } from 'components'; +import { State, Dispatch } from 'store/types'; +import { loadTransfers } from './hocs'; +import * as selectors from './selectors'; +import * as actions from './actions'; +import { TransfersStatus, TransferError } from './types'; +import { XYCoordinate } from '../types'; +import FxpConversionFinderModal from './components/FxpConversionFinderModal'; +import TransferDetailsModal from './components/FxpConversionDetails'; +import TransfersErrors from './components/FxpConversionErrors'; +import TransfersErrorsChart from './components/FxpConversionErrorsChart'; +import TransfersSuccessPerc from './components/FxpConversionSuccessPerc'; +import TransfersAvgTime from './components/FxpConversionAvgTime'; +import TransfersStatuses from './components/FxpConversionStatuses'; +import './FxpConversions.css'; + +const stateProps = (state: State) => ({ + transfersErrors: selectors.getTransfersErrors(state), + transfersErrorsError: selectors.getTransfersErrorsError(state), + isTransfersErrorsViewAllActive: selectors.getIsTransfersErrorsViewAllActive(state), + isTransfersErrorsPending: selectors.getIsTransfersErrorsPending(state), + transfersStatuses: selectors.getTransfersStatuses(state), + transfersStatusesError: selectors.getTransfersStatusesError(state), + isTransfersStatusesPending: selectors.getIsTransfersStatusesPending(state), + isTransferFinderModalVisible: selectors.getIsTransferFinderModalVisible(state), + transfersSuccessPerc: selectors.getTransfersSuccessPercTransformed(state), + transfersSuccessPercError: selectors.getTransfersSuccessPercError(state), + isTransfersSuccessPercPending: selectors.getIsTransfersSuccessPercPending(state), + transfersAvgTime: selectors.getTransfersAvgTimeTransformed(state), + transfersAvgTimeError: selectors.getTransfersAvgTimeError(state), + isTransfersAvgTimePending: selectors.getIsTransfersAvgTimePending(state), + isTransferDetailsModalVisible: selectors.getIsTransferDetailsModalVisible(state), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onViewAllReconcilationErrorsButtonClick: () => dispatch(actions.toggleTransfersErrorsViewAll()), + onTransferFinderButtonClick: () => dispatch(actions.toggleTransferFinderModal()), + onModalCloseClick: () => dispatch(actions.toggleTransferFinderModal()), + onTransferRowClick: (transferError: TransferError) => { + dispatch(actions.requestTransferDetails({ transferId: transferError.id })); + }, +}); + +type FxpTransfersProps = { + transfersErrors: TransferError[]; + transfersErrorsError: string | null; + isTransfersErrorsViewAllActive: boolean; + isTransfersErrorsPending?: boolean; + isTransferFinderModalVisible: boolean; + isTransferDetailsModalVisible: boolean; + transfersStatuses: TransfersStatus[]; + transfersStatusesError: string | null; + isTransfersStatusesPending: boolean; + transfersSuccessPerc?: XYCoordinate[]; + transfersSuccessPercError: string | null; + isTransfersSuccessPercPending: boolean; + transfersAvgTime?: XYCoordinate[]; + transfersAvgTimeError: string | null; + isTransfersAvgTimePending: boolean; + onViewAllReconcilationErrorsButtonClick: () => void; + onTransferFinderButtonClick: () => void; + onTransferRowClick: (transferError: TransferError) => void; +}; + +const FxpTransfers: FC = ({ + transfersErrors, + transfersErrorsError, + isTransfersErrorsViewAllActive, + isTransfersErrorsPending, + isTransferFinderModalVisible, + isTransferDetailsModalVisible, + transfersStatuses, + transfersStatusesError, + isTransfersStatusesPending, + transfersSuccessPerc, + transfersSuccessPercError, + isTransfersSuccessPercPending, + transfersAvgTime, + transfersAvgTimeError, + isTransfersAvgTimePending, + onViewAllReconcilationErrorsButtonClick, + onTransferFinderButtonClick, + onTransferRowClick, +}) => { + return ( +
+ FXP Conversions Overview + +
+ ); +}; + +export default loadTransfers(connect(stateProps, dispatchProps)(FxpTransfers)); diff --git a/src/App/FxpConversions/_mockData.js b/src/App/FxpConversions/_mockData.js index 64ad3ed..40f9e76 100644 --- a/src/App/FxpConversions/_mockData.js +++ b/src/App/FxpConversions/_mockData.js @@ -1,57 +1,57 @@ -import { generatePoints, generatePercPoints } from 'utils/charts'; -import { TransferType } from 'App/types'; -import { ErrorDirection, ErrorType } from './types'; - -function timestamp() { - return new Date().toISOString(); -} - -function id() { - return Math.ceil(Math.random() * 1000); -} - -export const transfersErrors = [ - { - id: id(), - institution: 'DFSP 1', - direction: ErrorDirection.Inbound, - type: TransferType.P2P, - value: '523$', - errorType: ErrorType.FromHub, - committedDate: timestamp(), - }, - { - id: id(), - institution: 'DFSP 1', - direction: ErrorDirection.Inbound, - type: TransferType.P2P, - value: '523$', - errorType: ErrorType.FromHub, - committedDate: timestamp(), - }, - { - id: id(), - institution: 'DFSP 1', - direction: ErrorDirection.Inbound, - type: TransferType.P2P, - value: '523$', - errorType: ErrorType.FromHub, - committedDate: timestamp(), - }, - { - id: id(), - institution: 'DFSP 1', - direction: ErrorDirection.Inbound, - type: TransferType.P2P, - value: '523$', - errorType: ErrorType.FromHub, - committedDate: timestamp(), - }, -]; - -export const successfulPercs = [ - { points: generatePercPoints((24 * 60) / 2, 100, 40, 0.01), color: '#4fc7e7' }, -]; -export const avgTimes = [ - { points: generatePoints((24 * 60) / 2, [2000, 5000], 150, 300), color: '#4fc7e7' }, -]; +import { generatePoints, generatePercPoints } from 'utils/charts'; +import { TransferType } from 'App/types'; +import { ErrorDirection, ErrorType } from './types'; + +function timestamp() { + return new Date().toISOString(); +} + +function id() { + return Math.ceil(Math.random() * 1000); +} + +export const transfersErrors = [ + { + id: id(), + institution: 'DFSP 1', + direction: ErrorDirection.Inbound, + type: TransferType.P2P, + value: '523$', + errorType: ErrorType.FromHub, + committedDate: timestamp(), + }, + { + id: id(), + institution: 'DFSP 1', + direction: ErrorDirection.Inbound, + type: TransferType.P2P, + value: '523$', + errorType: ErrorType.FromHub, + committedDate: timestamp(), + }, + { + id: id(), + institution: 'DFSP 1', + direction: ErrorDirection.Inbound, + type: TransferType.P2P, + value: '523$', + errorType: ErrorType.FromHub, + committedDate: timestamp(), + }, + { + id: id(), + institution: 'DFSP 1', + direction: ErrorDirection.Inbound, + type: TransferType.P2P, + value: '523$', + errorType: ErrorType.FromHub, + committedDate: timestamp(), + }, +]; + +export const successfulPercs = [ + { points: generatePercPoints((24 * 60) / 2, 100, 40, 0.01), color: '#4fc7e7' }, +]; +export const avgTimes = [ + { points: generatePoints((24 * 60) / 2, [2000, 5000], 150, 300), color: '#4fc7e7' }, +]; diff --git a/src/App/FxpConversions/actions.ts b/src/App/FxpConversions/actions.ts index 34062f7..0dc9d51 100644 --- a/src/App/FxpConversions/actions.ts +++ b/src/App/FxpConversions/actions.ts @@ -1,369 +1,434 @@ -import { - REQUEST_TRANSFERS_PAGE_DATA, - RequestTransfersPageDataAction, - REQUEST_TRANSFERS_ERRORS, - SET_TRANSFERS_ERRORS, - SET_TRANSFERS_ERRORS_ERROR, - TOGGLE_TRANSFERS_ERRORS_VIEW_ALL, - SET_TRANSFERS_ERRORS_TYPE_FILTER, - RequestTransfersErrorsAction, - RequestFxpConversionDetailsAction, // fxp - REQUEST_FXPCONVERSION_DETAILS, - SetTransfersErrorsAction, - SetTransfersErrorsErrorAction, - ToggleTransfersErrorsViewAllAction, - SetTransfersErrorsTypeFilterAction, - TOGGLE_TRANSFER_FINDER_MODAL, - ToggleTransferFinderModalAction, - ToggleFxpConversionFinderModalAction, - SET_TRANSFER_FINDER_FILTER, - SetTransferFinderFilterAction, - REQUEST_TRANSFERS, - UNREQUEST_TRANSFERS, - SET_TRANSFERS, - SET_TRANSFERS_ERROR, - RequestTransfersAction, - UnrequestTransfersAction, - SetTransfersAction, - SetTransfersErrorAction, - REQUEST_TRANSFERS_STATUSES, - SET_TRANSFERS_STATUSES, - SET_TRANSFERS_STATUSES_ERROR, - RequestTransfersStatusesAction, - SetTransfersStatusesAction, - SetTransfersStatusesErrorAction, - REQUEST_TRANSFERS_SUCCESS_PERC, - SET_TRANSFERS_SUCCESS_PERC, - SET_TRANSFERS_SUCCESS_PERC_ERROR, - REQUEST_TRANSFERS_AVG_TIME, - SET_TRANSFERS_AVG_TIME, - SET_TRANSFERS_AVG_TIME_ERROR, - TOGGLE_FXPCONVERSION_FINDER_MODAL, - RequestTransfersSuccessPercAction, - SetTransfersSuccessPercAction, - SetTransfersSuccessPercErrorAction, - RequestTransfersAvgTimeAction, - SetTransfersAvgTimeAction, - SetTransfersAvgTimeErrorAction, - TransferError, - Transfer, - FxpConversionDetails, - TransferFilter, - TransfersStatus, - SuccessPerc, - AvgTime, - REQUEST_TRANSFER_DETAILS, - SET_FXPCONVERSION_DETAILS, - RequestTransferDetailsAction, - // SetTransferDetailsAction, - SetFxpConversionDetailsAction, - SetFxpConversionsAction, - SET_FXPCONVERSION_FINDER_FILTER, - SetFxpConversionFinderFilterAction, - SetFxpConversionDetailsErrorAction, - ToggleTransferDetailsModalAction, - TOGGLE_TRANSFER_DETAILS_MODAL, - SetTransferDetailsErrorAction, - SET_TRANSFER_DETAILS_ERROR, - REQUEST_FXPCONVERSION, - RequestFxpConversionsAction, - FxpConversionFilter, - UnrequestFxpConversionsAction, - UNREQUEST_FXPCONVERSION, - FxpConversion, - SET_FXPCONVERSIONS, -} from './types'; - -export function requestTransfersPageData(): RequestTransfersPageDataAction { - return { - type: REQUEST_TRANSFERS_PAGE_DATA, - }; -} - -export function setTransfersErrors({ data }: { data: TransferError[] }): SetTransfersErrorsAction { - return { - type: SET_TRANSFERS_ERRORS, - data, - }; -} - -export function setTransfersErrorsError({ - error, -}: { - error: string; -}): SetTransfersErrorsErrorAction { - return { - type: SET_TRANSFERS_ERRORS_ERROR, - error, - }; -} - -export function requestTransfersErrors(): RequestTransfersErrorsAction { - return { - type: REQUEST_TRANSFERS_ERRORS, - }; -} - -// eslint-disable-next-line max-len -export function toggleTransfersErrorsViewAll(): ToggleTransfersErrorsViewAllAction { - return { - type: TOGGLE_TRANSFERS_ERRORS_VIEW_ALL, - }; -} - -// eslint-disable-next-line max-len -export function setTransfersErrorsTypeFilter({ - filter, -}: { - filter: string; -}): SetTransfersErrorsTypeFilterAction { - return { - type: SET_TRANSFERS_ERRORS_TYPE_FILTER, - filter, - }; -} - -export function toggleTransferFinderModal(): ToggleTransferFinderModalAction { - return { - type: TOGGLE_TRANSFER_FINDER_MODAL, - }; -} - -export function toggleFxpConversionFinderModalAction(): ToggleFxpConversionFinderModalAction { - return { - type: TOGGLE_FXPCONVERSION_FINDER_MODAL, - }; -} - -export function setTransferFinderFilter({ - field, - value, -}: { - field: string; - value: string | number; -}): SetTransferFinderFilterAction { - return { - type: SET_TRANSFER_FINDER_FILTER, - field, - value, - }; -} - -export function setFxpConversionFinderFilter({ - field, - value, -}: { - field: string; - value: string | number; -}): SetFxpConversionFinderFilterAction { - return { - type: SET_FXPCONVERSION_FINDER_FILTER, - field, - value, - }; -} - -export function setTransfers({ data }: { data: Transfer[] }): SetTransfersAction { - return { - type: SET_TRANSFERS, - data, - }; -} - -export function setFxpConversions({ data }: { data: FxpConversion[] }): SetFxpConversionsAction { - return { - type: SET_FXPCONVERSIONS, - data, - }; -} -export function setTransfersError({ error }: { error: string }): SetTransfersErrorAction { - return { - type: SET_TRANSFERS_ERROR, - error, - }; -} - -export function requestTransfers({ filters }: { filters: TransferFilter }): RequestTransfersAction { - return { - type: REQUEST_TRANSFERS, - filters, - }; -} - -// fxp -export function requestFxpConversions({ - filters, -}: { - filters: FxpConversionFilter; -}): RequestFxpConversionsAction { - return { - type: REQUEST_FXPCONVERSION, - filters, - }; -} - -export function unrequestTransfers(): UnrequestTransfersAction { - return { - type: UNREQUEST_TRANSFERS, - }; -} - -// fxp -export function UnrequestFxpConversions(): UnrequestFxpConversionsAction { - return { - type: UNREQUEST_FXPCONVERSION, - }; -} - -export function setTransfersStatuses({ - data, -}: { - data: TransfersStatus[]; -}): SetTransfersStatusesAction { - return { - type: SET_TRANSFERS_STATUSES, - data, - }; -} - -export function setTransfersStatusesError({ - error, -}: { - error: string; -}): SetTransfersStatusesErrorAction { - return { - type: SET_TRANSFERS_STATUSES_ERROR, - error, - }; -} - -export function requestTransfersStatuses(): RequestTransfersStatusesAction { - return { - type: REQUEST_TRANSFERS_STATUSES, - }; -} - -export function requestTransferDetails({ - transferId, -}: { - transferId: string; -}): RequestTransferDetailsAction { - return { - type: REQUEST_TRANSFER_DETAILS, - transferId, - }; -} - -export function setTransferDetails({ - data, -}: { - data: FxpConversionDetails; -}): SetFxpConversionDetailsAction { - return { - type: SET_FXPCONVERSION_DETAILS, - data, - }; -} - -export function setTransferDetailsError({ - error, -}: { - error: string; -}): SetTransferDetailsErrorAction { - return { - type: SET_TRANSFER_DETAILS_ERROR, - error, - }; -} - -export function toggleTransferDetailsModal(): ToggleTransferDetailsModalAction { - return { - type: TOGGLE_TRANSFER_DETAILS_MODAL, - }; -} - -export function requestTransfersSuccessPerc(): RequestTransfersSuccessPercAction { - return { - type: REQUEST_TRANSFERS_SUCCESS_PERC, - }; -} - -export function setTransfersSuccessPerc({ - data, -}: { - data: SuccessPerc; -}): SetTransfersSuccessPercAction { - return { - type: SET_TRANSFERS_SUCCESS_PERC, - data, - }; -} - -export function setTransfersSuccessPercError({ - error, -}: { - error: string; -}): SetTransfersSuccessPercErrorAction { - return { - type: SET_TRANSFERS_SUCCESS_PERC_ERROR, - error, - }; -} - -export function requestTransfersAvgTime(): RequestTransfersAvgTimeAction { - return { - type: REQUEST_TRANSFERS_AVG_TIME, - }; -} - -export function setTransfersAvgTime({ data }: { data: AvgTime }): SetTransfersAvgTimeAction { - return { - type: SET_TRANSFERS_AVG_TIME, - data, - }; -} - -export function setTransfersAvgTimeError({ - error, -}: { - error: string; -}): SetTransfersAvgTimeErrorAction { - return { - type: SET_TRANSFERS_AVG_TIME_ERROR, - error, - }; -} - -// fxp actions -export function setFxpConversionDetails({ - data, -}: { - data: FxpConversionDetails; -}): SetFxpConversionDetailsAction { - return { - type: SET_FXPCONVERSION_DETAILS, - data, - }; -} - -export function requestFxpConversionDetails({ - conversionId, -}: { - conversionId: string; -}): RequestFxpConversionDetailsAction { - return { - type: REQUEST_FXPCONVERSION_DETAILS, - conversionId, - }; -} - -export function setFxpConversionDetailsError({ - error, -}: { - error: string; -}): SetFxpConversionDetailsErrorAction { - return { - type: SET_TRANSFER_DETAILS_ERROR, - error, - }; -} +import { + REQUEST_TRANSFERS_PAGE_DATA, + RequestTransfersPageDataAction, + REQUEST_TRANSFERS_ERRORS, + SET_TRANSFERS_ERRORS, + SET_TRANSFERS_ERRORS_ERROR, + TOGGLE_TRANSFERS_ERRORS_VIEW_ALL, + SET_TRANSFERS_ERRORS_TYPE_FILTER, + RequestTransfersErrorsAction, + RequestFxpConversionDetailsAction, // fxp + REQUEST_FXPCONVERSION_DETAILS, + SetTransfersErrorsAction, + SetTransfersErrorsErrorAction, + ToggleTransfersErrorsViewAllAction, + SetTransfersErrorsTypeFilterAction, + TOGGLE_TRANSFER_FINDER_MODAL, + ToggleTransferFinderModalAction, + ToggleFxpConversionFinderModalAction, + SET_TRANSFER_FINDER_FILTER, + SetTransferFinderFilterAction, + REQUEST_TRANSFERS, + UNREQUEST_TRANSFERS, + SET_TRANSFERS, + SET_TRANSFERS_ERROR, + RequestTransfersAction, + UnrequestTransfersAction, + SetTransfersAction, + SetTransfersErrorAction, + REQUEST_TRANSFERS_STATUSES, + SET_TRANSFERS_STATUSES, + SET_TRANSFERS_STATUSES_ERROR, + RequestTransfersStatusesAction, + SetTransfersStatusesAction, + SetTransfersStatusesErrorAction, + REQUEST_TRANSFERS_SUCCESS_PERC, + SET_TRANSFERS_SUCCESS_PERC, + SET_TRANSFERS_SUCCESS_PERC_ERROR, + REQUEST_TRANSFERS_AVG_TIME, + SET_TRANSFERS_AVG_TIME, + SET_TRANSFERS_AVG_TIME_ERROR, + TOGGLE_FXPCONVERSION_FINDER_MODAL, + RequestTransfersSuccessPercAction, + SetTransfersSuccessPercAction, + SetTransfersSuccessPercErrorAction, + RequestTransfersAvgTimeAction, + SetTransfersAvgTimeAction, + SetTransfersAvgTimeErrorAction, + TransferError, + Transfer, + FxpConversionDetails, + TransferFilter, + TransfersStatus, + SuccessPerc, + AvgTime, + REQUEST_TRANSFER_DETAILS, + SET_FXPCONVERSION_DETAILS, + RequestTransferDetailsAction, + SET_FXPCONVERSION_DETAILS_ERROR, + // SetTransferDetailsAction, + SetFxpConversionDetailsAction, + SetFxpConversionsAction, + SET_FXPCONVERSION_FINDER_FILTER, + SetFxpConversionFinderFilterAction, + SetFxpConversionDetailsErrorAction, + ToggleTransferDetailsModalAction, + TOGGLE_TRANSFER_DETAILS_MODAL, + SetTransferDetailsErrorAction, + SET_TRANSFER_DETAILS_ERROR, + REQUEST_FXPCONVERSION, + RequestFxpConversionsAction, + FxpConversionFilter, + UnrequestFxpConversionsAction, + UNREQUEST_FXPCONVERSION, + FxpConversion, + SET_FXPCONVERSIONS, + FxpConversionError, + SetFxpConversionErrorsAction, + SET_FXPCONVERSIONS_ERRORS, + SetFxpConversionsErrorsErrorAction, + SET_FXPCONVERSIONS_ERRORS_ERROR, + RequestFxpConversionsErrorsAction, + REQUEST_FXPCONVERSIONS_ERRORS, + ToggleFxpConversionsErrorsViewAllAction, + SetFxpConversionsErrorsTypeFilterAction, + TOGGLE_FXPCONVERSIONS_ERRORS_VIEW_ALL, + SET_FXPCONVERSIONS_ERRORS_TYPE_FILTER, + SetFxpConversionsErrorAction, + SET_FXPCONVERSIONS_ERROR, + +} from './types'; + +export function requestTransfersPageData(): RequestTransfersPageDataAction { + return { + type: REQUEST_TRANSFERS_PAGE_DATA, + }; +} + +export function setTransfersErrors({ data }: { data: TransferError[] }): SetTransfersErrorsAction { + return { + type: SET_TRANSFERS_ERRORS, + data, + }; +} +// setFxpConversionsErrors +export function setFxpConversionsErrors({ data }: { data: FxpConversionError[] }): SetFxpConversionErrorsAction { + return { + type: SET_FXPCONVERSIONS_ERRORS, + data, + }; +} + +export function setTransfersErrorsError({ + error, +}: { + error: string; +}): SetTransfersErrorsErrorAction { + return { + type: SET_TRANSFERS_ERRORS_ERROR, + error, + }; +} +// setFxpConversionsErrorsError +export function setFxpConversionsErrorsError({ + error, +}: { + error: string; +}): SetFxpConversionsErrorsErrorAction { + return { + type: SET_FXPCONVERSIONS_ERRORS_ERROR, + error, + }; +} + +export function requestTransfersErrors(): RequestTransfersErrorsAction { + return { + type: REQUEST_TRANSFERS_ERRORS, + }; +} + +// requestFxpConversionsErrors +export function requestFxpConversionsErrors(): RequestFxpConversionsErrorsAction { + return { + type: REQUEST_FXPCONVERSIONS_ERRORS, + }; +} + +// eslint-disable-next-line max-len +export function toggleTransfersErrorsViewAll(): ToggleTransfersErrorsViewAllAction { + return { + type: TOGGLE_TRANSFERS_ERRORS_VIEW_ALL, + }; +} + +// toggleFxpConversionsErrorsViewAll +export function toggleFxpConversionsErrorsViewAll(): ToggleFxpConversionsErrorsViewAllAction { + return { + type: TOGGLE_FXPCONVERSIONS_ERRORS_VIEW_ALL, + }; +} + +// eslint-disable-next-line max-len +export function setTransfersErrorsTypeFilter({ + filter, +}: { + filter: string; +}): SetTransfersErrorsTypeFilterAction { + return { + type: SET_TRANSFERS_ERRORS_TYPE_FILTER, + filter, + }; +} +// setFxpConversionsErrorsTypeFilter +export function setFxpConversionsErrorsTypeFilter({ + filter, +}: { + filter: string; +}): SetFxpConversionsErrorsTypeFilterAction { + return { + type: SET_FXPCONVERSIONS_ERRORS_TYPE_FILTER, + filter, + }; +} + +export function toggleTransferFinderModal(): ToggleTransferFinderModalAction { + return { + type: TOGGLE_TRANSFER_FINDER_MODAL, + }; +} + +export function toggleFxpConversionFinderModalAction(): ToggleFxpConversionFinderModalAction { + return { + type: TOGGLE_FXPCONVERSION_FINDER_MODAL, + }; +} + +export function setTransferFinderFilter({ + field, + value, +}: { + field: string; + value: string | number; +}): SetTransferFinderFilterAction { + return { + type: SET_TRANSFER_FINDER_FILTER, + field, + value, + }; +} + +export function setFxpConversionFinderFilter({ + field, + value, +}: { + field: string; + value: string | number; +}): SetFxpConversionFinderFilterAction { + return { + type: SET_FXPCONVERSION_FINDER_FILTER, + field, + value, + }; +} + +export function setTransfers({ data }: { data: Transfer[] }): SetTransfersAction { + return { + type: SET_TRANSFERS, + data, + }; +} + +export function setFxpConversions({ data }: { data: FxpConversion[] }): SetFxpConversionsAction { + return { + type: SET_FXPCONVERSIONS, + data, + }; +} +export function setTransfersError({ error }: { error: string }): SetTransfersErrorAction { + return { + type: SET_TRANSFERS_ERROR, + error, + }; +} +// setFxpConversionsError +export function setFxpConversionsError({ error }: { error: string }): SetFxpConversionsErrorAction { + return { + type: SET_FXPCONVERSIONS_ERROR, + error, + }; +} + +export function requestTransfers({ filters }: { filters: TransferFilter }): RequestTransfersAction { + return { + type: REQUEST_TRANSFERS, + filters, + }; +} + +// fxp +export function requestFxpConversions({ + filters, +}: { + filters: FxpConversionFilter; +}): RequestFxpConversionsAction { + return { + type: REQUEST_FXPCONVERSION, + filters, + }; +} + +export function unrequestTransfers(): UnrequestTransfersAction { + return { + type: UNREQUEST_TRANSFERS, + }; +} + +// fxp +export function UnrequestFxpConversions(): UnrequestFxpConversionsAction { + return { + type: UNREQUEST_FXPCONVERSION, + }; +} + +export function setTransfersStatuses({ + data, +}: { + data: TransfersStatus[]; +}): SetTransfersStatusesAction { + return { + type: SET_TRANSFERS_STATUSES, + data, + }; +} + +export function setTransfersStatusesError({ + error, +}: { + error: string; +}): SetTransfersStatusesErrorAction { + return { + type: SET_TRANSFERS_STATUSES_ERROR, + error, + }; +} + +export function requestTransfersStatuses(): RequestTransfersStatusesAction { + return { + type: REQUEST_TRANSFERS_STATUSES, + }; +} + +export function requestTransferDetails({ + transferId, +}: { + transferId: string; +}): RequestTransferDetailsAction { + return { + type: REQUEST_TRANSFER_DETAILS, + transferId, + }; +} + +export function setTransferDetails({ + data, +}: { + data: FxpConversionDetails; +}): SetFxpConversionDetailsAction { + return { + type: SET_FXPCONVERSION_DETAILS, + data, + }; +} + +export function setTransferDetailsError({ + error, +}: { + error: string; +}): SetTransferDetailsErrorAction { + return { + type: SET_TRANSFER_DETAILS_ERROR, + error, + }; +} + +export function toggleTransferDetailsModal(): ToggleTransferDetailsModalAction { + return { + type: TOGGLE_TRANSFER_DETAILS_MODAL, + }; +} + +export function requestTransfersSuccessPerc(): RequestTransfersSuccessPercAction { + return { + type: REQUEST_TRANSFERS_SUCCESS_PERC, + }; +} + +export function setTransfersSuccessPerc({ + data, +}: { + data: SuccessPerc; +}): SetTransfersSuccessPercAction { + return { + type: SET_TRANSFERS_SUCCESS_PERC, + data, + }; +} + +export function setTransfersSuccessPercError({ + error, +}: { + error: string; +}): SetTransfersSuccessPercErrorAction { + return { + type: SET_TRANSFERS_SUCCESS_PERC_ERROR, + error, + }; +} + +export function requestTransfersAvgTime(): RequestTransfersAvgTimeAction { + return { + type: REQUEST_TRANSFERS_AVG_TIME, + }; +} + +export function setTransfersAvgTime({ data }: { data: AvgTime }): SetTransfersAvgTimeAction { + return { + type: SET_TRANSFERS_AVG_TIME, + data, + }; +} + +export function setTransfersAvgTimeError({ + error, +}: { + error: string; +}): SetTransfersAvgTimeErrorAction { + return { + type: SET_TRANSFERS_AVG_TIME_ERROR, + error, + }; +} + +// fxp actions +export function setFxpConversionDetails({ + data, +}: { + data: FxpConversionDetails; +}): SetFxpConversionDetailsAction { + return { + type: SET_FXPCONVERSION_DETAILS, + data, + }; +} + +export function requestFxpConversionDetails({ + conversionId, +}: { + conversionId: string; +}): RequestFxpConversionDetailsAction { + return { + type: REQUEST_FXPCONVERSION_DETAILS, + conversionId, + }; +} + +export function setFxpConversionDetailsError({ + error, +}: { + error: string; +}): SetFxpConversionDetailsErrorAction { + return { + type: SET_FXPCONVERSION_DETAILS_ERROR, + error, + }; +} diff --git a/src/App/FxpConversions/components/FxpConversionAvgTime/index.tsx b/src/App/FxpConversions/components/FxpConversionAvgTime/index.tsx index 3d71999..3ddb32b 100644 --- a/src/App/FxpConversions/components/FxpConversionAvgTime/index.tsx +++ b/src/App/FxpConversions/components/FxpConversionAvgTime/index.tsx @@ -1,82 +1,82 @@ -import React, { FC } from 'react'; -import { ChartLayout, ErrorBox, Spinner } from 'components'; -import { ErrorMessage, XYCoordinate } from 'App/types'; -import Chart from 'react-apexcharts'; - -interface TransfersChartsProps { - isPending: boolean | undefined; - data?: XYCoordinate[]; - error: ErrorMessage; -} - -const TransfersCharts: FC = ({ isPending, data, error }) => { - let content = null; - if (isPending || !data) { - content = ( -
- -
- ); - } else if (error) { - content = Transfers average time: Unable to load data; - } else { - content = ( - } - /> - ); - } - return
{content}
; -}; - -interface AverageTransferTimeGraphProps { - data: XYCoordinate[]; -} - -const AverageTransferTimeGraph: FC = ({ data }) => { - const series = { - name: 'Average Response Time', - data, - }; - - const opts = { - chart: { - id: 'transfer-avg-time-chart', - }, - xaxis: { - type: 'datetime', - }, - yaxis: { - labels: { - formatter: (val: string | number) => { - return `${Number(val).toFixed(0)}`; - }, - }, - }, - grid: { - xaxis: { lines: { show: false } }, - yaxis: { lines: { show: true } }, - strokeDashArray: 2, - strokeWidth: 2, - strokeLineCap: 'round', - }, - stroke: { - width: [2], - curve: 'smooth', - }, - colors: ['#4fc7e7'], - tooltip: { - x: { - formatter: (val: string | number) => { - return new Date(val).toISOString(); - }, - }, - }, - }; - - return ; -}; - -export default TransfersCharts; +import React, { FC } from 'react'; +import { ChartLayout, ErrorBox, Spinner } from 'components'; +import { ErrorMessage, XYCoordinate } from 'App/types'; +import Chart from 'react-apexcharts'; + +interface TransfersChartsProps { + isPending: boolean | undefined; + data?: XYCoordinate[]; + error: ErrorMessage; +} + +const TransfersCharts: FC = ({ isPending, data, error }) => { + let content = null; + if (isPending || !data) { + content = ( +
+ +
+ ); + } else if (error) { + content = Transfers average time: Unable to load data; + } else { + content = ( + } + /> + ); + } + return
{content}
; +}; + +interface AverageTransferTimeGraphProps { + data: XYCoordinate[]; +} + +const AverageTransferTimeGraph: FC = ({ data }) => { + const series = { + name: 'Average Response Time', + data, + }; + + const opts = { + chart: { + id: 'transfer-avg-time-chart', + }, + xaxis: { + type: 'datetime', + }, + yaxis: { + labels: { + formatter: (val: string | number) => { + return `${Number(val).toFixed(0)}`; + }, + }, + }, + grid: { + xaxis: { lines: { show: false } }, + yaxis: { lines: { show: true } }, + strokeDashArray: 2, + strokeWidth: 2, + strokeLineCap: 'round', + }, + stroke: { + width: [2], + curve: 'smooth', + }, + colors: ['#4fc7e7'], + tooltip: { + x: { + formatter: (val: string | number) => { + return new Date(val).toISOString(); + }, + }, + }, + }; + + return ; +}; + +export default TransfersCharts; diff --git a/src/App/FxpConversions/components/FxpConversionDetails/ExtensionListModal.tsx b/src/App/FxpConversions/components/FxpConversionDetails/ExtensionListModal.tsx index 2a3ae7f..207087a 100644 --- a/src/App/FxpConversions/components/FxpConversionDetails/ExtensionListModal.tsx +++ b/src/App/FxpConversions/components/FxpConversionDetails/ExtensionListModal.tsx @@ -1,36 +1,36 @@ -import React, { FC } from 'react'; -import { Modal, ErrorBox, DataList } from 'components'; -import { ExtensionListItem } from '../../types'; - -interface ExtensionListModalProps { - model: ExtensionListItem[]; - title: string; - onCloseClick: () => void; -} - -const columns = [ - { - label: 'Key', - key: 'key', - }, - { - label: 'Value', - key: 'value', - }, -]; - -export const ExtensionListModal: FC = ({ model, title, onCloseClick }) => { - let content = null; - - if (!model) { - content = Extension List: Unable to load extension list; - } else { - content = ; - } - - return ( - - {content} - - ); -}; +import React, { FC } from 'react'; +import { Modal, ErrorBox, DataList } from 'components'; +import { ExtensionListItem } from '../../types'; + +interface ExtensionListModalProps { + model: ExtensionListItem[]; + title: string; + onCloseClick: () => void; +} + +const columns = [ + { + label: 'Key', + key: 'key', + }, + { + label: 'Value', + key: 'value', + }, +]; + +export const ExtensionListModal: FC = ({ model, title, onCloseClick }) => { + let content = null; + + if (!model) { + content = Extension List: Unable to load extension list; + } else { + content = ; + } + + return ( + + {content} + + ); +}; diff --git a/src/App/FxpConversions/components/FxpConversionDetails/PartyDetailsModal.tsx b/src/App/FxpConversions/components/FxpConversionDetails/PartyDetailsModal.tsx index 7089036..0fbe131 100644 --- a/src/App/FxpConversions/components/FxpConversionDetails/PartyDetailsModal.tsx +++ b/src/App/FxpConversions/components/FxpConversionDetails/PartyDetailsModal.tsx @@ -1,118 +1,118 @@ -import React, { FC, useState } from 'react'; -import { Modal, FormInput, ErrorBox, Row, Button } from 'components'; -import { TransferParty } from '../../types'; -import { ExtensionListModal } from './ExtensionListModal'; - -interface TransferPartyDetailModalProps { - model: TransferParty | null; - title: string; - onCloseClick: () => void; -} - -export const TransferPartyDetailsModal: FC = ({ - model, - title, - onCloseClick, -}) => { - let content = null; - - const [isExtensionListVisible, setIsExtensionListVisible] = useState(false); - - const showExtensionList = () => { - setIsExtensionListVisible(!isExtensionListVisible); - }; - - if (!model) { - content = Transfer: Unable to load transfer details; - } else { - content = ( -
- -
- -
-
- -
-
- - -
- -
-
-
- - -
- -
-
- -
-
- -
-
- -
- -
-
- -
-
- -
-
- - -
-
-
-
- - - {isExtensionListVisible && model.extensionList && ( - setIsExtensionListVisible(false)} - /> - )} -
- ); - } - - return ( - - {content} - - ); -}; +import React, { FC, useState } from 'react'; +import { Modal, FormInput, ErrorBox, Row, Button } from 'components'; +import { TransferParty } from '../../types'; +import { ExtensionListModal } from './ExtensionListModal'; + +interface TransferPartyDetailModalProps { + model: TransferParty | null; + title: string; + onCloseClick: () => void; +} + +export const TransferPartyDetailsModal: FC = ({ + model, + title, + onCloseClick, +}) => { + let content = null; + + const [isExtensionListVisible, setIsExtensionListVisible] = useState(false); + + const showExtensionList = () => { + setIsExtensionListVisible(!isExtensionListVisible); + }; + + if (!model) { + content = Transfer: Unable to load transfer details; + } else { + content = ( +
+ +
+ +
+
+ +
+
+ + +
+ +
+
+
+ + +
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+
+ + + {isExtensionListVisible && model.extensionList && ( + setIsExtensionListVisible(false)} + /> + )} +
+ ); + } + + return ( + + {content} + + ); +}; diff --git a/src/App/FxpConversions/components/FxpConversionDetails/RequestDetailModal.tsx b/src/App/FxpConversions/components/FxpConversionDetails/RequestDetailModal.tsx index 3bb5e79..8ea3add 100644 --- a/src/App/FxpConversions/components/FxpConversionDetails/RequestDetailModal.tsx +++ b/src/App/FxpConversions/components/FxpConversionDetails/RequestDetailModal.tsx @@ -1,29 +1,29 @@ -import React, { FC } from 'react'; -import { ContentReader, Modal } from 'components'; - -interface TransferRequestDetailModalProps { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - model: any | null; - title: string; - onCloseClick: () => void; -} - -export const TransferRequestDetailsModal: FC = ({ - model, - title, - onCloseClick, -}) => { - return ( - -
- -
-
- ); -}; +import React, { FC } from 'react'; +import { ContentReader, Modal } from 'components'; + +interface TransferRequestDetailModalProps { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + model: any | null; + title: string; + onCloseClick: () => void; +} + +export const TransferRequestDetailsModal: FC = ({ + model, + title, + onCloseClick, +}) => { + return ( + +
+ +
+
+ ); +}; diff --git a/src/App/FxpConversions/components/FxpConversionDetails/index.tsx b/src/App/FxpConversions/components/FxpConversionDetails/index.tsx index 6be3cea..62b6a4e 100644 --- a/src/App/FxpConversions/components/FxpConversionDetails/index.tsx +++ b/src/App/FxpConversions/components/FxpConversionDetails/index.tsx @@ -1,697 +1,706 @@ -/* eslint-disable react/jsx-curly-newline */ -/* eslint-disable jsx-a11y/label-has-associated-control */ -import React, { FC, useState } from 'react'; -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { - Button, - ErrorBox, - Modal, - FormInput, - TextField, - Row, - Spinner, - Tabs, - Tab, - TabList, - TabPanels, - TabPanel, -} from 'components'; -import { TransferRequestDetailsModal } from './RequestDetailModal'; -import { TransferPartyDetailsModal } from './PartyDetailsModal'; -import * as actions from '../../actions'; -import * as selectors from '../../selectors'; -import { FxpConversionDetails } from '../../types'; - -const stateProps = (state: State) => ({ - model: selectors.getFxpConversionDetails(state), - transferDetailsError: selectors.getTransferDetailsError(state), - isTransferDetailsPending: selectors.getIsTransferDetailsPending(state), -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onModalCloseClick: () => dispatch(actions.toggleTransferDetailsModal()), -}); - -interface FxpConversionDetailsModalProps { - model?: FxpConversionDetails; - transferDetailsError: string | null; - isTransferDetailsPending: boolean; - onModalCloseClick: () => void; -} - -const FxpConversionDetailsModal: FC = ({ - model, - transferDetailsError, - isTransferDetailsPending, - onModalCloseClick, -}) => { - let content = null; - - if (transferDetailsError || !model) { - content = Transfer: Unable to load transfer details; - } else if (isTransferDetailsPending) { - content = ( -
- -
- ); - } else if (model) { - content = ( -
- -
- ); - } - - return ( - - {content} - - ); -}; - -interface FxpConversionDetailsProps { - model: FxpConversionDetails; -} - -const TransferDetailsView: FC = ({ model }) => { - const [isRequestDetailsVisible, setIsRequestDetailsVisible] = useState(false); - const [requestModel, setRequestModel] = useState(null); - const [requestModalTitle, setRequestModalTitle] = useState(''); - - const [isRequestPartyDetailsVisible, setIsRequestPartyDetailsVisible] = useState(false); - const [partyModel, setPartyModel] = useState(null); - const [partyModalTitle, setPartyModalTitle] = useState(''); - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showPayeeParty = (aModel: any) => { - setPartyModel(aModel); - setPartyModalTitle('Payee Party'); - setIsRequestPartyDetailsVisible(!isRequestPartyDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showPayerParty = (aModel: any) => { - setPartyModel(aModel); - setPartyModalTitle('Payer Party'); - setIsRequestPartyDetailsVisible(!isRequestPartyDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showPartyLookupResponse = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Party Lookup Response'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showQuoteRequest = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Quote Request'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showQuoteResponse = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Quote Response'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showTransferPrepare = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Transfer Prepare'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showTransferFulfil = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Transfer Fulfil'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showTransferError = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Transfer Error'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showFxQuoteRequest = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Fx Quote Request'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showFxQuoteResponse = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Fx Quote Response'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showFxTransferPrepare = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Fx Transfer Prepare'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showFxTransferFulfil = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Fx Transfer Fulfil'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const showConversionError = (aModel: any) => { - setRequestModel(aModel); - setRequestModalTitle('Conversion Error'); - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }; - - // let conversionStateInput = ( - // - // ); - - // if (model.FxpTechnicalDetails.lastError) { - // conversionStateInput = ( - //
- //
- // {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - // - // showTransferError(model.FxpTechnicalDetails.lastError)} - // buttonText="View Error" - // buttonKind="secondary" - // /> - //
- //
- // ); - // } - - let conversionStateInput = ( - - ); - - if (model.FxpTechnicalDetails.lastError) { - conversionStateInput = ( -
-
- - showConversionError(model.FxpTechnicalDetails.lastError)} - buttonText="View Error" - buttonKind="secondary" - /> -
-
- ); - } - - return ( -
- - - Conversion Details - Conversion Terms - Technical Details - - - - -
- -
-
- -
-
- -
-
- - -
- -
-
- -
-
- -
- -
-
- -
-
- -
-
- -
-
- -
- -
-
- -
-
- -
-
-
- - -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
- - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - - - - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - -
- -
-
- -
-
- - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - -
- -
-
- -
-
- - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - -
- -
-
- -
-
- - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - -
- -
-
- - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - -
- -
-
-
-
-
- - -
- - - - - - - -
- -
- - {/* Conversion State */} - - {conversionStateInput} - -
-
- - {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} - - - - -
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
-
-
- {isRequestDetailsVisible && ( - { - setIsRequestDetailsVisible(!isRequestDetailsVisible); - }} - /> - )} - {isRequestPartyDetailsVisible && ( - { - setIsRequestPartyDetailsVisible(!isRequestPartyDetailsVisible); - }} - /> - )} -
- ); -}; - -export default connect(stateProps, dispatchProps)(FxpConversionDetailsModal); +/* eslint-disable react/jsx-curly-newline */ +/* eslint-disable jsx-a11y/label-has-associated-control */ +import React, { FC, useState } from 'react'; +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { + Button, + ErrorBox, + Modal, + FormInput, + TextField, + Row, + Spinner, + Tabs, + Tab, + TabList, + TabPanels, + TabPanel, +} from 'components'; +import { TransferRequestDetailsModal } from './RequestDetailModal'; +import { TransferPartyDetailsModal } from './PartyDetailsModal'; +import * as actions from '../../actions'; +import * as selectors from '../../selectors'; +import { FxpConversionDetails } from '../../types'; + +const stateProps = (state: State) => ({ + model: selectors.getFxpConversionDetails(state), + transferDetailsError: selectors.getTransferDetailsError(state), + isTransferDetailsPending: selectors.getIsTransferDetailsPending(state), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onModalCloseClick: () => dispatch(actions.toggleTransferDetailsModal()), +}); + +interface FxpConversionDetailsModalProps { + model?: FxpConversionDetails; + transferDetailsError: string | null; + isTransferDetailsPending: boolean; + onModalCloseClick: () => void; +} + +const FxpConversionDetailsModal: FC = ({ + model, + transferDetailsError, + isTransferDetailsPending, + onModalCloseClick, +}) => { + let content = null; + + if (transferDetailsError || !model) { + content = Transfer: Unable to load transfer details; + } else if (isTransferDetailsPending) { + content = ( +
+ +
+ ); + } else if (model) { + content = ( +
+ +
+ ); + } + + return ( + + {content} + + ); +}; + +interface FxpConversionDetailsProps { + model: FxpConversionDetails; +} + +const TransferDetailsView: FC = ({ model }) => { + const [isRequestDetailsVisible, setIsRequestDetailsVisible] = useState(false); + const [requestModel, setRequestModel] = useState(null); + const [requestModalTitle, setRequestModalTitle] = useState(''); + + const [isRequestPartyDetailsVisible, setIsRequestPartyDetailsVisible] = useState(false); + const [partyModel, setPartyModel] = useState(null); + const [partyModalTitle, setPartyModalTitle] = useState(''); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showPayeeParty = (aModel: any) => { + setPartyModel(aModel); + setPartyModalTitle('Payee Party'); + setIsRequestPartyDetailsVisible(!isRequestPartyDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showPayerParty = (aModel: any) => { + setPartyModel(aModel); + setPartyModalTitle('Payer Party'); + setIsRequestPartyDetailsVisible(!isRequestPartyDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showPartyLookupResponse = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Party Lookup Response'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showQuoteRequest = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Quote Request'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showQuoteResponse = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Quote Response'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showTransferPrepare = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Transfer Prepare'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showTransferFulfil = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Transfer Fulfil'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showTransferError = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Transfer Error'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxQuoteRequest = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Quote Request'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxQuoteResponse = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Quote Response'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxTransferPrepare = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Transfer Prepare'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showFxTransferFulfil = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Fx Transfer Fulfil'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const showConversionError = (aModel: any) => { + setRequestModel(aModel); + setRequestModalTitle('Conversion Error'); + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }; + + // let conversionStateInput = ( + // + // ); + + // if (model.FxpTechnicalDetails.lastError) { + // conversionStateInput = ( + //
+ //
+ // {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + // + // showTransferError(model.FxpTechnicalDetails.lastError)} + // buttonText="View Error" + // buttonKind="secondary" + // /> + //
+ //
+ // ); + // } + + // let conversionStateInput = ( + // + // ); + + // if (model.FxpTechnicalDetails.lastError) { + // conversionStateInput = ( + //
+ //
+ // + // showConversionError(model.FxpTechnicalDetails.lastError)} + // buttonText="View Error" + // buttonKind="secondary" + // /> + //
+ //
+ // ); + // } + + return ( +
+ + + Conversion Details + Conversion Terms + Technical Details + + + + +
+ +
+
+ +
+
+ +
+
+ + +
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+
+ + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + + + + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + +
+ +
+
+
+
+
+ + +
+ + + + + + + +
+ +
+ + {/* Conversion State */} + + {/* {conversionStateInput} */} + +
+
+ + {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} + + + + +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+ {isRequestDetailsVisible && ( + { + setIsRequestDetailsVisible(!isRequestDetailsVisible); + }} + /> + )} + {isRequestPartyDetailsVisible && ( + { + setIsRequestPartyDetailsVisible(!isRequestPartyDetailsVisible); + }} + /> + )} +
+ ); +}; + +export default connect(stateProps, dispatchProps)(FxpConversionDetailsModal); diff --git a/src/App/FxpConversions/components/FxpConversionErrors/TransfersErrorsModal.tsx b/src/App/FxpConversions/components/FxpConversionErrors/TransfersErrorsModal.tsx index c4a3797..4f93565 100644 --- a/src/App/FxpConversions/components/FxpConversionErrors/TransfersErrorsModal.tsx +++ b/src/App/FxpConversions/components/FxpConversionErrors/TransfersErrorsModal.tsx @@ -1,94 +1,94 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { DataList, Modal, Spinner, Link } from 'components'; -import * as actions from '../../actions'; -import * as selectors from '../../selectors'; -import { TransferError } from '../../types'; -import * as helpers from '../../helpers'; - -const stateProps = (state: State) => ({ - transfersErrors: selectors.getFilteredByStatusTransfersErrors(state), - transfersErrorsError: selectors.getTransfersErrorsError(state), - isTransfersErrorsViewAllActive: selectors.getIsTransfersErrorsViewAllActive(state), - isTransfersErrorsPending: selectors.getIsTransfersErrorsPending(state), -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onModalCloseClick: () => dispatch(actions.toggleTransfersErrorsViewAll()), - onTransferRowClick: (transferError: TransferError) => { - dispatch(actions.requestTransferDetails({ transferId: transferError.id })); - }, -}); - -const transfersErrorsColumns = [ - { - label: 'Transfer ID', - key: 'id', - func: (value: string, item: TransferError) => ( - - {item.id} - - ), - }, - { label: 'Direction', key: 'direction', func: helpers.toSpacedPascalCase }, - { label: 'Type', key: 'type', className: 'col-100' }, - { - label: 'Send Value', - key: 'amount', - }, - { - label: 'Send Currency', - key: 'currency', - }, - { - label: 'Receive Value', - key: 'receiveAmount', - }, - { - label: 'Receive Currency', - key: 'receiveCurrency', - }, - { label: 'Error Type', key: 'errorType', func: helpers.toSpacedPascalCase }, - { - label: 'Date', - key: 'initiatedTimestamp', - func: helpers.toTransfersDate, - }, -]; - -interface TransfersErrorsModalProps { - transfersErrors: TransferError[]; - transfersErrorsError: string | null; - isTransfersErrorsViewAllActive: boolean; - isTransfersErrorsPending?: boolean; - onModalCloseClick: () => void; - onTransferRowClick: (transferError: TransferError) => void; -} - -const TransfersErrorsModal: FC = ({ - transfersErrors, - transfersErrorsError, - isTransfersErrorsViewAllActive, - isTransfersErrorsPending, - onModalCloseClick, - onTransferRowClick, -}) => ( - - {isTransfersErrorsPending ? ( -
- -
- ) : ( -
- -
- )} -
-); - -export default connect(stateProps, dispatchProps)(TransfersErrorsModal); +import React, { FC } from 'react'; +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { DataList, Modal, Spinner, Link } from 'components'; +import * as actions from '../../actions'; +import * as selectors from '../../selectors'; +import { TransferError } from '../../types'; +import * as helpers from '../../helpers'; + +const stateProps = (state: State) => ({ + transfersErrors: selectors.getFilteredByStatusTransfersErrors(state), + transfersErrorsError: selectors.getTransfersErrorsError(state), + isTransfersErrorsViewAllActive: selectors.getIsTransfersErrorsViewAllActive(state), + isTransfersErrorsPending: selectors.getIsTransfersErrorsPending(state), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onModalCloseClick: () => dispatch(actions.toggleTransfersErrorsViewAll()), + onTransferRowClick: (transferError: TransferError) => { + dispatch(actions.requestTransferDetails({ transferId: transferError.id })); + }, +}); + +const transfersErrorsColumns = [ + { + label: 'Conversion ID', + key: 'id', + func: (value: string, item: TransferError) => ( + + {item.id} + + ), + }, + { label: 'Direction', key: 'direction', func: helpers.toSpacedPascalCase }, + { label: 'Type', key: 'type', className: 'col-100' }, + { + label: 'Send Value', + key: 'amount', + }, + { + label: 'Send Currency', + key: 'currency', + }, + { + label: 'Receive Value', + key: 'receiveAmount', + }, + { + label: 'Receive Currency', + key: 'receiveCurrency', + }, + { label: 'Error Type', key: 'errorType', func: helpers.toSpacedPascalCase }, + { + label: 'Date', + key: 'initiatedTimestamp', + func: helpers.toTransfersDate, + }, +]; + +interface TransfersErrorsModalProps { + transfersErrors: TransferError[]; + transfersErrorsError: string | null; + isTransfersErrorsViewAllActive: boolean; + isTransfersErrorsPending?: boolean; + onModalCloseClick: () => void; + onTransferRowClick: (transferError: TransferError) => void; +} + +const TransfersErrorsModal: FC = ({ + transfersErrors, + transfersErrorsError, + isTransfersErrorsViewAllActive, + isTransfersErrorsPending, + onModalCloseClick, + onTransferRowClick, +}) => ( + + {isTransfersErrorsPending ? ( +
+ +
+ ) : ( +
+ +
+ )} +
+); + +export default connect(stateProps, dispatchProps)(TransfersErrorsModal); diff --git a/src/App/FxpConversions/components/FxpConversionErrors/index.tsx b/src/App/FxpConversions/components/FxpConversionErrors/index.tsx index 7b0c9b5..88bf2e0 100644 --- a/src/App/FxpConversions/components/FxpConversionErrors/index.tsx +++ b/src/App/FxpConversions/components/FxpConversionErrors/index.tsx @@ -1,127 +1,127 @@ -import React, { FC } from 'react'; -import { Button, DataList, ErrorBox, Spinner, Link } from 'components'; -import { getCurrencySymbol } from 'utils/currencies'; -import { ErrorMessage } from 'App/types'; -import xlsx from 'xlsx'; -import { FxpConversionDetails, TransferError } from '../../types'; -import * as helpers from '../../helpers'; -import TransfersErrorsModal from './TransfersErrorsModal'; - -const transfersErrorsColumns = [ - { - label: 'Transfer ID', - key: 'id', - func: (value: string, item: TransferError) => ( - - {item.id} - - ), - }, - { label: 'Direction', key: 'direction', func: helpers.toSpacedPascalCase }, - { label: 'Type', key: 'type' }, - { - label: 'Send Value', - key: 'amount', - }, - { - label: 'Send Currency', - key: 'currency', - }, - { - label: 'Receive Value', - key: 'amount', - }, - { - label: 'Receive Currency', - key: 'currency', - }, - { label: 'Error Type', key: 'errorType', func: helpers.toSpacedPascalCase }, - { - label: 'Date', - key: 'initiatedTimestamp', - func: helpers.toTransfersDate, - }, -]; - -interface TransfersErrorsProps { - isPending: boolean | undefined; - items: TransferError[]; - isViewAllActive: boolean; - error: ErrorMessage; - onViewAllClick: () => void; - onTransferRowClick: (transferError: TransferError) => void; -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -async function downloadErrorsToExcel(errors: any): Promise { - const ws = xlsx.utils.json_to_sheet(errors); - const wscols = [{ wch: 20 }]; - ws['!cols'] = wscols; - const wb = xlsx.utils.book_new(); - xlsx.utils.book_append_sheet(wb, ws, 'Errors'); - const fileName: string = `Payment_Manager_Errors_${new Date().toDateString()}.xlsx`; - xlsx.writeFile(wb, fileName); -} - -const TransfersErrors: FC = ({ - isPending, - items, - error, - onViewAllClick, - isViewAllActive, - onTransferRowClick, -}) => { - let content = null; - if (isPending) { - content = ( -
- -
- ); - } else if (error) { - content = Transfers errors: Unable to load data; - } else { - content = ( - <> - - {items.length > 0 && ( -
- ); - onSubmit = () => { - console.log('Returning to filtering'); // Debugging log - onTransfersSubmitClick(); - }; - submitLabel = 'Back to filtering'; - } - - console.log('submitLabel:', submitLabel); // Debugging log - - return ( - - {content} - - ); -}; - -const dateRanges = [ - { label: 'Custom', value: 'CUSTOM' }, - { label: helpers.toSpacedPascalCase(DateRange.Today), value: DateRange.Today }, - { label: helpers.toSpacedPascalCase(DateRange.Past48Hours), value: DateRange.Past48Hours }, - { label: helpers.toSpacedPascalCase(DateRange.OneWeek), value: DateRange.OneWeek }, - { label: helpers.toSpacedPascalCase(DateRange.OneMonth), value: DateRange.OneMonth }, -]; - -const transferStatuses = [ - { label: helpers.toSpacedPascalCase(TransferStatus.Success), value: TransferStatus.Success }, - { label: helpers.toSpacedPascalCase(TransferStatus.Pending), value: TransferStatus.Pending }, - { label: helpers.toSpacedPascalCase(TransferStatus.Error), value: TransferStatus.Error }, -]; - -const aliasType = [ - { label: 'All', value: null }, - { label: helpers.toSpacedPascalCase(AliasType.MSISDN), value: AliasType.MSISDN }, - { label: helpers.toSpacedPascalCase(AliasType.Account), value: AliasType.Account }, - { label: helpers.toSpacedPascalCase(AliasType.Email), value: AliasType.Email }, - { label: helpers.toSpacedPascalCase(AliasType.Personal), value: AliasType.Personal }, - { label: helpers.toSpacedPascalCase(AliasType.Business), value: AliasType.Business }, - { label: helpers.toSpacedPascalCase(AliasType.Device), value: AliasType.Device }, - { label: helpers.toSpacedPascalCase(AliasType.IBAN), value: AliasType.IBAN }, - { label: helpers.toSpacedPascalCase(AliasType.Alias), value: AliasType.Alias }, -]; - -const transferDirectionOfFunds = [ - { - label: helpers.toSpacedPascalCase(TransferDirection.Inbound), - value: TransferDirection.Inbound, - }, - { - label: helpers.toSpacedPascalCase(TransferDirection.Outbound), - value: TransferDirection.Outbound, - }, - { - label: helpers.toSpacedPascalCase(TransferDirection.All), - value: TransferDirection.All, - }, -]; - -interface FxpConversionFiltersProps { - model: FxpConversionFilter; - onFilterChange: ({ field, value }: { field: string; value: FilterChangeValue }) => void; -} - -const FxpConversionFilters: FC = ({ model, onFilterChange }) => ( - - - Basic Find a Conversion - Advanced Filtering - - - - Find an exact Conversion by entering the ID: -
-
- onFilterChange({ field: 'conversionId', value })} - /> -
- - Filter Conversions: -
-
- - - Approximate time of Conversion - - - onFilterChange({ field: 'dates', value })} + /> + + + onFilterChange({ field: 'from', value })} + format="x" + /> + + + onFilterChange({ field: 'to', value })} + format="x" + /> + + + + + onFilterChange({ field: 'direction', value })} + /> + + +
+ + + onFilterChange({ field: 'aliasType', value })} + /> + + + { + onFilterChange({ field: 'payeeAlias', value }); + }} + /> + + + { + onFilterChange({ field: 'aliasSubValue', value }); + }} + /> + + +   + + + {/* + + onFilterChange({ field: 'aliasType', value })} + /> + + + onFilterChange({ field: 'payeeAlias', value })} + /> + + + onFilterChange({ field: 'aliasSubValue', value })} + /> + + */} +
+ onFilterChange({ field: 'institution', value })} + /> + onFilterChange({ field: 'status', value })} + /> +
+
+
+); + +export default connect(stateProps, dispatchProps)(FxpConversionFinderModal); diff --git a/src/App/FxpConversions/components/FxpConversionStatuses/index.tsx b/src/App/FxpConversions/components/FxpConversionStatuses/index.tsx index bfb12af..826f706 100644 --- a/src/App/FxpConversions/components/FxpConversionStatuses/index.tsx +++ b/src/App/FxpConversions/components/FxpConversionStatuses/index.tsx @@ -1,70 +1,70 @@ -import React, { FC } from 'react'; -import { AnimateFadeIn, Column, DataLabel, ErrorBox, Pill, Row, Spinner } from 'components'; -import { ErrorMessage, TransferStatus } from 'App/types'; -import { TransfersStatus } from '../../types'; - -function getCount(items: TransfersStatus[], status: TransferStatus): number | undefined { - const transfersStatus = items.find((item) => item.status === status); - return transfersStatus?.count; -} - -interface TransfersStatusesProps { - isPending: boolean; - items: TransfersStatus[]; - error: ErrorMessage; -} -const TransfersStatusesItems: FC = ({ isPending, items, error }) => { - let content = null; - if (isPending) { - content = ( -
- -
- ); - } else if (error) { - content = Transfers Status: Unable to load data; - } else { - const success = getCount(items, TransferStatus.Success); - const pending = getCount(items, TransferStatus.Pending); - const failed = getCount(items, TransferStatus.Error); - - content = ( - - - - - - - - - - - - ); - } - - return ( -
- Total Transfer Statuses -
- {content} -
- ); -}; - -export default TransfersStatusesItems; +import React, { FC } from 'react'; +import { AnimateFadeIn, Column, DataLabel, ErrorBox, Pill, Row, Spinner } from 'components'; +import { ErrorMessage, TransferStatus } from 'App/types'; +import { TransfersStatus } from '../../types'; + +function getCount(items: TransfersStatus[], status: TransferStatus): number | undefined { + const transfersStatus = items.find((item) => item.status === status); + return transfersStatus?.count; +} + +interface TransfersStatusesProps { + isPending: boolean; + items: TransfersStatus[]; + error: ErrorMessage; +} +const TransfersStatusesItems: FC = ({ isPending, items, error }) => { + let content = null; + if (isPending) { + content = ( +
+ +
+ ); + } else if (error) { + content = Transfers Status: Unable to load data; + } else { + const success = getCount(items, TransferStatus.Success); + const pending = getCount(items, TransferStatus.Pending); + const failed = getCount(items, TransferStatus.Error); + + content = ( + + + + + + + + + + + + ); + } + + return ( +
+ Total Transfer Statuses +
+ {content} +
+ ); +}; + +export default TransfersStatusesItems; diff --git a/src/App/FxpConversions/components/FxpConversionSuccessPerc/index.tsx b/src/App/FxpConversions/components/FxpConversionSuccessPerc/index.tsx index 7b6d495..28ea94c 100644 --- a/src/App/FxpConversions/components/FxpConversionSuccessPerc/index.tsx +++ b/src/App/FxpConversions/components/FxpConversionSuccessPerc/index.tsx @@ -1,82 +1,82 @@ -import React, { FC } from 'react'; -import { ChartLayout, ErrorBox, Spinner } from 'components'; -import { ErrorMessage, XYCoordinate } from 'App/types'; -import Chart from 'react-apexcharts'; - -interface TransfersSuccessPercProps { - isPending: boolean | undefined; - data?: XYCoordinate[]; - error: ErrorMessage; -} - -const TransfersSuccessPerc: FC = ({ isPending, data, error }) => { - let content = null; - if (isPending || !data) { - content = ( -
- -
- ); - } else if (error) { - content = Transfers Successful Percentage: Unable to load data; - } else { - content = ( - } - /> - ); - } - return
{content}
; -}; - -interface SuccessfulTransferGraphProps { - data: XYCoordinate[]; -} - -const SuccessfulTransferGraph: FC = ({ data }) => { - const series = { - name: 'Success Percentage', - data, - }; - - const opts = { - chart: { - id: 'transfer-success-perc-chart', - }, - xaxis: { - type: 'datetime', - }, - yaxis: { - labels: { - formatter: (val: string | number) => { - return `${Number(val).toFixed(0)}`; - }, - }, - }, - grid: { - xaxis: { lines: { show: false } }, - yaxis: { lines: { show: true } }, - strokeDashArray: 2, - strokeWidth: 2, - strokeLineCap: 'round', - }, - stroke: { - width: [2], - curve: 'smooth', - }, - colors: ['#4fc7e7'], - tooltip: { - x: { - formatter: (val: string | number) => { - return new Date(val).toISOString(); - }, - }, - }, - }; - - return ; -}; - -export default TransfersSuccessPerc; +import React, { FC } from 'react'; +import { ChartLayout, ErrorBox, Spinner } from 'components'; +import { ErrorMessage, XYCoordinate } from 'App/types'; +import Chart from 'react-apexcharts'; + +interface TransfersSuccessPercProps { + isPending: boolean | undefined; + data?: XYCoordinate[]; + error: ErrorMessage; +} + +const TransfersSuccessPerc: FC = ({ isPending, data, error }) => { + let content = null; + if (isPending || !data) { + content = ( +
+ +
+ ); + } else if (error) { + content = Transfers Successful Percentage: Unable to load data; + } else { + content = ( + } + /> + ); + } + return
{content}
; +}; + +interface SuccessfulTransferGraphProps { + data: XYCoordinate[]; +} + +const SuccessfulTransferGraph: FC = ({ data }) => { + const series = { + name: 'Success Percentage', + data, + }; + + const opts = { + chart: { + id: 'transfer-success-perc-chart', + }, + xaxis: { + type: 'datetime', + }, + yaxis: { + labels: { + formatter: (val: string | number) => { + return `${Number(val).toFixed(0)}`; + }, + }, + }, + grid: { + xaxis: { lines: { show: false } }, + yaxis: { lines: { show: true } }, + strokeDashArray: 2, + strokeWidth: 2, + strokeLineCap: 'round', + }, + stroke: { + width: [2], + curve: 'smooth', + }, + colors: ['#4fc7e7'], + tooltip: { + x: { + formatter: (val: string | number) => { + return new Date(val).toISOString(); + }, + }, + }, + }; + + return ; +}; + +export default TransfersSuccessPerc; diff --git a/src/App/FxpConversions/helpers.ts b/src/App/FxpConversions/helpers.ts index c83f700..a011ad1 100644 --- a/src/App/FxpConversions/helpers.ts +++ b/src/App/FxpConversions/helpers.ts @@ -1,39 +1,39 @@ -// import moment from 'moment'; -import camelCase from 'lodash/camelCase'; -import startCase from 'lodash/startCase'; -import groupBy from 'lodash/groupBy'; -import ColorScheme from 'color-scheme'; -import { TransferError } from './types'; - -export function toTransfersDate(ISODateString: string): string { - return ISODateString; // moment(ISODateString).format('DD/MM/YYYY LT z'); -} - -export function toSpacedPascalCase(str: string): string { - return startCase(camelCase(str)); -} - -interface ErrorCount { - value: number; - label: string; - color: string; -} -export function getErrorsByType(errors: TransferError[]): ErrorCount[] { - const colors = generateColors(); - return Object.entries(groupBy(errors, 'errorType')).map(([type, items], index) => ({ - label: toSpacedPascalCase(type), - value: items.length, - color: colors[index % colors.length], - })); -} - -export function generateColors() { - const scm = new ColorScheme(); - return scm - .from_hue(370) - .scheme('analogic') - .distance(0.1) - .variation('pastel') - .colors() - .map((color: string) => `#${color}`); -} +// import moment from 'moment'; +import camelCase from 'lodash/camelCase'; +import startCase from 'lodash/startCase'; +import groupBy from 'lodash/groupBy'; +import ColorScheme from 'color-scheme'; +import { TransferError } from './types'; + +export function toTransfersDate(ISODateString: string): string { + return ISODateString; // moment(ISODateString).format('DD/MM/YYYY LT z'); +} + +export function toSpacedPascalCase(str: string): string { + return startCase(camelCase(str)); +} + +interface ErrorCount { + value: number; + label: string; + color: string; +} +export function getErrorsByType(errors: TransferError[]): ErrorCount[] { + const colors = generateColors(); + return Object.entries(groupBy(errors, 'errorType')).map(([type, items], index) => ({ + label: toSpacedPascalCase(type), + value: items.length, + color: colors[index % colors.length], + })); +} + +export function generateColors() { + const scm = new ColorScheme(); + return scm + .from_hue(370) + .scheme('analogic') + .distance(0.1) + .variation('pastel') + .colors() + .map((color: string) => `#${color}`); +} diff --git a/src/App/FxpConversions/hocs.tsx b/src/App/FxpConversions/hocs.tsx index 097f03e..2380876 100644 --- a/src/App/FxpConversions/hocs.tsx +++ b/src/App/FxpConversions/hocs.tsx @@ -1,25 +1,25 @@ -import React, { Component, FC } from 'react'; -import { connect } from 'react-redux'; -import { Dispatch } from 'store/types'; -import * as actions from './actions'; - -const dispatchProps = (dispatch: Dispatch) => ({ - onTransfersMount: () => dispatch(actions.requestTransfersPageData()), -}); - -type TransfersProps = { - onTransfersMount: () => void; -}; - -export function loadTransfers(Transfers: FC) { - class TransfersLoader extends Component { - componentDidMount() { - this.props.onTransfersMount(); - } - - render() { - return ; - } - } - return connect(null, dispatchProps)(TransfersLoader); -} +import React, { Component, FC } from 'react'; +import { connect } from 'react-redux'; +import { Dispatch } from 'store/types'; +import * as actions from './actions'; + +const dispatchProps = (dispatch: Dispatch) => ({ + onTransfersMount: () => dispatch(actions.requestTransfersPageData()), +}); + +type TransfersProps = { + onTransfersMount: () => void; +}; + +export function loadTransfers(Transfers: FC) { + class TransfersLoader extends Component { + componentDidMount() { + this.props.onTransfersMount(); + } + + render() { + return ; + } + } + return connect(null, dispatchProps)(TransfersLoader); +} diff --git a/src/App/FxpConversions/index.ts b/src/App/FxpConversions/index.ts index 1182798..f76f3d6 100644 --- a/src/App/FxpConversions/index.ts +++ b/src/App/FxpConversions/index.ts @@ -1,10 +1,10 @@ -import withErrorBoundary from 'utils/hocs/withErrorBoundary'; -import { ComponentType } from 'react'; -import FxpConversions from './FxpConversions'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; - -export default withErrorBoundary(FxpConversions as ComponentType); -export { actions, reducer, selectors, types }; +import withErrorBoundary from 'utils/hocs/withErrorBoundary'; +import { ComponentType } from 'react'; +import FxpConversions from './FxpConversions'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; + +export default withErrorBoundary(FxpConversions as ComponentType); +export { actions, reducer, selectors, types }; diff --git a/src/App/FxpConversions/reducers.ts b/src/App/FxpConversions/reducers.ts index a8842f1..96baa92 100644 --- a/src/App/FxpConversions/reducers.ts +++ b/src/App/FxpConversions/reducers.ts @@ -1,269 +1,269 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import moment from 'moment'; -import { - SET_TRANSFERS_ERRORS, - SET_TRANSFERS_ERRORS_ERROR, - TOGGLE_TRANSFERS_ERRORS_VIEW_ALL, - SET_TRANSFERS_ERRORS_TYPE_FILTER, - TOGGLE_TRANSFER_FINDER_MODAL, - SET_TRANSFER_FINDER_FILTER, - REQUEST_TRANSFERS, - UNREQUEST_TRANSFERS, - SET_TRANSFERS, - SET_FXPCONVERSIONS, - SET_TRANSFERS_ERROR, - SET_TRANSFERS_STATUSES, - SET_TRANSFERS_STATUSES_ERROR, - SET_TRANSFERS_SUCCESS_PERC, - SET_TRANSFERS_SUCCESS_PERC_ERROR, - SET_TRANSFERS_AVG_TIME, - SET_TRANSFERS_AVG_TIME_ERROR, - TransfersActionTypes, - FxpConversionsState, - DateRange, - SET_FXPCONVERSION_DETAILS, - TOGGLE_TRANSFER_DETAILS_MODAL, - REQUEST_FXPCONVERSION, - UNREQUEST_FXPCONVERSION, - FxpConversionFilter, - SetTransfersAction, - SetTransfersErrorAction, - SetTransfersStatusesAction, - SetTransfersStatusesErrorAction, - SetTransfersSuccessPercAction, - SetTransfersSuccessPercErrorAction, - SetFxpConversionsAction, - SetTransfersAvgTimeAction, - SetTransfersAvgTimeErrorAction, - SetFxpConversionDetailsAction, -} from './types'; - -const dateRanges = { - TODAY: [moment().startOf('day').format('x'), moment().endOf('day').format('x')], - PAST_48_HOURS: [moment().subtract(48, 'hours').format('x'), moment().format('x')], - '1_WEEK': [ - moment().subtract(1, 'week').startOf('day').format('x'), - moment().endOf('day').format('x'), - ], - '1_MONTH': [ - moment().subtract(1, 'month').startOf('day').format('x'), - moment().endOf('day').format('x'), - ], - CUSTOM: [moment().startOf('day').format('x'), moment().endOf('day').format('x')], -}; - -function getFromDateBySelection(range: DateRange) { - return parseInt(dateRanges[range][0], 10); -} - -function getToDateBySelection(range: DateRange) { - return parseInt(dateRanges[range][1], 10); -} - -function getTransferFinderFilterInitialState() { - return { - transferId: undefined, - dates: DateRange.Today, - from: getFromDateBySelection(DateRange.Today), - to: getToDateBySelection(DateRange.Today), - aliasType: undefined, - payeeAlias: undefined, - aliasSubValue: undefined, - direction: undefined, - institution: undefined, - status: undefined, - }; -} - -function getFxpConversionFinderFilterInitialState() { - return { - conversionId: undefined, - dates: DateRange.Today, - from: getFromDateBySelection(DateRange.Today), - to: getToDateBySelection(DateRange.Today), - aliasType: undefined, - payeeAlias: undefined, - aliasSubValue: undefined, - direction: undefined, - institution: undefined, - status: undefined, - }; -} - -export const initialState: FxpConversionsState = { - transfersErrors: [], - transfersErrorsError: null, - isTransfersErrorsViewAllActive: false, - transfersErrorsTypeFilter: undefined, - isTransferFinderModalVisible: false, - transferFinderFilter: getTransferFinderFilterInitialState(), - isTransfersRequested: false, - transfers: [], - fxpConversions: [], - transfersError: null, - transfersStatuses: [], - transfersStatusesError: null, - transfersSuccessPercError: null, - transfersAvgTimeError: null, - isTransferDetailsModalVisible: false, - transferDetailsError: null, - fxpConversionFinderFilter: getFxpConversionFinderFilterInitialState(), -}; - -export default function fxpConversionsReducer( - state = initialState, - action: FxpConversionFilter | TransfersActionTypes -): FxpConversionsState { - switch ('type' in action ? action.type : action) { - case SET_TRANSFERS_ERRORS: - return { - ...state, - transfersErrors: (action as { data: any }).data, - }; - case SET_TRANSFERS_ERRORS_ERROR: - return { - ...state, - transfersErrorsError: 'error' in action ? action.error : null, - }; - case TOGGLE_TRANSFERS_ERRORS_VIEW_ALL: - return { - ...state, - isTransfersErrorsViewAllActive: !state.isTransfersErrorsViewAllActive, - transfersErrorsTypeFilter: initialState.transfersErrorsTypeFilter, - }; - case SET_TRANSFERS_ERRORS_TYPE_FILTER: - return { - ...state, - transfersErrorsTypeFilter: 'filter' in action ? action.filter : undefined, - }; - case TOGGLE_TRANSFER_FINDER_MODAL: { - return { - ...state, - isTransferFinderModalVisible: !state.isTransferFinderModalVisible, - transferFinderFilter: getTransferFinderFilterInitialState(), - isTransfersRequested: false, - }; - } - // fxp - case TOGGLE_TRANSFER_FINDER_MODAL: { - return { - ...state, - isTransferFinderModalVisible: !state.isTransferFinderModalVisible, - fxpConversionFinderFilter: getFxpConversionFinderFilterInitialState(), - isTransfersRequested: false, - }; - } - case TOGGLE_TRANSFER_DETAILS_MODAL: { - return { - ...state, - isTransferDetailsModalVisible: !state.isTransferDetailsModalVisible, - }; - } - case SET_TRANSFER_FINDER_FILTER: { - const { field, value } = action as { field: string; value: any }; - - if (field === 'dates' && value) { - return { - ...state, - transferFinderFilter: { - ...state.transferFinderFilter, - dates: value, - from: getFromDateBySelection(value as DateRange), - to: getToDateBySelection(value as DateRange), - }, - }; - } - if (field === 'from' || field === 'to') { - return { - ...state, - transferFinderFilter: { - ...state.transferFinderFilter, - [field]: value, - dates: 'CUSTOM', - }, - }; - } - return { - ...state, - transferFinderFilter: { - ...state.transferFinderFilter, - [field]: value, - }, - }; - } - case REQUEST_TRANSFERS: - return { - ...state, - isTransfersRequested: true, - }; - case UNREQUEST_TRANSFERS: - return { - ...state, - isTransfersRequested: false, - }; - case SET_TRANSFERS: - return { - ...state, - transfers: (action as SetTransfersAction).data, - }; - case SET_TRANSFERS_ERROR: - return { - ...state, - transfersError: (action as SetTransfersErrorAction).error, - }; - case SET_TRANSFERS_STATUSES: - return { - ...state, - transfersStatuses: (action as SetTransfersStatusesAction).data, - }; - case SET_TRANSFERS_STATUSES_ERROR: - return { - ...state, - transfersStatusesError: (action as SetTransfersStatusesErrorAction).error, - }; - case SET_TRANSFERS_SUCCESS_PERC: - return { - ...state, - transfersSuccessPerc: (action as SetTransfersSuccessPercAction).data, - }; - case SET_TRANSFERS_SUCCESS_PERC_ERROR: - return { - ...state, - transfersSuccessPercError: (action as SetTransfersSuccessPercErrorAction).error, - }; - case SET_TRANSFERS_AVG_TIME: - return { - ...state, - transfersAvgTime: (action as SetTransfersAvgTimeAction).data, - }; - case SET_TRANSFERS_AVG_TIME_ERROR: - return { - ...state, - transfersAvgTimeError: (action as SetTransfersAvgTimeErrorAction).error, - }; - // FXP - case SET_FXPCONVERSIONS: - return { - ...state, - fxpConversions: (action as SetFxpConversionsAction).data, - }; - case REQUEST_FXPCONVERSION: - return { - ...state, - isTransfersRequested: true, - }; - case UNREQUEST_FXPCONVERSION: - return { - ...state, - isTransfersRequested: false, - }; - case SET_FXPCONVERSION_DETAILS: - return { - ...state, - fxpConversionDetails: (action as SetFxpConversionDetailsAction).data, - isTransferDetailsModalVisible: true, - }; - default: - return state; - } -} +/* eslint-disable @typescript-eslint/no-explicit-any */ +import moment from 'moment'; +import { + SET_TRANSFERS_ERRORS, + SET_TRANSFERS_ERRORS_ERROR, + TOGGLE_TRANSFERS_ERRORS_VIEW_ALL, + SET_TRANSFERS_ERRORS_TYPE_FILTER, + TOGGLE_TRANSFER_FINDER_MODAL, + SET_TRANSFER_FINDER_FILTER, + REQUEST_TRANSFERS, + UNREQUEST_TRANSFERS, + SET_TRANSFERS, + SET_FXPCONVERSIONS, + SET_TRANSFERS_ERROR, + SET_TRANSFERS_STATUSES, + SET_TRANSFERS_STATUSES_ERROR, + SET_TRANSFERS_SUCCESS_PERC, + SET_TRANSFERS_SUCCESS_PERC_ERROR, + SET_TRANSFERS_AVG_TIME, + SET_TRANSFERS_AVG_TIME_ERROR, + TransfersActionTypes, + FxpConversionsState, + DateRange, + SET_FXPCONVERSION_DETAILS, + TOGGLE_TRANSFER_DETAILS_MODAL, + REQUEST_FXPCONVERSION, + UNREQUEST_FXPCONVERSION, + FxpConversionFilter, + SetTransfersAction, + SetTransfersErrorAction, + SetTransfersStatusesAction, + SetTransfersStatusesErrorAction, + SetTransfersSuccessPercAction, + SetTransfersSuccessPercErrorAction, + SetFxpConversionsAction, + SetTransfersAvgTimeAction, + SetTransfersAvgTimeErrorAction, + SetFxpConversionDetailsAction, +} from './types'; + +const dateRanges = { + TODAY: [moment().startOf('day').format('x'), moment().endOf('day').format('x')], + PAST_48_HOURS: [moment().subtract(48, 'hours').format('x'), moment().format('x')], + '1_WEEK': [ + moment().subtract(1, 'week').startOf('day').format('x'), + moment().endOf('day').format('x'), + ], + '1_MONTH': [ + moment().subtract(1, 'month').startOf('day').format('x'), + moment().endOf('day').format('x'), + ], + CUSTOM: [moment().startOf('day').format('x'), moment().endOf('day').format('x')], +}; + +function getFromDateBySelection(range: DateRange) { + return parseInt(dateRanges[range][0], 10); +} + +function getToDateBySelection(range: DateRange) { + return parseInt(dateRanges[range][1], 10); +} + +function getTransferFinderFilterInitialState() { + return { + transferId: undefined, + dates: DateRange.Today, + from: getFromDateBySelection(DateRange.Today), + to: getToDateBySelection(DateRange.Today), + aliasType: undefined, + payeeAlias: undefined, + aliasSubValue: undefined, + direction: undefined, + institution: undefined, + status: undefined, + }; +} + +function getFxpConversionFinderFilterInitialState() { + return { + conversionId: undefined, + dates: DateRange.Today, + from: getFromDateBySelection(DateRange.Today), + to: getToDateBySelection(DateRange.Today), + aliasType: undefined, + payeeAlias: undefined, + aliasSubValue: undefined, + direction: undefined, + institution: undefined, + status: undefined, + }; +} + +export const initialState: FxpConversionsState = { + fxpConversionsErrors: [], + fxpConversionsErrorsError: null, + isTransfersErrorsViewAllActive: false, + transfersErrorsTypeFilter: undefined, + isTransferFinderModalVisible: false, + transferFinderFilter: getTransferFinderFilterInitialState(), + isTransfersRequested: false, + fxpConversion: [], + fxpConversions: [], + fxpConversionsError: null, + transfersStatuses: [], + transfersStatusesError: null, + transfersSuccessPercError: null, + transfersAvgTimeError: null, + isTransferDetailsModalVisible: false, + fxpConversionDetailsError: null, + fxpConversionFinderFilter: getFxpConversionFinderFilterInitialState(), +}; + +export default function fxpConversionsReducer( + state = initialState, + action: FxpConversionFilter | TransfersActionTypes +): FxpConversionsState { + switch ('type' in action ? action.type : action) { + case SET_TRANSFERS_ERRORS: + return { + ...state, + fxpConversionsErrors: (action as { data: any }).data, + }; + case SET_TRANSFERS_ERRORS_ERROR: + return { + ...state, + fxpConversionsErrorsError: 'error' in action ? action.error : null, + }; + case TOGGLE_TRANSFERS_ERRORS_VIEW_ALL: + return { + ...state, + isTransfersErrorsViewAllActive: !state.isTransfersErrorsViewAllActive, + transfersErrorsTypeFilter: initialState.transfersErrorsTypeFilter, + }; + case SET_TRANSFERS_ERRORS_TYPE_FILTER: + return { + ...state, + transfersErrorsTypeFilter: 'filter' in action ? action.filter : undefined, + }; + case TOGGLE_TRANSFER_FINDER_MODAL: { + return { + ...state, + isTransferFinderModalVisible: !state.isTransferFinderModalVisible, + transferFinderFilter: getTransferFinderFilterInitialState(), + isTransfersRequested: false, + }; + } + // fxp + case TOGGLE_TRANSFER_FINDER_MODAL: { + return { + ...state, + isTransferFinderModalVisible: !state.isTransferFinderModalVisible, + fxpConversionFinderFilter: getFxpConversionFinderFilterInitialState(), + isTransfersRequested: false, + }; + } + case TOGGLE_TRANSFER_DETAILS_MODAL: { + return { + ...state, + isTransferDetailsModalVisible: !state.isTransferDetailsModalVisible, + }; + } + case SET_TRANSFER_FINDER_FILTER: { + const { field, value } = action as { field: string; value: any }; + + if (field === 'dates' && value) { + return { + ...state, + transferFinderFilter: { + ...state.transferFinderFilter, + dates: value, + from: getFromDateBySelection(value as DateRange), + to: getToDateBySelection(value as DateRange), + }, + }; + } + if (field === 'from' || field === 'to') { + return { + ...state, + transferFinderFilter: { + ...state.transferFinderFilter, + [field]: value, + dates: 'CUSTOM', + }, + }; + } + return { + ...state, + transferFinderFilter: { + ...state.transferFinderFilter, + [field]: value, + }, + }; + } + case REQUEST_TRANSFERS: + return { + ...state, + isTransfersRequested: true, + }; + case UNREQUEST_TRANSFERS: + return { + ...state, + isTransfersRequested: false, + }; + case SET_TRANSFERS: + return { + ...state, + fxpConversions: (action as SetFxpConversionsAction).data, + }; + case SET_TRANSFERS_ERROR: + return { + ...state, + fxpConversionsError: (action as SetTransfersErrorAction).error, + }; + case SET_TRANSFERS_STATUSES: + return { + ...state, + transfersStatuses: (action as SetTransfersStatusesAction).data, + }; + case SET_TRANSFERS_STATUSES_ERROR: + return { + ...state, + transfersStatusesError: (action as SetTransfersStatusesErrorAction).error, + }; + case SET_TRANSFERS_SUCCESS_PERC: + return { + ...state, + transfersSuccessPerc: (action as SetTransfersSuccessPercAction).data, + }; + case SET_TRANSFERS_SUCCESS_PERC_ERROR: + return { + ...state, + transfersSuccessPercError: (action as SetTransfersSuccessPercErrorAction).error, + }; + case SET_TRANSFERS_AVG_TIME: + return { + ...state, + transfersAvgTime: (action as SetTransfersAvgTimeAction).data, + }; + case SET_TRANSFERS_AVG_TIME_ERROR: + return { + ...state, + transfersAvgTimeError: (action as SetTransfersAvgTimeErrorAction).error, + }; + // FXP + case SET_FXPCONVERSIONS: + return { + ...state, + fxpConversions: (action as SetFxpConversionsAction).data, + }; + case REQUEST_FXPCONVERSION: + return { + ...state, + isTransfersRequested: true, + }; + case UNREQUEST_FXPCONVERSION: + return { + ...state, + isTransfersRequested: false, + }; + case SET_FXPCONVERSION_DETAILS: + return { + ...state, + fxpConversionDetails: (action as SetFxpConversionDetailsAction).data, + isTransferDetailsModalVisible: true, + }; + default: + return state; + } +} diff --git a/src/App/FxpConversions/sagas.ts b/src/App/FxpConversions/sagas.ts index 5367452..5e3a284 100644 --- a/src/App/FxpConversions/sagas.ts +++ b/src/App/FxpConversions/sagas.ts @@ -1,230 +1,341 @@ -import { all, call, put, takeLatest, takeEvery } from 'redux-saga/effects'; -import { Action } from 'redux'; -import apis from 'utils/apis'; -import { is20x } from 'utils/http'; -import { - REQUEST_TRANSFERS_PAGE_DATA, - REQUEST_TRANSFERS_ERRORS, - REQUEST_TRANSFERS, - REQUEST_TRANSFERS_STATUSES, - REQUEST_TRANSFERS_SUCCESS_PERC, - REQUEST_TRANSFERS_AVG_TIME, - REQUEST_TRANSFER_DETAILS, - REQUEST_FXPCONVERSION_DETAILS, //fxp - RequestFxpConversionDetailsAction, //fxp - RequestTransfersAction, - RequestTransfersErrorsAction, - RequestTransfersStatusesAction, - RequestTransfersSuccessPercAction, - RequestTransfersAvgTimeAction, - RequestTransferDetailsAction, - SuccessPercApi, - AvgTimeApi, - RequestFxpConversionsAction, - REQUEST_FXPCONVERSION, -} from './types'; -import { - setTransfers, - setTransfersError, - setTransfersErrors, - setTransfersErrorsError, - setTransfersStatuses, - setTransfersStatusesError, - setTransfersSuccessPerc, - setTransfersSuccessPercError, - setTransfersAvgTime, - setTransfersAvgTimeError, - setTransferDetailsError, - setTransferDetails, - setFxpConversionDetails, - setFxpConversionDetailsError, - setFxpConversions, //fxp -} from './actions'; - -export function* fetchTransfersErrors(action: RequestTransfersErrorsAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.transfersErrors.read, {}); - if (is20x(response.status)) { - yield put(setTransfersErrors({ data: response.data })); - } else { - yield put(setTransfersErrorsError({ error: response.status })); - } - } catch (e) { - yield put(setTransfersErrorsError({ error: e.message })); - } -} - -export function* transfersErrorsSaga() { - yield takeLatest([REQUEST_TRANSFERS_ERRORS], fetchTransfersErrors); -} - -function* fetchTransfersStatuses(action: RequestTransfersStatusesAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.transfersStatuses.read, {}); - if (is20x(response.status)) { - yield put(setTransfersStatuses({ data: response.data })); - } else { - yield put(setTransfersStatusesError({ error: response.status })); - } - } catch (e) { - yield put(setTransfersStatusesError({ error: e.message })); - } -} - -export function* transfersStatusesSaga() { - yield takeLatest([REQUEST_TRANSFERS_STATUSES], fetchTransfersStatuses); -} - -function* fetchTransfersSuccessPerc(action: RequestTransfersSuccessPercAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.transfersSuccessPerc.read, { - params: { minutePrevious: 1440 }, - }); - yield put( - setTransfersSuccessPerc({ - data: { - color: '', - points: response.data.map((d: SuccessPercApi) => { - return [Number(d.timestamp), Number(d.percentage)]; - }), - }, - }) - ); - } catch (e) { - yield put(setTransfersSuccessPercError({ error: e.message })); - } -} - -export function* transfersSuccessPercSaga() { - yield takeLatest([REQUEST_TRANSFERS_SUCCESS_PERC], fetchTransfersSuccessPerc); -} - -function* fetchTransfersAvgTime(action: RequestTransfersAvgTimeAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.transfersAvgTime.read, { params: { minutePrevious: 1440 } }); - - yield put( - setTransfersAvgTime({ - data: { - color: '', - points: response.data.map((d: AvgTimeApi) => { - return [Number(d.timestamp), Number(d.averageResponseTime)]; - }), - }, - }) - ); - } catch (e) { - yield put(setTransfersAvgTimeError({ error: e.message })); - } -} - -export function* transfersAvgTimeSaga() { - yield takeLatest([REQUEST_TRANSFERS_AVG_TIME], fetchTransfersAvgTime); -} - -function* fetchTransferDetails(action: RequestTransferDetailsAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.transferDetails.read, { transferId: action.transferId }); - - console.log("callingfetchTransferDetails"); - - if (is20x(response.status)) { - yield put(setTransferDetails({ data: response.data })); - } else { - yield put(setTransferDetailsError({ error: response.status })); - } - } catch (e) { - yield put(setTransferDetailsError({ error: e.message })); - } -} - -export function* transferDetailsSaga() { - yield takeEvery([REQUEST_TRANSFER_DETAILS], fetchTransferDetails); -} - -function* fetchTransfersAllData(action: Action) { - yield all([ - call(fetchTransfersErrors, action), - call(fetchTransfersStatuses, action), - call(fetchTransfersSuccessPerc, action), - call(fetchTransfersAvgTime, action), - ]); -} - -export function* transfersPageSaga() { - yield takeLatest([REQUEST_TRANSFERS_PAGE_DATA], fetchTransfersAllData); -} - -export default function* rootSaga() { - yield all([ - transfersPageSaga(), - transfersErrorsSaga(), - fxpConversionsSaga(), - transfersStatusesSaga(), - transfersSuccessPercSaga(), - transfersAvgTimeSaga(), - transferDetailsSaga(), - ]); -} - -//Fxp Functions -function* fetchFxpConversionDetails(action: RequestFxpConversionDetailsAction) { - try { - // eslint-disable-next-line - const response = yield call(apis.Details.fxpConversionDetails, { - conversionId: action.conversionId, - }); - console.log(response); - if (is20x(response.status)) { - yield put(setFxpConversionDetails({ data: response.data })); - } else { - yield put(setFxpConversionDetailsError({ error: response.status })); - } - } catch (e) { - yield put(setFxpConversionDetailsError({ error: e.message })); - } -} - -export function* FxpConversionDetailsSaga() { - yield takeEvery([REQUEST_FXPCONVERSION_DETAILS], fetchFxpConversionDetails); -} - -function* fetchFxpConversions(action: RequestFxpConversionsAction) { - try { - let params; - if (action.filters.conversionId) { - params = { - id: action.filters.conversionId, - }; - } else { - params = { - startTimestamp: new Date(action.filters.from as number).toISOString(), - endTimestamp: new Date(action.filters.to as number).toISOString(), - recipientIdType: action.filters.aliasType, - recipientIdValue: action.filters.payeeAlias, - recipientIdSubValue: action.filters.aliasSubValue, - direction: action.filters.direction, - institution: action.filters.institution, - status: action.filters.status, - }; - } - // eslint-disable-next-line - const response = yield call(apis.fxpConversions.read, { params }); - console.log(response); - if (is20x(response.status)) { - yield put(setFxpConversions({ data: response.data.slice(0, 50) })); - } else { - yield put(setTransfersError({ error: response.status })); - } - } catch (e) { - yield put(setTransfersError({ error: e.message })); - } -} -export function* fxpConversionsSaga() { - yield takeLatest([REQUEST_FXPCONVERSION], fetchFxpConversions); +import { all, call, put, takeLatest, takeEvery } from 'redux-saga/effects'; +import { Action } from 'redux'; +import apis from 'utils/apis'; +import { is20x } from 'utils/http'; +import { + REQUEST_TRANSFERS_PAGE_DATA, + REQUEST_TRANSFERS_ERRORS, + REQUEST_TRANSFERS, + REQUEST_TRANSFERS_STATUSES, + REQUEST_TRANSFERS_SUCCESS_PERC, + REQUEST_TRANSFERS_AVG_TIME, + REQUEST_TRANSFER_DETAILS, + REQUEST_FXPCONVERSION_DETAILS, + REQUEST_FXPCONVERSIONS_ERRORS, + RequestFxpConversionDetailsAction, + RequestFxpConversionsErrorsAction, + RequestTransfersAction, + RequestTransfersErrorsAction, + RequestTransfersStatusesAction, + RequestTransfersSuccessPercAction, + RequestTransfersAvgTimeAction, + RequestTransferDetailsAction, + SuccessPercApi, + AvgTimeApi, + RequestFxpConversionsAction, + REQUEST_FXPCONVERSION, +} from './types'; +import { + setTransfers, + setTransfersError, + setTransfersErrors, + setTransfersErrorsError, + setTransfersStatuses, + setTransfersStatusesError, + setTransfersSuccessPerc, + setTransfersSuccessPercError, + setTransfersAvgTime, + setTransfersAvgTimeError, + setTransferDetailsError, + setTransferDetails, + setFxpConversionDetails, + setFxpConversionDetailsError, + setFxpConversions, + setFxpConversionsErrors, + setFxpConversionsErrorsError, +} from './actions'; + +export function* fetchTransfersErrors(action: RequestTransfersErrorsAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.transfersErrors.read, {}); + if (is20x(response.status)) { + yield put(setTransfersErrors({ data: response.data })); + } else { + yield put(setTransfersErrorsError({ error: response.status })); + } + } catch (e) { + yield put(setTransfersErrorsError({ error: e.message })); + } +} + +export function* transfersErrorsSaga() { + yield takeLatest([REQUEST_TRANSFERS_ERRORS], fetchTransfersErrors); +} + +function* fetchTransfersStatuses(action: RequestTransfersStatusesAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.transfersStatuses.read, {}); + if (is20x(response.status)) { + yield put(setTransfersStatuses({ data: response.data })); + } else { + yield put(setTransfersStatusesError({ error: response.status })); + } + } catch (e) { + yield put(setTransfersStatusesError({ error: e.message })); + } +} + +export function* transfersStatusesSaga() { + yield takeLatest([REQUEST_TRANSFERS_STATUSES], fetchTransfersStatuses); +} + +function* fetchTransfersSuccessPerc(action: RequestTransfersSuccessPercAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.transfersSuccessPerc.read, { + params: { minutePrevious: 1440 }, + }); + yield put( + setTransfersSuccessPerc({ + data: { + color: '', + points: response.data.map((d: SuccessPercApi) => { + return [Number(d.timestamp), Number(d.percentage)]; + }), + }, + }) + ); + } catch (e) { + yield put(setTransfersSuccessPercError({ error: e.message })); + } +} + +export function* transfersSuccessPercSaga() { + yield takeLatest([REQUEST_TRANSFERS_SUCCESS_PERC], fetchTransfersSuccessPerc); +} + +function* fetchTransfersAvgTime(action: RequestTransfersAvgTimeAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.transfersAvgTime.read, { params: { minutePrevious: 1440 } }); + + yield put( + setTransfersAvgTime({ + data: { + color: '', + points: response.data.map((d: AvgTimeApi) => { + return [Number(d.timestamp), Number(d.averageResponseTime)]; + }), + }, + }) + ); + } catch (e) { + yield put(setTransfersAvgTimeError({ error: e.message })); + } +} + +export function* transfersAvgTimeSaga() { + yield takeLatest([REQUEST_TRANSFERS_AVG_TIME], fetchTransfersAvgTime); +} + +function* fetchTransferDetails(action: RequestTransferDetailsAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.transferDetails.read, { transferId: action.transferId }); + + console.log("callingfetchTransferDetails"); + + if (is20x(response.status)) { + yield put(setTransferDetails({ data: response.data })); + } else { + yield put(setTransferDetailsError({ error: response.status })); + } + } catch (e) { + yield put(setTransferDetailsError({ error: e.message })); + } +} + +export function* transferDetailsSaga() { + yield takeEvery([REQUEST_TRANSFER_DETAILS], fetchTransferDetails); +} + +function* fetchTransfersAllData(action: Action) { + yield all([ + call(fetchTransfersErrors, action), + call(fetchTransfersStatuses, action), + call(fetchTransfersSuccessPerc, action), + call(fetchTransfersAvgTime, action), + ]); +} + +export function* transfersPageSaga() { + yield takeLatest([REQUEST_TRANSFERS_PAGE_DATA], fetchTransfersAllData); +} + +//Fxp Conversions API +function* fetchFxpConversions(action: RequestFxpConversionsAction) { + try { + let params; + if (action.filters.conversionId) { + params = { + id: action.filters.conversionId, + }; + } else { + params = { + startTimestamp: new Date(action.filters.from as number).toISOString(), + endTimestamp: new Date(action.filters.to as number).toISOString(), + recipientIdType: action.filters.aliasType, + recipientIdValue: action.filters.payeeAlias, + recipientIdSubValue: action.filters.aliasSubValue, + direction: action.filters.direction, + institution: action.filters.institution, + status: action.filters.status, + }; + } + // eslint-disable-next-line + const response = yield call(apis.fxpConversions.read, { params }); + console.log(response); + if (is20x(response.status)) { + yield put(setFxpConversions({ data: response.data.slice(0, 50) })); + } else { + yield put(setTransfersError({ error: response.status })); + } + } catch (e) { + yield put(setTransfersError({ error: e.message })); + } +} +export function* fxpConversionsSaga() { + yield takeLatest([REQUEST_FXPCONVERSION], fetchFxpConversions); +} + +// FXP Conversions Details +function* fetchFxpConversionDetails(action: RequestFxpConversionDetailsAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.fxpConversionDetails.read, { + conversionId: action.conversionId, + }); + console.log(response); + if (is20x(response.status)) { + yield put(setFxpConversionDetails({ data: response.data })); + } else { + yield put(setFxpConversionDetailsError({ error: response.status })); + } + } catch (e) { + yield put(setFxpConversionDetailsError({ error: e.message })); + } +} + +export function* FxpConversionDetailsSaga() { + yield takeEvery([REQUEST_FXPCONVERSION_DETAILS], fetchFxpConversionDetails); +} + +// FXP Conversions errors API +export function* fetchFxpConversionsErrors(action: RequestFxpConversionsErrorsAction) { + try { + // eslint-disable-next-line + const response = yield call(apis.fxpConversionsErrors.read, {}); + if (is20x(response.status)) { + yield put(setFxpConversionsErrors({ data: response.data })); + } else { + yield put(setFxpConversionsErrorsError({ error: response.status })); + } + } catch (e) { + yield put(setFxpConversionsErrorsError({ error: e.message })); + } +} + +export function* fxpConversionsErrorsSaga() { + yield takeLatest([REQUEST_FXPCONVERSIONS_ERRORS], fetchFxpConversionsErrors); +} + +//FXP Conversions Status API +// function* fetchTransfersStatuses(action: RequestTransfersStatusesAction) { +// try { +// // eslint-disable-next-line +// const response = yield call(apis.transfersStatuses.read, {}); +// if (is20x(response.status)) { +// yield put(setTransfersStatuses({ data: response.data })); +// } else { +// yield put(setTransfersStatusesError({ error: response.status })); +// } +// } catch (e) { +// yield put(setTransfersStatusesError({ error: e.message })); +// } +// } + +// export function* transfersStatusesSaga() { +// yield takeLatest([REQUEST_TRANSFERS_STATUSES], fetchTransfersStatuses); +// } + +//FXP Conversions SuccessPerc +// function* fetchTransfersSuccessPerc(action: RequestTransfersSuccessPercAction) { +// try { +// // eslint-disable-next-line +// const response = yield call(apis.transfersSuccessPerc.read, { +// params: { minutePrevious: 1440 }, +// }); +// yield put( +// setTransfersSuccessPerc({ +// data: { +// color: '', +// points: response.data.map((d: SuccessPercApi) => { +// return [Number(d.timestamp), Number(d.percentage)]; +// }), +// }, +// }) +// ); +// } catch (e) { +// yield put(setTransfersSuccessPercError({ error: e.message })); +// } +// } + +// export function* transfersSuccessPercSaga() { +// yield takeLatest([REQUEST_TRANSFERS_SUCCESS_PERC], fetchTransfersSuccessPerc); +// } + +// FXP Converions AVGTime +// function* fetchTransfersAvgTime(action: RequestTransfersAvgTimeAction) { +// try { +// // eslint-disable-next-line +// const response = yield call(apis.transfersAvgTime.read, { params: { minutePrevious: 1440 } }); + +// yield put( +// setTransfersAvgTime({ +// data: { +// color: '', +// points: response.data.map((d: AvgTimeApi) => { +// return [Number(d.timestamp), Number(d.averageResponseTime)]; +// }), +// }, +// }) +// ); +// } catch (e) { +// yield put(setTransfersAvgTimeError({ error: e.message })); +// } +// } + +// export function* transfersAvgTimeSaga() { +// yield takeLatest([REQUEST_TRANSFERS_AVG_TIME], fetchTransfersAvgTime); +// } + +// FXPConversions ALL Data +function* fetchFxpConversionsAllData(action: Action) { + yield all([ + call(fetchTransfersErrors, action), + call(fetchTransfersStatuses, action), + // call(fetchTransfersSuccessPerc, action), + // call(fetchTransfersAvgTime, action), + ]); +} + +export function* fxpConversionsPageSaga() { + yield takeLatest([REQUEST_TRANSFERS_PAGE_DATA], fetchFxpConversionsAllData); +} + +// Root Saga +export default function* rootSaga() { + yield all([ + transfersPageSaga(), + transfersErrorsSaga(), + fxpConversionsSaga(), + transfersStatusesSaga(), + transfersSuccessPercSaga(), + transfersAvgTimeSaga(), + transferDetailsSaga(), + fxpConversionsPageSaga(), + fxpConversionsErrorsSaga() + ]); } \ No newline at end of file diff --git a/src/App/FxpConversions/selectors.ts b/src/App/FxpConversions/selectors.ts index 22abad7..b9fabfb 100644 --- a/src/App/FxpConversions/selectors.ts +++ b/src/App/FxpConversions/selectors.ts @@ -1,130 +1,130 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { isPending } from 'utils/api'; -import { XYCoordinate, LinesConfig } from '../types'; - -export const getTransfersErrors = (state: State) => state.transfers.transfersErrors; -export const getTransfersErrorsError = (state: State) => state.transfers.transfersErrorsError; -export const getIsTransfersErrorsPending = createSelector( - (state: State) => state.api, - isPending('transfersErrors.read') -); -export const getIsTransfersErrorsViewAllActive = (state: State) => - state.transfers.isTransfersErrorsViewAllActive; -export const getTransfersErrorsTypeFilter = (state: State) => - state.transfers.transfersErrorsTypeFilter; -export const getIsTransferFinderModalVisible = (state: State) => - state.transfers.isTransferFinderModalVisible; -export const getTransferFinderFilter = (state: State) => state.transfers.transferFinderFilter; -export const getFxpConversionFinderFilter = (state: State) => - state.fxpConversions.fxpConversionFinderFilter; -export const getFilteredByStatusTransfersErrors = createSelector( - getTransfersErrors, - getTransfersErrorsTypeFilter, - (errors, status) => { - if (status) { - return errors.filter((error) => error.errorType === status); - } - return errors; - } -); - -export const getIsTransfersRequested = (state: State) => state.fxpConversions.isTransfersRequested; -// export const getTransfers = (state: State) => state.transfers.transfers; -export const getFxpConversions = (state: State) => state.fxpConversions.fxpConversions; -export const getTransfersError = (state: State) => state.transfers.transfersError; -export const getIsTransfersPending = createSelector( - (state: State) => state.api, - isPending('fxpConversions.read') -); - -export const getTransfersStatuses = (state: State) => state.transfers.transfersStatuses; -export const getTransfersStatusesError = (state: State) => state.transfers.transfersStatusesError; -export const getIsTransfersStatusesPending = createSelector( - (state: State) => state.api, - isPending('transfersStatuses.read') -); - -const transformRawTransferData = (lines?: LinesConfig) => { - const data: [number, number][] = []; - - const now: Date = new Date(); - const start: Date = new Date(); - - start.setSeconds(0); - start.setMilliseconds(0); - start.setHours(now.getHours() - 24); - - const fullSeries: [number, number][] = []; - - while (start.getTime() < now.getTime()) { - fullSeries.push([start.getTime(), 0]); - start.setMinutes(start.getMinutes() + 1, 0, 0); - } - - // merge our real data points with the background zero set - if (lines && lines.points) { - fullSeries.forEach((p) => { - const realPoint = lines.points.find((l) => { - return l[0] === p[0]; - }); - - if (realPoint) { - data.push(realPoint); - return; - } - data.push(p); - }); - } - - data.sort((a, b) => { - if (a[0] < b[0]) { - return -1; - } - if (a[0] > b[0]) { - return 1; - } - return 0; - }); - - return data.map((d: [number, number]) => { - return { - x: d[0], - y: d[1], - } as XYCoordinate; - }); -}; - -export const getTransfersSuccessPerc = (state: State) => state.transfers.transfersSuccessPerc; -export const getTransfersSuccessPercError = (state: State) => - state.transfers.transfersSuccessPercError; -export const getIsTransfersSuccessPercPending = createSelector( - (state: State) => state.api, - isPending('transfersSuccessPerc.read') -); -export const getTransfersSuccessPercTransformed = createSelector( - getTransfersSuccessPerc, - transformRawTransferData -); - -export const getTransfersAvgTime = (state: State) => state.transfers.transfersAvgTime; -export const getTransfersAvgTimeError = (state: State) => state.transfers.transfersAvgTimeError; -export const getIsTransfersAvgTimePending = createSelector( - (state: State) => state.api, - isPending('transfersAvgTime.read') -); -export const getTransfersAvgTimeTransformed = createSelector( - getTransfersAvgTime, - transformRawTransferData -); - -export const getIsTransferDetailsModalVisible = (state: State) => - state.transfers.isTransferDetailsModalVisible; - -export const getTransferDetails = (state: State) => state.transfers.transferDetails; -export const getFxpConversionDetails = (state: State) => state.fxpConversions.fxpConversionDetails; -export const getTransferDetailsError = (state: State) => state.transfers.transferDetailsError; -export const getIsTransferDetailsPending = createSelector( - (state: State) => state.api, - isPending('transferDetails.read') -); +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { isPending } from 'utils/api'; +import { XYCoordinate, LinesConfig } from '../types'; + +export const getTransfersErrors = (state: State) => state.transfers.transfersErrors; +export const getTransfersErrorsError = (state: State) => state.transfers.transfersErrorsError; +export const getIsTransfersErrorsPending = createSelector( + (state: State) => state.api, + isPending('transfersErrors.read') +); +export const getIsTransfersErrorsViewAllActive = (state: State) => + state.transfers.isTransfersErrorsViewAllActive; +export const getTransfersErrorsTypeFilter = (state: State) => + state.transfers.transfersErrorsTypeFilter; +export const getIsTransferFinderModalVisible = (state: State) => + state.transfers.isTransferFinderModalVisible; +export const getTransferFinderFilter = (state: State) => state.transfers.transferFinderFilter; +export const getFxpConversionFinderFilter = (state: State) => + state.fxpConversions.fxpConversionFinderFilter; +export const getFilteredByStatusTransfersErrors = createSelector( + getTransfersErrors, + getTransfersErrorsTypeFilter, + (errors, status) => { + if (status) { + return errors.filter((error) => error.errorType === status); + } + return errors; + } +); + +export const getIsTransfersRequested = (state: State) => state.fxpConversions.isTransfersRequested; +// export const getTransfers = (state: State) => state.transfers.transfers; +export const getFxpConversions = (state: State) => state.fxpConversions.fxpConversions; +export const getTransfersError = (state: State) => state.transfers.transfersError; +export const getIsTransfersPending = createSelector( + (state: State) => state.api, + isPending('fxpConversions.read') +); + +export const getTransfersStatuses = (state: State) => state.transfers.transfersStatuses; +export const getTransfersStatusesError = (state: State) => state.transfers.transfersStatusesError; +export const getIsTransfersStatusesPending = createSelector( + (state: State) => state.api, + isPending('transfersStatuses.read') +); + +const transformRawTransferData = (lines?: LinesConfig) => { + const data: [number, number][] = []; + + const now: Date = new Date(); + const start: Date = new Date(); + + start.setSeconds(0); + start.setMilliseconds(0); + start.setHours(now.getHours() - 24); + + const fullSeries: [number, number][] = []; + + while (start.getTime() < now.getTime()) { + fullSeries.push([start.getTime(), 0]); + start.setMinutes(start.getMinutes() + 1, 0, 0); + } + + // merge our real data points with the background zero set + if (lines && lines.points) { + fullSeries.forEach((p) => { + const realPoint = lines.points.find((l) => { + return l[0] === p[0]; + }); + + if (realPoint) { + data.push(realPoint); + return; + } + data.push(p); + }); + } + + data.sort((a, b) => { + if (a[0] < b[0]) { + return -1; + } + if (a[0] > b[0]) { + return 1; + } + return 0; + }); + + return data.map((d: [number, number]) => { + return { + x: d[0], + y: d[1], + } as XYCoordinate; + }); +}; + +export const getTransfersSuccessPerc = (state: State) => state.transfers.transfersSuccessPerc; +export const getTransfersSuccessPercError = (state: State) => + state.transfers.transfersSuccessPercError; +export const getIsTransfersSuccessPercPending = createSelector( + (state: State) => state.api, + isPending('transfersSuccessPerc.read') +); +export const getTransfersSuccessPercTransformed = createSelector( + getTransfersSuccessPerc, + transformRawTransferData +); + +export const getTransfersAvgTime = (state: State) => state.transfers.transfersAvgTime; +export const getTransfersAvgTimeError = (state: State) => state.transfers.transfersAvgTimeError; +export const getIsTransfersAvgTimePending = createSelector( + (state: State) => state.api, + isPending('transfersAvgTime.read') +); +export const getTransfersAvgTimeTransformed = createSelector( + getTransfersAvgTime, + transformRawTransferData +); + +export const getIsTransferDetailsModalVisible = (state: State) => + state.transfers.isTransferDetailsModalVisible; + +export const getTransferDetails = (state: State) => state.transfers.transferDetails; +export const getFxpConversionDetails = (state: State) => state.fxpConversions.fxpConversionDetails; +export const getTransferDetailsError = (state: State) => state.transfers.transferDetailsError; +export const getIsTransferDetailsPending = createSelector( + (state: State) => state.api, + isPending('transferDetails.read') +); diff --git a/src/App/FxpConversions/types.ts b/src/App/FxpConversions/types.ts index b8b7624..98789e3 100644 --- a/src/App/FxpConversions/types.ts +++ b/src/App/FxpConversions/types.ts @@ -1,624 +1,682 @@ -import { - ErrorMessage, - LinesConfig, - TransferType, - TransferStatus, - TransferDirection, -} from 'App/types'; - -export const REQUEST_TRANSFERS_PAGE_DATA = 'Transfers / Request Page Data'; -export const REQUEST_TRANSFERS_ERRORS = 'Transfers / Request Transfers Errors'; -export const SET_TRANSFERS_ERRORS = 'Transfers / Set Transfers Errors'; -export const SET_TRANSFERS_ERRORS_ERROR = 'Transfers / Set Transfers Errors Error'; -export const TOGGLE_TRANSFERS_ERRORS_VIEW_ALL = 'Transfers / Select Transfers Errors View All'; -export const SET_TRANSFERS_ERRORS_TYPE_FILTER = 'Transfers / Set Transfers Errors Type Filter'; -export const TOGGLE_TRANSFER_FINDER_MODAL = 'Transfers / Open Transfer Finder Modal'; -export const TOGGLE_FXPCONVERSION_FINDER_MODAL = 'FxpConversions / Open FxpConversion Finder Modal'; -export const SET_TRANSFER_FINDER_FILTER = 'Transfers / Set Transfer Finder Filter'; -export const REQUEST_TRANSFERS = 'Transfers / Request Transfers'; -export const UNREQUEST_TRANSFERS = 'Transfers / Unrequest Transfers'; -export const SET_TRANSFERS = 'Transfers / Set Transfers'; -export const SET_FXPCONVERSIONS = 'FxpConversion / Set FxpConversion'; -export const SET_TRANSFERS_ERROR = 'Transfers / Set Transfers Error'; -export const REQUEST_TRANSFERS_STATUSES = 'Transfers / Request Transfers Statuses'; -export const SET_TRANSFERS_STATUSES = 'Transfers / Set Transfers Statuses'; -export const SET_TRANSFERS_STATUSES_ERROR = 'Transfers / Set Transfers Statuses Error'; - -export const REQUEST_TRANSFERS_SUCCESS_PERC = 'Transfers / Request Transfers Success Perc'; -export const SET_TRANSFERS_SUCCESS_PERC = 'Transfers / Set Transfers Success Perc'; -export const SET_TRANSFERS_SUCCESS_PERC_ERROR = 'Transfers / Set Transfers Success Perc Error'; -export const REQUEST_TRANSFERS_AVG_TIME = 'Transfers / Request Transfers Average Time'; -export const SET_TRANSFERS_AVG_TIME = 'Transfers / Set Transfers Average Time'; -export const SET_TRANSFERS_AVG_TIME_ERROR = 'Transfers / Set Transfers Average Time Error'; - -export const REQUEST_TRANSFER_DETAILS = 'Transfers / Request Transfer Details'; -// export const SET_TRANSFER_DETAILS = 'Transfers / Set Transfer Details'; -export const TOGGLE_TRANSFER_DETAILS_MODAL = 'Transfers / Select Transfers Detail View'; -export const SET_TRANSFER_DETAILS_ERROR = 'Transfers / Set Transfer Details Error'; - -// FXp Types -export const SET_FXPCONVERSION_DETAILS = 'FxpConversion / Set FxpConversion Details'; -export const REQUEST_FXPCONVERSION_DETAILS = 'FxpConversion / Request FxpConversion Details'; - -export const REQUEST_FXPCONVERSION = 'FxpConversion / Request FxpConversion'; -export const UNREQUEST_FXPCONVERSION = 'FxpConversion / UnRequest FxpConversion'; -export const SET_FXPCONVERSION_FINDER_FILTER = 'FxpConversion / Set FxpConversion Finder Filter'; - -export interface TransferError { - id: string; - institution: string; - direction: ErrorDirection; - type: TransferType; - currency: string; - value: string; - errorType: ErrorType; - committedDate: string; - receiveAmount?: string; - receiveCurrency?: string; -} - -export enum ErrorDirection { - Inbound = 'INBOUND', - Outbound = 'OUTBOUND', -} - -export enum ErrorType { - FromHub = 'FROM HUB', - FromInstitution = 'FROM INSTITUTION', - InvalidSignature = 'INVALID SIGNATURE', - PayerFspInsufficientLiquidity = 'PAYER FSP INSUFFICIENT LIQUIDITY', - PayerRejection = 'PAYER REJECTION', - PayerRejectedTxnRequest = 'PAYER REJECTED TXN REQUEST', - PayerLimitError = 'PAYER LIMIT ERROR', - PayeeFspInsufficientLiquidity = 'PAYEE FSP INSUFFICIENT LIQUIDITY', - PayeeRejectedQuote = 'PAYEE REJECTED QUOTE', - PayeeFspRejectedQuote = 'PAYEE FSP REJECTED QUOTE', - PayeeRejectedTxn = 'PAYEE REJECTED TXN', - PayeeFspRejectedTxn = 'PAYEE FSP REJECTED TXN', - PayeeUnsupportedCurrency = 'PAYEE UNSUPPORTED CURRENCY', - PayeeLimitError = 'PAYEE LIMIT ERROR', -} - -export interface TransferFilter { - transferId: string | number | undefined; - dates: string | number | undefined; - from: string | number | undefined; - to: string | number | undefined; - aliasType: string | undefined; - payeeAlias: string | undefined; - aliasSubValue: string | undefined; - direction: string | number | undefined; - institution: string | number | undefined; - status: string | number | undefined; -} - -export interface FxpConversionFilter { - conversionId: string | number | undefined; - dates: string | number | undefined; - from: string | number | undefined; - to: string | number | undefined; - aliasType: string | undefined; - payeeAlias: string | undefined; - aliasSubValue: string | undefined; - direction: string | number | undefined; - institution: string | number | undefined; - status: string | number | undefined; -} - -export interface Transfer { - id: string; - institution: string; - direction: TransferDirection; - type: TransferType; - currency: string; - amount: string; - status: TransferStatus; - initiatedTimestamp: string; -} - -export interface FxpConversion { - conversionId: string; - institution: string; - direction: TransferDirection; - type: TransferType; - current: string; - amount: string; - status: TransferStatus; - initiatedTimestamp: string; -} - -export interface ExtensionListItem { - key: string; - value: string; -} - -export interface TransferParty { - type: string; - idType: string; - idValue: string; - idSubValue?: string; - displayName: string; - firstName: string; - middleName: string; - lastName: string; - dateOfBirth?: string; - merchantClassificationCode?: string; - fspId: string; - supportedCurrencies: string[]; - extensionList?: ExtensionListItem[]; -} - -export interface MojaloopError { - errorInformation: MojaloopErrorInformation; -} - -export interface MojaloopErrorInformation { - errorCode: string; - errorDescription: string; - extensionList?: ExtensionListItem[]; -} - -export interface TransferDetailsError { - httpStatusCode: number; - mojaloopError?: MojaloopError; -} - -export interface TransferTechnicalDetailsApiMessage { - headers?: object; - body?: object; -} - -export interface SenderDetails { - idType: string; - idValue: string; -} - -export interface RecipientDetails { - idType: string; - idValue: string; -} - -export interface QuoteAmount { - amount: string; - currency: string; -} - -export interface TransferAmount { - amount: string; - currency: string; -} - -export interface PayeeReceiveAmount { - amount: string; - currency: string; -} - -export interface PayeeDfspFee { - amount: string; - currency: string; -} - -export interface PayeeDfspCommision { - amount: string; - currency: string; -} - -export interface ConversionTerms { - transferAmount: { - amount: string; - currency: string; - }; - charges?: [ - { - chargeType: string; - sourceAmount?: { - amount: string; - currency: string; - }; - targetAmount?: { - amount: string; - currency: string; - }; - } - ]; - exchangeRate: string; - expiryDate: string; -} - -export interface TransferTechnicalDetails { - schemeTransferId: string; - homeTransferId: string; - transactionId: string; - payerParty: TransferParty; - payeeParty: TransferParty; - quoteId: string; - transferState: string; - getPartiesRequest?: TransferTechnicalDetailsApiMessage; - getPartiesResponse?: TransferTechnicalDetailsApiMessage; - quoteRequest?: TransferTechnicalDetailsApiMessage; - quoteResponse?: TransferTechnicalDetailsApiMessage; - transferPrepare?: TransferTechnicalDetailsApiMessage; - transferFulfilment?: TransferTechnicalDetailsApiMessage; - lastError?: TransferDetailsError; - conversionId: string; - conversionState?: string; - conversionQuoteId: string; - fxQuoteRequest?: TransferTechnicalDetailsApiMessage; - fxQuoteResponse?: FxQuoteResponse; - fxTransferPrepare?: TransferTechnicalDetailsApiMessage; - fxTransferFulfilment?: FxTransferFulfilment; -} - -export interface FxQuoteResponse { - condition: {}; - conversionTerms: {}; -} - -export interface FxTransferFulfilment { - body: {}; -} - -export interface TransferTerms { - transferId: string; - homeTransferId: string; - quoteAmount: QuoteAmount; - quoteAmountType: string; - transferAmount: TransferAmount; - payeeReceiveAmount: PayeeReceiveAmount; - payeeDfspFee: PayeeDfspFee; - payeeDfspCommision: PayeeDfspCommision; - expiryDate: string; - conversionTerms: ConversionTerms; -} - -export interface TransferParties { - transferId: string; - transferState: string; - transferType: string; - payerParty: TransferParty; - payeeParty: TransferParty; - quoteId: string; - getPartiesRequest?: TransferTechnicalDetailsApiMessage; - getPartiesResponse?: TransferTechnicalDetailsApiMessage; - quoteRequest?: TransferTechnicalDetailsApiMessage; - quoteResponse?: TransferTechnicalDetailsApiMessage; - transferPrepare?: TransferTechnicalDetailsApiMessage; - transferFulfilment?: TransferTechnicalDetailsApiMessage; - lastError?: TransferDetailsError; - fxProviders: string[]; -} -// Includes the type property to the TransferDetails Interface. -export interface TransfersDetails { - transferId: string; - transferState: string; - confirmationNumber: number; - transactionType: string; - sendAmount: string; - sendCurrency: string; - conversionSubmitted: string; - conversionInstitution: string; - direction: string; - receiveAmount: string; - receiveCurrency: string; - recipientCurrencies: string; - senderDetails: SenderDetails; - recipientDetails: RecipientDetails; - recipientInstitution: string; - initiatedTimestamp: string; - dateSubmitted: string; - technicalDetails: TransferTechnicalDetails; - transferParties: TransferParties; - transferTerms: TransferTerms; -} - -// Includes the type property to the fxpConversionDetails Interface. -export interface FxpConversionDetails { - determiningTransferId: string; - conversionId: string; - conversionState: string; - sourceAmount: number; - sourceCurrency: string; - targetAmount: string; - sendCurrency: string; - conversionAcceptedDate: string; - conversionSettlementBatch: string; - dfspInstitution: string; - FxpConversionTerms: FxpConversionTerms; - FxpTechnicalDetails: FxpTechnicalDetails; -} - -export interface FxpConversionTerms { - determiningTransferId: string; - conversionState: string; - quoteAmount: number; - quoteAmountType: string; - transferAmount: TransferAmount; - totalSourceCharges: { - amount: String; - currency: string; - }; - totalTargetCharges: { - amount: String; - currency: string; - }; - exchangeRate: number; - expiryDateTime: string; -} - -export interface FxpTechnicalDetails { - determiningTransferId: string; - conversionId: string; - conversionQuoteId: string; - conversionState: string; - fxQuoteRequest: TransferTechnicalDetailsApiMessage; - fxQuoteResponse: FxQuoteResponse; - fxTransferPrepare?: TransferTechnicalDetailsApiMessage; - fxTransferFulfil: { - transferState: string; - fulfilment: string; - completedTimeStamp: string; - }; - lastError?: TransferDetailsError; -} - -export enum DateRange { - Today = 'TODAY', - Past48Hours = 'PAST_48_HOURS', - OneWeek = '1_WEEK', - OneMonth = '1_MONTH', -} - -export interface TransfersStatus { - status: TransferStatus; - count: number; -} - -export interface SuccessPerc extends LinesConfig {} -export interface SuccessPercApi { - timestamp: number; - percentage: number; -} - -export interface AvgTime extends LinesConfig {} -export interface AvgTimeApi { - timestamp: number; - averageResponseTime: number; -} - -export interface TransfersState { - transfersErrors: TransferError[]; - transfersErrorsError: ErrorMessage; - isTransfersErrorsViewAllActive: boolean; - transfersErrorsTypeFilter?: string; - isTransferFinderModalVisible: boolean; - transferFinderFilter: TransferFilter; - isTransfersRequested: boolean; - transfers: Transfer[]; - transfersError: ErrorMessage; - transfersStatuses: TransfersStatus[]; - transfersStatusesError: ErrorMessage; - transfersSuccessPerc?: SuccessPerc; - transfersSuccessPercError: ErrorMessage; - transfersAvgTime?: AvgTime; - transfersAvgTimeError: ErrorMessage; - transferDetails?: TransfersDetails; - fxpConversionDetails?: FxpConversionDetails; - isTransferDetailsModalVisible: boolean; - transferDetailsError: ErrorMessage; -} - -export interface FxpConversionsState { - // fxpConversionFinderFilter: any; - transfersErrors: TransferError[]; - transfersErrorsError: ErrorMessage; - isTransfersErrorsViewAllActive: boolean; - transfersErrorsTypeFilter?: string; - isTransferFinderModalVisible: boolean; - transferFinderFilter: TransferFilter; - fxpConversionFinderFilter: FxpConversionFilter; - isTransfersRequested: boolean; - transfers: Transfer[]; - fxpConversions: FxpConversion[]; - transfersError: ErrorMessage; - transfersStatuses: TransfersStatus[]; - transfersStatusesError: ErrorMessage; - transfersSuccessPerc?: SuccessPerc; - transfersSuccessPercError: ErrorMessage; - transfersAvgTime?: AvgTime; - transfersAvgTimeError: ErrorMessage; - fxpConversionDetails?: FxpConversionDetails; - - isTransferDetailsModalVisible: boolean; - transferDetailsError: ErrorMessage; -} - -export interface RequestTransfersPageDataAction { - type: typeof REQUEST_TRANSFERS_PAGE_DATA; -} - -export interface RequestTransfersErrorsAction { - type: typeof REQUEST_TRANSFERS_ERRORS; -} - -export interface SetTransfersErrorsAction { - type: typeof SET_TRANSFERS_ERRORS; - data: TransferError[]; -} - -export interface SetTransfersErrorsErrorAction { - type: typeof SET_TRANSFERS_ERRORS_ERROR; - error: string; -} - -export interface ToggleTransfersErrorsViewAllAction { - type: typeof TOGGLE_TRANSFERS_ERRORS_VIEW_ALL; -} - -export interface SetTransfersErrorsTypeFilterAction { - type: typeof SET_TRANSFERS_ERRORS_TYPE_FILTER; - filter: string; -} - -export interface ToggleTransferFinderModalAction { - type: typeof TOGGLE_TRANSFER_FINDER_MODAL; -} - -export interface ToggleFxpConversionFinderModalAction { - type: typeof TOGGLE_FXPCONVERSION_FINDER_MODAL; -} - -export interface SetTransferFinderFilterAction { - type: typeof SET_TRANSFER_FINDER_FILTER; - value: string | number; - field: string; -} - -export interface SetFxpConversionFinderFilterAction { - type: typeof SET_FXPCONVERSION_FINDER_FILTER; - value: string | number; - field: string; -} - -export interface RequestTransfersAction { - type: typeof REQUEST_TRANSFERS; - filters: TransferFilter; -} - -export interface UnrequestTransfersAction { - type: typeof UNREQUEST_TRANSFERS; -} - -export interface SetTransfersAction { - type: typeof SET_TRANSFERS; - data: Transfer[]; -} - -export interface SetTransfersErrorAction { - type: typeof SET_TRANSFERS_ERROR; - error: string; -} - -export interface RequestTransfersStatusesAction { - type: typeof REQUEST_TRANSFERS_STATUSES; -} - -export interface SetTransfersStatusesAction { - type: typeof SET_TRANSFERS_STATUSES; - data: TransfersStatus[]; -} - -export interface SetTransfersStatusesErrorAction { - type: typeof SET_TRANSFERS_STATUSES_ERROR; - error: string; -} - -export interface RequestTransfersSuccessPercAction { - type: typeof REQUEST_TRANSFERS_SUCCESS_PERC; -} - -export interface SetTransfersSuccessPercAction { - type: typeof SET_TRANSFERS_SUCCESS_PERC; - data: SuccessPerc; -} - -export interface SetTransfersSuccessPercErrorAction { - type: typeof SET_TRANSFERS_SUCCESS_PERC_ERROR; - error: string; -} - -export interface RequestTransfersAvgTimeAction { - type: typeof REQUEST_TRANSFERS_AVG_TIME; -} - -export interface SetTransfersAvgTimeAction { - type: typeof SET_TRANSFERS_AVG_TIME; - data: AvgTime; -} - -export interface SetTransfersAvgTimeErrorAction { - type: typeof SET_TRANSFERS_AVG_TIME_ERROR; - error: string; -} - -export interface RequestTransferDetailsAction { - type: typeof REQUEST_TRANSFER_DETAILS; - transferId: string; -} -// fxp -export interface RequestFxpConversionDetailsAction { - type: typeof REQUEST_FXPCONVERSION_DETAILS; - conversionId: string; -} - -// export interface SetTransferDetailsAction { -// type: typeof SET_TRANSFER_DETAILS; -// data: FxpConversionDetails; -// } - -// fxp -export interface SetFxpConversionDetailsAction { - type: typeof SET_FXPCONVERSION_DETAILS; - data: FxpConversionDetails; -} - -export interface ToggleTransferDetailsModalAction { - type: typeof TOGGLE_TRANSFER_DETAILS_MODAL; -} - -export interface SetTransferDetailsErrorAction { - type: typeof SET_TRANSFER_DETAILS_ERROR; - error: string; -} - -export interface SetFxpConversionDetailsErrorAction { - // fxp - type: typeof SET_TRANSFER_DETAILS_ERROR; - error: string; -} - -export interface SetFxpConversionsAction { - type: typeof SET_FXPCONVERSIONS; - data: FxpConversion[]; -} - -export interface RequestFxpConversionsAction { - type: typeof REQUEST_FXPCONVERSION; - filters: FxpConversionFilter; -} - -export interface UnrequestFxpConversionsAction { - type: typeof UNREQUEST_FXPCONVERSION; -} - -export type TransfersActionTypes = - | RequestTransfersPageDataAction - | RequestTransfersErrorsAction - | SetTransfersErrorsAction - | SetTransfersErrorsErrorAction - | ToggleTransfersErrorsViewAllAction - | SetTransfersErrorsTypeFilterAction - | ToggleTransferFinderModalAction - | ToggleFxpConversionFinderModalAction - | SetTransferFinderFilterAction - | RequestTransfersAction - | UnrequestTransfersAction - | SetTransfersAction - | SetTransfersErrorAction - | RequestTransfersStatusesAction - | SetTransfersStatusesAction - | SetTransfersStatusesErrorAction - | RequestTransfersSuccessPercAction - | SetTransfersSuccessPercAction - | SetTransfersSuccessPercErrorAction - | RequestTransfersAvgTimeAction - | SetTransfersAvgTimeAction - | SetTransfersAvgTimeErrorAction - | RequestTransferDetailsAction - | SetFxpConversionDetailsAction - | SetFxpConversionsAction - | SetFxpConversionDetailsErrorAction - | UnrequestFxpConversionsAction - | RequestFxpConversionsAction - | FxpConversionFilter - | SetFxpConversionsAction - | ToggleTransferDetailsModalAction; +import { + ErrorMessage, + LinesConfig, + TransferType, + TransferStatus, + TransferDirection, +} from 'App/types'; + +export const REQUEST_TRANSFERS_PAGE_DATA = 'Transfers / Request Page Data'; +export const REQUEST_TRANSFERS_ERRORS = 'Transfers / Request Transfers Errors'; +export const SET_TRANSFERS_ERRORS = 'Transfers / Set Transfers Errors'; +export const SET_TRANSFERS_ERRORS_ERROR = 'Transfers / Set Transfers Errors Error'; +export const TOGGLE_TRANSFERS_ERRORS_VIEW_ALL = 'Transfers / Select Transfers Errors View All'; +export const SET_TRANSFERS_ERRORS_TYPE_FILTER = 'Transfers / Set Transfers Errors Type Filter'; +export const TOGGLE_TRANSFER_FINDER_MODAL = 'Transfers / Open Transfer Finder Modal'; +export const SET_TRANSFER_FINDER_FILTER = 'Transfers / Set Transfer Finder Filter'; +export const REQUEST_TRANSFERS = 'Transfers / Request Transfers'; +export const UNREQUEST_TRANSFERS = 'Transfers / Unrequest Transfers'; +export const SET_TRANSFERS = 'Transfers / Set Transfers'; + +export const SET_TRANSFERS_ERROR = 'Transfers / Set Transfers Error'; +export const REQUEST_TRANSFERS_STATUSES = 'Transfers / Request Transfers Statuses'; +export const SET_TRANSFERS_STATUSES = 'Transfers / Set Transfers Statuses'; +export const SET_TRANSFERS_STATUSES_ERROR = 'Transfers / Set Transfers Statuses Error'; + +export const REQUEST_TRANSFERS_SUCCESS_PERC = 'Transfers / Request Transfers Success Perc'; +export const SET_TRANSFERS_SUCCESS_PERC = 'Transfers / Set Transfers Success Perc'; +export const SET_TRANSFERS_SUCCESS_PERC_ERROR = 'Transfers / Set Transfers Success Perc Error'; +export const REQUEST_TRANSFERS_AVG_TIME = 'Transfers / Request Transfers Average Time'; +export const SET_TRANSFERS_AVG_TIME = 'Transfers / Set Transfers Average Time'; +export const SET_TRANSFERS_AVG_TIME_ERROR = 'Transfers / Set Transfers Average Time Error'; + +export const REQUEST_TRANSFER_DETAILS = 'Transfers / Request Transfer Details'; +export const TOGGLE_TRANSFER_DETAILS_MODAL = 'Transfers / Select Transfers Detail View'; +export const SET_TRANSFER_DETAILS_ERROR = 'Transfers / Set Transfer Details Error'; + +// FXp Types +export const SET_FXPCONVERSIONS = 'FxpConversion / Set FxpConversion'; +export const TOGGLE_FXPCONVERSION_FINDER_MODAL = 'FxpConversions / Open FxpConversion Finder Modal'; +export const SET_FXPCONVERSION_DETAILS = 'FxpConversion / Set FxpConversion Details'; +export const REQUEST_FXPCONVERSION_DETAILS = 'FxpConversion / Request FxpConversion Details'; +export const REQUEST_FXPCONVERSION = 'FxpConversion / Request FxpConversion'; +export const UNREQUEST_FXPCONVERSION = 'FxpConversion / UnRequest FxpConversion'; +export const SET_FXPCONVERSION_FINDER_FILTER = 'FxpConversion / Set FxpConversion Finder Filter'; +export const SET_FXPCONVERSION_DETAILS_ERROR = 'FxpConversions / Set FxpConversion Details Error'; +export const SET_FXPCONVERSIONS_ERRORS = 'FxpConversions / Set FxpConversions Errors'; +export const SET_FXPCONVERSIONS_ERRORS_ERROR = 'FxpConversions / Set FxpConversions Errors Error'; +export const REQUEST_FXPCONVERSIONS_ERRORS = 'FxpConversions / Request FxpConversions Errors'; +export const TOGGLE_FXPCONVERSIONS_ERRORS_VIEW_ALL = 'FxpConversions / Select FxpConversions Errors View All'; +export const SET_FXPCONVERSIONS_ERRORS_TYPE_FILTER = 'FxpConversions / Set FxpConversions Errors Type Filter'; +export const SET_FXPCONVERSIONS_ERROR = 'FxpConversions / Set FxpConversions Errors'; + +export interface TransferError { + id: string; + institution: string; + direction: ErrorDirection; + type: TransferType; + currency: string; + value: string; + errorType: ErrorType; + committedDate: string; + receiveAmount?: string; + receiveCurrency?: string; +} + +export interface FxpConversionError { + id: string; + institution: string; + direction: ErrorDirection; + type: TransferType; + currency: string; + value: string; + errorType: ErrorType; + committedDate: string; + receiveAmount?: string; + receiveCurrency?: string; +} + +export enum ErrorDirection { + Inbound = 'INBOUND', + Outbound = 'OUTBOUND', +} + +export enum ErrorType { + FromHub = 'FROM HUB', + FromInstitution = 'FROM INSTITUTION', + InvalidSignature = 'INVALID SIGNATURE', + PayerFspInsufficientLiquidity = 'PAYER FSP INSUFFICIENT LIQUIDITY', + PayerRejection = 'PAYER REJECTION', + PayerRejectedTxnRequest = 'PAYER REJECTED TXN REQUEST', + PayerLimitError = 'PAYER LIMIT ERROR', + PayeeFspInsufficientLiquidity = 'PAYEE FSP INSUFFICIENT LIQUIDITY', + PayeeRejectedQuote = 'PAYEE REJECTED QUOTE', + PayeeFspRejectedQuote = 'PAYEE FSP REJECTED QUOTE', + PayeeRejectedTxn = 'PAYEE REJECTED TXN', + PayeeFspRejectedTxn = 'PAYEE FSP REJECTED TXN', + PayeeUnsupportedCurrency = 'PAYEE UNSUPPORTED CURRENCY', + PayeeLimitError = 'PAYEE LIMIT ERROR', +} + +export interface TransferFilter { + transferId: string | number | undefined; + dates: string | number | undefined; + from: string | number | undefined; + to: string | number | undefined; + aliasType: string | undefined; + payeeAlias: string | undefined; + aliasSubValue: string | undefined; + direction: string | number | undefined; + institution: string | number | undefined; + status: string | number | undefined; +} + +export interface FxpConversionFilter { + conversionId: string | number | undefined; + dates: string | number | undefined; + from: string | number | undefined; + to: string | number | undefined; + aliasType: string | undefined; + payeeAlias: string | undefined; + aliasSubValue: string | undefined; + direction: string | number | undefined; + institution: string | number | undefined; + status: string | number | undefined; +} + +export interface Transfer { + id: string; + institution: string; + direction: TransferDirection; + type: TransferType; + currency: string; + amount: string; + status: TransferStatus; + initiatedTimestamp: string; +} + +export interface FxpConversion { + conversionId: string; + institution: string; + direction: TransferDirection; + type: TransferType; + current: string; + amount: string; + status: TransferStatus; + initiatedTimestamp: string; +} + +export interface ExtensionListItem { + key: string; + value: string; +} + +export interface TransferParty { + type: string; + idType: string; + idValue: string; + idSubValue?: string; + displayName: string; + firstName: string; + middleName: string; + lastName: string; + dateOfBirth?: string; + merchantClassificationCode?: string; + fspId: string; + supportedCurrencies: string[]; + extensionList?: ExtensionListItem[]; +} + +export interface MojaloopError { + errorInformation: MojaloopErrorInformation; +} + +export interface MojaloopErrorInformation { + errorCode: string; + errorDescription: string; + extensionList?: ExtensionListItem[]; +} + +export interface TransferDetailsError { + httpStatusCode: number; + mojaloopError?: MojaloopError; +} +// FxpConversionDetailsError +export interface FxpConversionDetailsError { + httpStatusCode: number; + mojaloopError?: MojaloopError; +} + +export interface TransferTechnicalDetailsApiMessage { + headers?: object; + body?: object; +} + +export interface SenderDetails { + idType: string; + idValue: string; +} + +export interface RecipientDetails { + idType: string; + idValue: string; +} + +export interface QuoteAmount { + amount: string; + currency: string; +} + +export interface TransferAmount { + amount: string; + currency: string; +} + +export interface PayeeReceiveAmount { + amount: string; + currency: string; +} + +export interface PayeeDfspFee { + amount: string; + currency: string; +} + +export interface PayeeDfspCommision { + amount: string; + currency: string; +} + +export interface ConversionTerms { + transferAmount: { + amount: string; + currency: string; + }; + charges?: [ + { + chargeType: string; + sourceAmount?: { + amount: string; + currency: string; + }; + targetAmount?: { + amount: string; + currency: string; + }; + } + ]; + exchangeRate: string; + expiryDate: string; +} + +export interface TransferTechnicalDetails { + schemeTransferId: string; + homeTransferId: string; + transactionId: string; + payerParty: TransferParty; + payeeParty: TransferParty; + quoteId: string; + transferState: string; + getPartiesRequest?: TransferTechnicalDetailsApiMessage; + getPartiesResponse?: TransferTechnicalDetailsApiMessage; + quoteRequest?: TransferTechnicalDetailsApiMessage; + quoteResponse?: TransferTechnicalDetailsApiMessage; + transferPrepare?: TransferTechnicalDetailsApiMessage; + transferFulfilment?: TransferTechnicalDetailsApiMessage; + lastError?: TransferDetailsError; + conversionId: string; + conversionState?: string; + conversionQuoteId: string; + fxQuoteRequest?: TransferTechnicalDetailsApiMessage; + fxQuoteResponse?: FxQuoteResponse; + fxTransferPrepare?: TransferTechnicalDetailsApiMessage; + fxTransferFulfilment?: FxTransferFulfilment; +} + +export interface FxQuoteResponse { + condition: {}; + conversionTerms: {}; +} + +export interface FxTransferFulfilment { + body: {}; +} + +export interface TransferTerms { + transferId: string; + homeTransferId: string; + quoteAmount: QuoteAmount; + quoteAmountType: string; + transferAmount: TransferAmount; + payeeReceiveAmount: PayeeReceiveAmount; + payeeDfspFee: PayeeDfspFee; + payeeDfspCommision: PayeeDfspCommision; + expiryDate: string; + conversionTerms: ConversionTerms; +} + +export interface TransferParties { + transferId: string; + transferState: string; + transferType: string; + payerParty: TransferParty; + payeeParty: TransferParty; + quoteId: string; + getPartiesRequest?: TransferTechnicalDetailsApiMessage; + getPartiesResponse?: TransferTechnicalDetailsApiMessage; + quoteRequest?: TransferTechnicalDetailsApiMessage; + quoteResponse?: TransferTechnicalDetailsApiMessage; + transferPrepare?: TransferTechnicalDetailsApiMessage; + transferFulfilment?: TransferTechnicalDetailsApiMessage; + lastError?: TransferDetailsError; + fxProviders: string[]; +} +// Includes the type property to the TransferDetails Interface. +export interface TransfersDetails { + transferId: string; + transferState: string; + confirmationNumber: number; + transactionType: string; + sendAmount: string; + sendCurrency: string; + conversionSubmitted: string; + conversionInstitution: string; + direction: string; + receiveAmount: string; + receiveCurrency: string; + recipientCurrencies: string; + senderDetails: SenderDetails; + recipientDetails: RecipientDetails; + recipientInstitution: string; + initiatedTimestamp: string; + dateSubmitted: string; + technicalDetails: TransferTechnicalDetails; + transferParties: TransferParties; + transferTerms: TransferTerms; +} + +// Includes the type property to the fxpConversionDetails Interface. +export interface FxpConversionDetails { + determiningTransferId: string; + conversionId: string; + conversionState: string; + sourceAmount: number; + sourceCurrency: string; + targetAmount: string; + sendCurrency: string; + conversionAcceptedDate: string; + conversionSettlementBatch: string; + dfspInstitution: string; + FxpConversionTerms: FxpConversionTerms; + FxpTechnicalDetails: FxpTechnicalDetails; +} + +export interface FxpConversionTerms { + determiningTransferId: string; + conversionState: string; + quoteAmount: number; + quoteAmountType: string; + transferAmount: TransferAmount; + totalSourceCharges: { + amount: String; + currency: string; + }; + totalTargetCharges: { + amount: String; + currency: string; + }; + exchangeRate: number; + expiryDateTime: string; +} + +export interface FxpTechnicalDetails { + determiningTransferId: string; + conversionId: string; + conversionQuoteId: string; + conversionState: string; + fxQuoteRequest: TransferTechnicalDetailsApiMessage; + fxQuoteResponse: FxQuoteResponse; + fxTransferPrepare?: TransferTechnicalDetailsApiMessage; + fxTransferFulfil: { + transferState: string; + fulfilment: string; + completedTimeStamp: string; + }; + lastError?: FxpConversionDetailsError; +} + +export enum DateRange { + Today = 'TODAY', + Past48Hours = 'PAST_48_HOURS', + OneWeek = '1_WEEK', + OneMonth = '1_MONTH', +} + +export interface TransfersStatus { + status: TransferStatus; + count: number; +} + +export interface SuccessPerc extends LinesConfig {} +export interface SuccessPercApi { + timestamp: number; + percentage: number; +} + +export interface AvgTime extends LinesConfig {} +export interface AvgTimeApi { + timestamp: number; + averageResponseTime: number; +} + +export interface TransfersState { + transfersErrors: TransferError[]; + transfersErrorsError: ErrorMessage; + isTransfersErrorsViewAllActive: boolean; + transfersErrorsTypeFilter?: string; + isTransferFinderModalVisible: boolean; + transferFinderFilter: TransferFilter; + isTransfersRequested: boolean; + transfers: Transfer[]; + transfersError: ErrorMessage; + transfersStatuses: TransfersStatus[]; + transfersStatusesError: ErrorMessage; + transfersSuccessPerc?: SuccessPerc; + transfersSuccessPercError: ErrorMessage; + transfersAvgTime?: AvgTime; + transfersAvgTimeError: ErrorMessage; + transferDetails?: TransfersDetails; + fxpConversionDetails?: FxpConversionDetails; + isTransferDetailsModalVisible: boolean; + transferDetailsError: ErrorMessage; +} + +export interface FxpConversionsState { + fxpConversionsErrors: FxpConversionError[]; + fxpConversionsErrorsError: ErrorMessage; + isTransfersErrorsViewAllActive: boolean; + transfersErrorsTypeFilter?: string; + isTransferFinderModalVisible: boolean; + transferFinderFilter: TransferFilter; + fxpConversionFinderFilter: FxpConversionFilter; + isTransfersRequested: boolean; + fxpConversion: FxpConversion[]; + fxpConversions: FxpConversion[]; + fxpConversionsError: ErrorMessage; + transfersStatuses: TransfersStatus[]; + transfersStatusesError: ErrorMessage; + transfersSuccessPerc?: SuccessPerc; + transfersSuccessPercError: ErrorMessage; + transfersAvgTime?: AvgTime; + transfersAvgTimeError: ErrorMessage; + fxpConversionDetails?: FxpConversionDetails; + + isTransferDetailsModalVisible: boolean; + fxpConversionDetailsError: ErrorMessage; +} + +export interface RequestTransfersPageDataAction { + type: typeof REQUEST_TRANSFERS_PAGE_DATA; +} + +export interface RequestTransfersErrorsAction { + type: typeof REQUEST_TRANSFERS_ERRORS; +} +// RequestFxpConversionsErrorsAction +export interface RequestFxpConversionsErrorsAction { + type: typeof REQUEST_FXPCONVERSIONS_ERRORS; +} + +export interface SetTransfersErrorsAction { + type: typeof SET_TRANSFERS_ERRORS; + data: TransferError[]; +} + +// SetFxpConversionErrorsAction +export interface SetFxpConversionErrorsAction { + type: typeof SET_FXPCONVERSIONS_ERRORS; + data: FxpConversionError[]; +} + +export interface SetTransfersErrorsErrorAction { + type: typeof SET_TRANSFERS_ERRORS_ERROR; + error: string; +} + +// SetFxpConversionsErrorsErrorAction +export interface SetFxpConversionsErrorsErrorAction { + type: typeof SET_FXPCONVERSIONS_ERRORS_ERROR; + error: string; +} + +export interface ToggleTransfersErrorsViewAllAction { + type: typeof TOGGLE_TRANSFERS_ERRORS_VIEW_ALL; +} + +// ToggleFxpConversionsErrorsViewAllAction +export interface ToggleFxpConversionsErrorsViewAllAction { + type: typeof TOGGLE_FXPCONVERSIONS_ERRORS_VIEW_ALL; +} + +export interface SetTransfersErrorsTypeFilterAction { + type: typeof SET_TRANSFERS_ERRORS_TYPE_FILTER; + filter: string; +} + +// SetFxpConversionsErrorsTypeFilterAction +export interface SetFxpConversionsErrorsTypeFilterAction { + type: typeof SET_FXPCONVERSIONS_ERRORS_TYPE_FILTER; + filter: string; +} + +export interface ToggleTransferFinderModalAction { + type: typeof TOGGLE_TRANSFER_FINDER_MODAL; +} + +// ToggleFxpConversionFinderModalAction +export interface ToggleFxpConversionFinderModalAction { + type: typeof TOGGLE_FXPCONVERSION_FINDER_MODAL; +} + +export interface SetTransferFinderFilterAction { + type: typeof SET_TRANSFER_FINDER_FILTER; + value: string | number; + field: string; +} + +export interface SetFxpConversionFinderFilterAction { + type: typeof SET_FXPCONVERSION_FINDER_FILTER; + value: string | number; + field: string; +} + +export interface RequestTransfersAction { + type: typeof REQUEST_TRANSFERS; + filters: TransferFilter; +} + +export interface UnrequestTransfersAction { + type: typeof UNREQUEST_TRANSFERS; +} + +export interface SetTransfersAction { + type: typeof SET_TRANSFERS; + data: Transfer[]; +} + +export interface SetTransfersErrorAction { + type: typeof SET_TRANSFERS_ERROR; + error: string; +} + +// SetFxpConversionsErrorAction +export interface SetFxpConversionsErrorAction { + type: typeof SET_FXPCONVERSIONS_ERROR; + error: string; +} + +export interface RequestTransfersStatusesAction { + type: typeof REQUEST_TRANSFERS_STATUSES; +} + +export interface SetTransfersStatusesAction { + type: typeof SET_TRANSFERS_STATUSES; + data: TransfersStatus[]; +} + +export interface SetTransfersStatusesErrorAction { + type: typeof SET_TRANSFERS_STATUSES_ERROR; + error: string; +} + +export interface RequestTransfersSuccessPercAction { + type: typeof REQUEST_TRANSFERS_SUCCESS_PERC; +} + +export interface SetTransfersSuccessPercAction { + type: typeof SET_TRANSFERS_SUCCESS_PERC; + data: SuccessPerc; +} + +export interface SetTransfersSuccessPercErrorAction { + type: typeof SET_TRANSFERS_SUCCESS_PERC_ERROR; + error: string; +} + +export interface RequestTransfersAvgTimeAction { + type: typeof REQUEST_TRANSFERS_AVG_TIME; +} + +export interface SetTransfersAvgTimeAction { + type: typeof SET_TRANSFERS_AVG_TIME; + data: AvgTime; +} + +export interface SetTransfersAvgTimeErrorAction { + type: typeof SET_TRANSFERS_AVG_TIME_ERROR; + error: string; +} + +export interface RequestTransferDetailsAction { + type: typeof REQUEST_TRANSFER_DETAILS; + transferId: string; +} +// fxp +export interface RequestFxpConversionDetailsAction { + type: typeof REQUEST_FXPCONVERSION_DETAILS; + conversionId: string; +} + +// fxp +export interface SetFxpConversionDetailsAction { + type: typeof SET_FXPCONVERSION_DETAILS; + data: FxpConversionDetails; +} + +export interface ToggleTransferDetailsModalAction { + type: typeof TOGGLE_TRANSFER_DETAILS_MODAL; +} + +export interface SetTransferDetailsErrorAction { + type: typeof SET_TRANSFER_DETAILS_ERROR; + error: string; +} + +export interface SetFxpConversionDetailsErrorAction { + // fxp + type: typeof SET_FXPCONVERSION_DETAILS_ERROR; + error: string; +} + +export interface SetFxpConversionsAction { + type: typeof SET_FXPCONVERSIONS; + data: FxpConversion[]; +} + +export interface RequestFxpConversionsAction { + type: typeof REQUEST_FXPCONVERSION; + filters: FxpConversionFilter; +} + +export interface UnrequestFxpConversionsAction { + type: typeof UNREQUEST_FXPCONVERSION; +} + +export type TransfersActionTypes = + | RequestTransfersPageDataAction + | RequestTransfersErrorsAction + | SetTransfersErrorsAction + | SetTransfersErrorsErrorAction + | ToggleTransfersErrorsViewAllAction + | SetTransfersErrorsTypeFilterAction + | ToggleTransferFinderModalAction + | ToggleFxpConversionFinderModalAction + | SetTransferFinderFilterAction + | RequestTransfersAction + | UnrequestTransfersAction + | SetTransfersAction + | SetTransfersErrorAction + | RequestTransfersStatusesAction + | SetTransfersStatusesAction + | SetTransfersStatusesErrorAction + | RequestTransfersSuccessPercAction + | SetTransfersSuccessPercAction + | SetTransfersSuccessPercErrorAction + | RequestTransfersAvgTimeAction + | SetTransfersAvgTimeAction + | SetTransfersAvgTimeErrorAction + | RequestTransferDetailsAction + | SetFxpConversionDetailsAction + | SetFxpConversionsAction + | SetFxpConversionDetailsErrorAction + | UnrequestFxpConversionsAction + | RequestFxpConversionsAction + | SetFxpConversionFinderFilterAction + | SetFxpConversionsAction + | SetFxpConversionErrorsAction + | SetFxpConversionsErrorsErrorAction + | RequestFxpConversionsErrorsAction + | ToggleFxpConversionsErrorsViewAllAction + | SetFxpConversionsErrorsTypeFilterAction + | SetFxpConversionsErrorAction + | ToggleTransferDetailsModalAction; diff --git a/src/App/FxpTechnicalDashboard/FxpDashboard.css b/src/App/FxpTechnicalDashboard/FxpDashboard.css index f284993..c2fc6f2 100644 --- a/src/App/FxpTechnicalDashboard/FxpDashboard.css +++ b/src/App/FxpTechnicalDashboard/FxpDashboard.css @@ -1,88 +1,88 @@ -.fxpdashboard { -} - -.dashboard__today__graph-loader, -.dashboard__flow__graph-loader { - height: 300px; - align-items: center; - justify-content: center; - display: flex; -} -.dashboard__today__graph-container, -.dashboard__flow__graph-container { - background: #fff; - height: 300px; - width: 100%; -} - -.dashboard__today__recap-container, -.dashboard__flow__recap-container { - border: 1px solid #39f; - min-height: 250px; - height: 100%; - min-width: 200px; - align-items: center; - justify-content: center; - display: flex; - flex-direction: column; -} - -.dashboard__flow__section, -.dashboard__today__section { - margin-bottom: 20px; -} - -.dashboard__overview__section { - margin-bottom: 20px; -} -.dashboard__overview__loader { - height: 100px; - width: 100%; - display: flex; - justify-content: center; - flex-direction: row; -} -.dashboard__overview__list { - margin: 10px; -} - -.dashboard__overview__list__status-indicator.el-datalist__header-cell, -.dashboard__overview__list__status-indicator.el-datalist__item-cell { - flex: 0 0 40px; - justify-content: center; -} - -.dashboard__overview-status { - color: #053035; - margin: 5px; -} -.dashboard__overview-status--open { - background: #4fc7e7; -} -.dashboard__overview-status--on-track { - background: #12d670; -} -.dashboard__overview-status--has-errors { - background: #e23a54; -} -.dashboard__overview-status--overdue { - background: #ff9016; -} - -.dashboard__overview-status__indicator { - height: 14px; - width: 14px; - border-radius: 50%; -} - -.dashboard__overview__window { -} -.dashboard__overview__window__batch-details-block { - margin-right: 20px; -} - -.dashboard__overview__window__batch-dates-block { - display: flex; - flex-direction: column; - margin-bottom: 10px; -} +.fxpdashboard { +} + +.dashboard__today__graph-loader, +.dashboard__flow__graph-loader { + height: 300px; + align-items: center; + justify-content: center; + display: flex; +} +.dashboard__today__graph-container, +.dashboard__flow__graph-container { + background: #fff; + height: 300px; + width: 100%; +} + +.dashboard__today__recap-container, +.dashboard__flow__recap-container { + border: 1px solid #39f; + min-height: 250px; + height: 100%; + min-width: 200px; + align-items: center; + justify-content: center; + display: flex; + flex-direction: column; +} + +.dashboard__flow__section, +.dashboard__today__section { + margin-bottom: 20px; +} + +.dashboard__overview__section { + margin-bottom: 20px; +} +.dashboard__overview__loader { + height: 100px; + width: 100%; + display: flex; + justify-content: center; + flex-direction: row; +} +.dashboard__overview__list { + margin: 10px; +} + +.dashboard__overview__list__status-indicator.el-datalist__header-cell, +.dashboard__overview__list__status-indicator.el-datalist__item-cell { + flex: 0 0 40px; + justify-content: center; +} + +.dashboard__overview-status { + color: #053035; + margin: 5px; +} +.dashboard__overview-status--open { + background: #4fc7e7; +} +.dashboard__overview-status--on-track { + background: #12d670; +} +.dashboard__overview-status--has-errors { + background: #e23a54; +} +.dashboard__overview-status--overdue { + background: #ff9016; +} + +.dashboard__overview-status__indicator { + height: 14px; + width: 14px; + border-radius: 50%; +} + +.dashboard__overview__window { +} +.dashboard__overview__window__batch-details-block { + margin-right: 20px; +} + +.dashboard__overview__window__batch-dates-block { + display: flex; + flex-direction: column; + margin-bottom: 10px; +} diff --git a/src/App/FxpTechnicalDashboard/FxpDashboard.tsx b/src/App/FxpTechnicalDashboard/FxpDashboard.tsx index 6b854ca..791577a 100644 --- a/src/App/FxpTechnicalDashboard/FxpDashboard.tsx +++ b/src/App/FxpTechnicalDashboard/FxpDashboard.tsx @@ -1,281 +1,281 @@ -import React, { FC } from 'react'; -import { connect } from 'react-redux'; -import { - Heading, - MetricsChart, - Row, - Column, - Select, - Tabs, - Tab, - TabList, - TabPanels, - TabPanel, -} from 'components'; -import { State, Dispatch } from 'store/types'; -import { MetricDataWrapper, XYCoordinate } from 'App/types'; -import { loadTechnicalDashboard } from './hocs'; -import * as selectors from './selectors'; -import * as actions from './actions'; -import { TechnicalDashboardFilters } from './types'; -import './FxpDashboard.css'; - -const stateProps = (state: State) => ({ - filters: selectors.getTechnicalDashboardFilters(state), - partyLookupRateData: selectors.getMetricData( - state, - 'mojaloop_connector_outbound_party_lookup_request_count' - ), - quoteRequestRateData: selectors.getMetricData( - state, - 'mojaloop_connector_outbound_quote_request_count' - ), - prepareRateData: selectors.getMetricData( - state, - 'mojaloop_connector_outbound_transfer_prepare_count' - ), - partyLookupLatencyData: selectors.getMetricData( - state, - 'mojaloop_connector_outbound_party_lookup_latency' - ), - quoteRequestLatencyData: selectors.getMetricData( - state, - 'mojaloop_connector_outbound_quote_request_latency' - ), - transferLatencyData: selectors.getMetricData( - state, - 'mojaloop_connector_outbound_transfer_latency' - ), -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onFilterChange: ({ field, value }: { field: string; value: string | number }) => { - dispatch(actions.setTechnicalDashboardFilters({ field, value })); - }, -}); - -type FxpTechnicalDashboardProps = { - partyLookupRateData?: MetricDataWrapper; - quoteRequestRateData?: MetricDataWrapper; - prepareRateData?: MetricDataWrapper; - partyLookupLatencyData?: MetricDataWrapper; - quoteRequestLatencyData?: MetricDataWrapper; - transferLatencyData?: MetricDataWrapper; - filters: TechnicalDashboardFilters; - onFilterChange: ({ field, value }: { field: string; value: string | number }) => void; -}; - -const FxpTechnicalDashboard: FC = ({ - partyLookupRateData, - quoteRequestRateData, - prepareRateData, - partyLookupLatencyData, - quoteRequestLatencyData, - transferLatencyData, - filters, - onFilterChange, -}) => { - const partyLookupData = []; - if (partyLookupRateData) { - partyLookupData.push({ - chartType: 'line', - color: '#4fc7e7', - legendText: 'Requests/sec', - data: partyLookupRateData.data, - }); - } - if (partyLookupLatencyData) { - partyLookupData.push({ - chartType: 'line', - color: '#12d670', - legendText: 'Latency ms', - data: partyLookupLatencyData.data.map((d) => ({ x: d.x, y: d.y * 1000 })), - }); - } - - const quoteRequestData = []; - if (quoteRequestRateData) { - quoteRequestData.push({ - chartType: 'line', - color: '#4fc7e7', - legendText: 'Requests/sec', - data: quoteRequestRateData.data, - }); - } - if (quoteRequestLatencyData) { - quoteRequestData.push({ - chartType: 'line', - color: '#12d670', - legendText: 'Latency ms', - data: quoteRequestLatencyData.data.map((d) => ({ x: d.x, y: d.y * 1000 })), - }); - } - - const transferRequestData = []; - if (prepareRateData) { - transferRequestData.push({ - chartType: 'line', - color: '#4fc7e7', - legendText: 'Requests/sec', - data: prepareRateData.data, - }); - } - if (transferLatencyData) { - transferRequestData.push({ - chartType: 'line', - color: '#12d670', - legendText: 'Latency ms', - data: transferLatencyData.data.map((d) => ({ x: d.x, y: d.y * 1000 })), - }); - } - - return ( -
- FXP Technical Dashboard - -
Connection Health
-
- -
-
Connected
- - -
Select Monitoring Time
-
- - onFilterChange({ field: 'selectedTimeFrame', value }) + // stupid prettier and eslint fighting each other! + // eslint-disable-next-line react/jsx-curly-newline + } + /> + + + + + Outbound + Inbound + + + + + + + + + + + + + + + {/* + + + + + + + + + + */} + + + + +
+ ); +}; + +export default loadTechnicalDashboard(connect(stateProps, dispatchProps)(FxpTechnicalDashboard)); diff --git a/src/App/FxpTechnicalDashboard/actions.ts b/src/App/FxpTechnicalDashboard/actions.ts index 701ae3d..67b5dc6 100644 --- a/src/App/FxpTechnicalDashboard/actions.ts +++ b/src/App/FxpTechnicalDashboard/actions.ts @@ -1,31 +1,31 @@ -import { RequestMetricAction } from 'App/types'; -import { - REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA, - SET_TECHNICAL_DASHBOARD_FILTERS, - RequestTechnicalDashboardPageDataAction, - SetTechnicalDashboardFiltersAction, -} from './types'; - -export function requestTechnicalDashboardPageData({ - metricRequests, -}: { - metricRequests: RequestMetricAction[]; -}): RequestTechnicalDashboardPageDataAction { - return { - type: REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA, - metricRequests, - }; -} - -export function setTechnicalDashboardFilters({ - field, - value, -}: { - field: string; - value: string | number; -}): SetTechnicalDashboardFiltersAction { - return { - type: SET_TECHNICAL_DASHBOARD_FILTERS, - data: { field, value }, - }; -} +import { RequestMetricAction } from 'App/types'; +import { + REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA, + SET_TECHNICAL_DASHBOARD_FILTERS, + RequestTechnicalDashboardPageDataAction, + SetTechnicalDashboardFiltersAction, +} from './types'; + +export function requestTechnicalDashboardPageData({ + metricRequests, +}: { + metricRequests: RequestMetricAction[]; +}): RequestTechnicalDashboardPageDataAction { + return { + type: REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA, + metricRequests, + }; +} + +export function setTechnicalDashboardFilters({ + field, + value, +}: { + field: string; + value: string | number; +}): SetTechnicalDashboardFiltersAction { + return { + type: SET_TECHNICAL_DASHBOARD_FILTERS, + data: { field, value }, + }; +} diff --git a/src/App/FxpTechnicalDashboard/hocs.tsx b/src/App/FxpTechnicalDashboard/hocs.tsx index 29b2ee8..930c6dd 100644 --- a/src/App/FxpTechnicalDashboard/hocs.tsx +++ b/src/App/FxpTechnicalDashboard/hocs.tsx @@ -1,33 +1,33 @@ -import React, { Component, FC } from 'react'; -import { connect } from 'react-redux'; -import { State, Dispatch } from 'store/types'; -import { RequestMetricAction } from 'App/types'; -import * as actions from './actions'; -import * as selectors from './selectors'; - -const stateProps = (state: State) => ({ - metricRequests: selectors.getMetricRequests(state), -}); - -const dispatchProps = (dispatch: Dispatch) => ({ - onTechnicalDashboardMount: (metricRequests: RequestMetricAction[]) => - dispatch(actions.requestTechnicalDashboardPageData({ metricRequests })), -}); - -type TechnicalDashboardLoaderProps = { - onTechnicalDashboardMount: (metricRequests: RequestMetricAction[]) => void; - metricRequests: RequestMetricAction[]; -}; - -export function loadTechnicalDashboard(TechnicalDashboard: FC) { - class TechnicalDashboardLoader extends Component { - componentDidMount() { - this.props.onTechnicalDashboardMount(this.props.metricRequests); - } - - render() { - return ; - } - } - return connect(stateProps, dispatchProps)(TechnicalDashboardLoader); -} +import React, { Component, FC } from 'react'; +import { connect } from 'react-redux'; +import { State, Dispatch } from 'store/types'; +import { RequestMetricAction } from 'App/types'; +import * as actions from './actions'; +import * as selectors from './selectors'; + +const stateProps = (state: State) => ({ + metricRequests: selectors.getMetricRequests(state), +}); + +const dispatchProps = (dispatch: Dispatch) => ({ + onTechnicalDashboardMount: (metricRequests: RequestMetricAction[]) => + dispatch(actions.requestTechnicalDashboardPageData({ metricRequests })), +}); + +type TechnicalDashboardLoaderProps = { + onTechnicalDashboardMount: (metricRequests: RequestMetricAction[]) => void; + metricRequests: RequestMetricAction[]; +}; + +export function loadTechnicalDashboard(TechnicalDashboard: FC) { + class TechnicalDashboardLoader extends Component { + componentDidMount() { + this.props.onTechnicalDashboardMount(this.props.metricRequests); + } + + render() { + return ; + } + } + return connect(stateProps, dispatchProps)(TechnicalDashboardLoader); +} diff --git a/src/App/FxpTechnicalDashboard/index.ts b/src/App/FxpTechnicalDashboard/index.ts index 912b4a8..5a8a070 100644 --- a/src/App/FxpTechnicalDashboard/index.ts +++ b/src/App/FxpTechnicalDashboard/index.ts @@ -1,10 +1,10 @@ -import withErrorBoundary from 'utils/hocs/withErrorBoundary'; -import { ComponentType } from 'react'; -import FxpTechnicalDashboard from './FxpDashboard'; -import * as actions from './actions'; -import * as selectors from './selectors'; -import reducer from './reducers'; -import * as types from './types'; - -export default withErrorBoundary(FxpTechnicalDashboard as ComponentType); -export { actions, reducer, selectors, types }; +import withErrorBoundary from 'utils/hocs/withErrorBoundary'; +import { ComponentType } from 'react'; +import FxpTechnicalDashboard from './FxpDashboard'; +import * as actions from './actions'; +import * as selectors from './selectors'; +import reducer from './reducers'; +import * as types from './types'; + +export default withErrorBoundary(FxpTechnicalDashboard as ComponentType); +export { actions, reducer, selectors, types }; diff --git a/src/App/FxpTechnicalDashboard/reducers.ts b/src/App/FxpTechnicalDashboard/reducers.ts index efc8955..cddaaec 100644 --- a/src/App/FxpTechnicalDashboard/reducers.ts +++ b/src/App/FxpTechnicalDashboard/reducers.ts @@ -1,188 +1,188 @@ -import { RequestMetricAction } from 'App/types'; -import { requestMetric } from 'App/actions'; -import { - TechnicalDashboardActionTypes, - TechnicalDashboardState, - TechnicalDashboardFilters, - SET_TECHNICAL_DASHBOARD_FILTERS, -} from './types'; - -const defaultTimeframeSeconds = 86400; - -export const getStartTimestamp = (secs: string | number) => { - const now = new Date(); - now.setSeconds(-secs); - return now; -}; - -export const getAggregateDurationFromTimeFrame = (secs: string | number) => { - // 1 hour - if (secs <= 3600) { - return 20; - } - // 2 hours - if (secs <= 7200) { - return 20; - } - // 4 hours - if (secs <= 14400) { - return 20; - } - // 8 hours - if (secs <= 28800) { - return 40; - } - // 12 hours - if (secs <= 43200) { - return 40; - } - // 24 hours - if (secs <= 86400) { - return 40; - } - // 48 hours - if (secs <= 172800) { - return 120; - } - // 1 week - if (secs <= 604800) { - return 120; - } - return 120; -}; - -export const getResolutionSecondsFromTimeFrame = (secs: string | number) => { - // 1 hour - if (secs <= 3600) { - return 20; - } - // 2 hours - if (secs <= 7200) { - return 20; - } - // 4 hours - if (secs <= 14400) { - return 20; - } - // 8 hours - if (secs <= 28800) { - return 40; - } - // 12 hours - if (secs <= 43200) { - return 40; - } - // 24 hours - if (secs <= 86400) { - return 40; - } - // 48 hours - if (secs <= 172800) { - return 120; - } - // 1 week - if (secs <= 604800) { - return 120; - } - return 120; -}; - -const getMetricRequests = (filters: TechnicalDashboardFilters): RequestMetricAction[] => { - const { startTimestamp, endTimestamp, aggregateDurationSeconds, resolutionSeconds } = filters; - - // default of 600,600 for request rate - // default of 20, 600 for latency - - return [ - requestMetric({ - metricName: 'mojaloop_connector_outbound_party_lookup_request_count', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_quote_request_count', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_transfer_prepare_count', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_party_lookup_latency', - metricType: 'HIST_SIZE', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_quote_request_latency', - metricType: 'HIST_SIZE', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_transfer_latency', - metricType: 'HIST_SIZE', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - ]; -}; - -const initialFilters = { - selectedTimeFrame: defaultTimeframeSeconds, - startTimestamp: getStartTimestamp(defaultTimeframeSeconds), - endTimestamp: new Date(), - aggregateDurationSeconds: 600, - resolutionSeconds: 600, - dfsp: undefined, -} as TechnicalDashboardFilters; - -export const initialState: TechnicalDashboardState = { - filters: initialFilters, - metricRequests: getMetricRequests(initialFilters), -}; - -export default function dashboardReducer( - state = initialState, - action: TechnicalDashboardActionTypes -): TechnicalDashboardState { - switch (action.type) { - case SET_TECHNICAL_DASHBOARD_FILTERS: - // eslint-disable-next-line no-case-declarations - const { field, value } = action.data; - - if (field === 'selectedTimeFrame') { - const filters = { - ...state.filters, - selectedTimeFrame: Number(value), - startTimestamp: getStartTimestamp(value), - endTimestamp: new Date(), - aggregateDurationSeconds: getAggregateDurationFromTimeFrame(value), - resolutionSeconds: getResolutionSecondsFromTimeFrame(value), - }; - - return { - ...state, - filters, - metricRequests: getMetricRequests(filters), - }; - } - return state; - default: - return state; - } -} +import { RequestMetricAction } from 'App/types'; +import { requestMetric } from 'App/actions'; +import { + TechnicalDashboardActionTypes, + TechnicalDashboardState, + TechnicalDashboardFilters, + SET_TECHNICAL_DASHBOARD_FILTERS, +} from './types'; + +const defaultTimeframeSeconds = 86400; + +export const getStartTimestamp = (secs: string | number) => { + const now = new Date(); + now.setSeconds(-secs); + return now; +}; + +export const getAggregateDurationFromTimeFrame = (secs: string | number) => { + // 1 hour + if (secs <= 3600) { + return 20; + } + // 2 hours + if (secs <= 7200) { + return 20; + } + // 4 hours + if (secs <= 14400) { + return 20; + } + // 8 hours + if (secs <= 28800) { + return 40; + } + // 12 hours + if (secs <= 43200) { + return 40; + } + // 24 hours + if (secs <= 86400) { + return 40; + } + // 48 hours + if (secs <= 172800) { + return 120; + } + // 1 week + if (secs <= 604800) { + return 120; + } + return 120; +}; + +export const getResolutionSecondsFromTimeFrame = (secs: string | number) => { + // 1 hour + if (secs <= 3600) { + return 20; + } + // 2 hours + if (secs <= 7200) { + return 20; + } + // 4 hours + if (secs <= 14400) { + return 20; + } + // 8 hours + if (secs <= 28800) { + return 40; + } + // 12 hours + if (secs <= 43200) { + return 40; + } + // 24 hours + if (secs <= 86400) { + return 40; + } + // 48 hours + if (secs <= 172800) { + return 120; + } + // 1 week + if (secs <= 604800) { + return 120; + } + return 120; +}; + +const getMetricRequests = (filters: TechnicalDashboardFilters): RequestMetricAction[] => { + const { startTimestamp, endTimestamp, aggregateDurationSeconds, resolutionSeconds } = filters; + + // default of 600,600 for request rate + // default of 20, 600 for latency + + return [ + requestMetric({ + metricName: 'mojaloop_connector_outbound_party_lookup_request_count', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_quote_request_count', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_transfer_prepare_count', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_party_lookup_latency', + metricType: 'HIST_SIZE', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_quote_request_latency', + metricType: 'HIST_SIZE', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_transfer_latency', + metricType: 'HIST_SIZE', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + ]; +}; + +const initialFilters = { + selectedTimeFrame: defaultTimeframeSeconds, + startTimestamp: getStartTimestamp(defaultTimeframeSeconds), + endTimestamp: new Date(), + aggregateDurationSeconds: 600, + resolutionSeconds: 600, + dfsp: undefined, +} as TechnicalDashboardFilters; + +export const initialState: TechnicalDashboardState = { + filters: initialFilters, + metricRequests: getMetricRequests(initialFilters), +}; + +export default function dashboardReducer( + state = initialState, + action: TechnicalDashboardActionTypes +): TechnicalDashboardState { + switch (action.type) { + case SET_TECHNICAL_DASHBOARD_FILTERS: + // eslint-disable-next-line no-case-declarations + const { field, value } = action.data; + + if (field === 'selectedTimeFrame') { + const filters = { + ...state.filters, + selectedTimeFrame: Number(value), + startTimestamp: getStartTimestamp(value), + endTimestamp: new Date(), + aggregateDurationSeconds: getAggregateDurationFromTimeFrame(value), + resolutionSeconds: getResolutionSecondsFromTimeFrame(value), + }; + + return { + ...state, + filters, + metricRequests: getMetricRequests(filters), + }; + } + return state; + default: + return state; + } +} diff --git a/src/App/FxpTechnicalDashboard/reducers.ts.new b/src/App/FxpTechnicalDashboard/reducers.ts.new index 97e3e8f..c1e7feb 100644 --- a/src/App/FxpTechnicalDashboard/reducers.ts.new +++ b/src/App/FxpTechnicalDashboard/reducers.ts.new @@ -1,190 +1,190 @@ -import { RequestMetricAction } from 'App/types'; -import { requestMetric } from 'App/actions'; -import { - TechnicalDashboardActionTypes, - TechnicalDashboardState, - TechnicalDashboardFilters, - SET_TECHNICAL_DASHBOARD_FILTERS, -} from './types'; - -const defaultTimeframeSeconds = 86400; - -export const getStartTimestamp = (secs: string | number) => { - const now = new Date(); - now.setSeconds(-secs); - return now; -}; - - -export const getAggregateDurationFromTimeFrame = (secs: string | number) => { - // 1 hour - if(secs <= 3600) { - return 20; - } - // 2 hours - if(secs <= 7200) { - return 20; - } - // 4 hours - if(secs <= 14400) { - return 20; - } - // 8 hours - if(secs <= 28800) { - return 40; - } - // 12 hours - if(secs <= 43200) { - return 40; - } - // 24 hours - if(secs <= 86400) { - return 40; - } - // 48 hours - if(secs <= 172800) { - return 120; - } - // 1 week - if(secs <= 604800) { - return 120; - } - return 120; -}; - - -export const getResolutionSecondsFromTimeFrame = (secs: string | number) => { - // 1 hour - if(secs <= 3600) { - return 20; - } - // 2 hours - if(secs <= 7200) { - return 20; - } - // 4 hours - if(secs <= 14400) { - return 20; - } - // 8 hours - if(secs <= 28800) { - return 40; - } - // 12 hours - if(secs <= 43200) { - return 40; - } - // 24 hours - if(secs <= 86400) { - return 40; - } - // 48 hours - if(secs <= 172800) { - return 120; - } - // 1 week - if(secs <= 604800) { - return 120; - } - return 120; -}; - -const getMetricRequests = (filters: TechnicalDashboardFilters): RequestMetricAction[] => { - const { startTimestamp, endTimestamp, aggregateDurationSeconds, resolutionSeconds } = filters; - - // default of 600,600 for request rate - // default of 20, 600 for latency - - return [ - requestMetric({ - metricName: 'mojaloop_connector_outbound_party_lookup_request_count', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_quote_request_count', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_transfer_prepare_count', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_party_lookup_latency', - metricType: 'HIST_SIZE', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_quote_request_latency', - metricType: 'HIST_SIZE', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - requestMetric({ - metricName: 'mojaloop_connector_outbound_transfer_latency', - metricType: 'HIST_SIZE', - startTimestamp: startTimestamp.toISOString(), - endTimestamp: endTimestamp.toISOString(), - aggregateDurationSeconds, - resolutionSeconds, - }), - ]; -}; - -const initialFilters = { - selectedTimeFrame: defaultTimeframeSeconds, - startTimestamp: getStartTimestamp(defaultTimeframeSeconds), - endTimestamp: new Date(), - aggregateDurationSeconds: 600, - resolutionSeconds: 600, - dfsp: undefined, -} as TechnicalDashboardFilters; - -export const initialState: TechnicalDashboardState = { - filters: initialFilters, - metricRequests: getMetricRequests(initialFilters), -}; - -export default function dashboardReducer( - state = initialState, - action: TechnicalDashboardActionTypes -): TechnicalDashboardState { - switch (action.type) { - case SET_TECHNICAL_DASHBOARD_FILTERS: - // eslint-disable-next-line no-case-declarations - const { field, value } = action.data; - - if (field === 'selectedTimeFrame') { - const filters = { - ...state.filters, - selectedTimeFrame: Number(value), - startTimestamp: getStartTimestamp(value), - endTimestamp: new Date(), - aggregateDurationSeconds: getAggregateDurationFromTimeFrame(value), - resolutionSeconds: getResolutionSecondsFromTimeFrame(value), - }; - - return { - ...state, - filters, - metricRequests: getMetricRequests(filters), - }; - } - return state; - default: - return state; - } -} +import { RequestMetricAction } from 'App/types'; +import { requestMetric } from 'App/actions'; +import { + TechnicalDashboardActionTypes, + TechnicalDashboardState, + TechnicalDashboardFilters, + SET_TECHNICAL_DASHBOARD_FILTERS, +} from './types'; + +const defaultTimeframeSeconds = 86400; + +export const getStartTimestamp = (secs: string | number) => { + const now = new Date(); + now.setSeconds(-secs); + return now; +}; + + +export const getAggregateDurationFromTimeFrame = (secs: string | number) => { + // 1 hour + if(secs <= 3600) { + return 20; + } + // 2 hours + if(secs <= 7200) { + return 20; + } + // 4 hours + if(secs <= 14400) { + return 20; + } + // 8 hours + if(secs <= 28800) { + return 40; + } + // 12 hours + if(secs <= 43200) { + return 40; + } + // 24 hours + if(secs <= 86400) { + return 40; + } + // 48 hours + if(secs <= 172800) { + return 120; + } + // 1 week + if(secs <= 604800) { + return 120; + } + return 120; +}; + + +export const getResolutionSecondsFromTimeFrame = (secs: string | number) => { + // 1 hour + if(secs <= 3600) { + return 20; + } + // 2 hours + if(secs <= 7200) { + return 20; + } + // 4 hours + if(secs <= 14400) { + return 20; + } + // 8 hours + if(secs <= 28800) { + return 40; + } + // 12 hours + if(secs <= 43200) { + return 40; + } + // 24 hours + if(secs <= 86400) { + return 40; + } + // 48 hours + if(secs <= 172800) { + return 120; + } + // 1 week + if(secs <= 604800) { + return 120; + } + return 120; +}; + +const getMetricRequests = (filters: TechnicalDashboardFilters): RequestMetricAction[] => { + const { startTimestamp, endTimestamp, aggregateDurationSeconds, resolutionSeconds } = filters; + + // default of 600,600 for request rate + // default of 20, 600 for latency + + return [ + requestMetric({ + metricName: 'mojaloop_connector_outbound_party_lookup_request_count', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_quote_request_count', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_transfer_prepare_count', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_party_lookup_latency', + metricType: 'HIST_SIZE', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_quote_request_latency', + metricType: 'HIST_SIZE', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + requestMetric({ + metricName: 'mojaloop_connector_outbound_transfer_latency', + metricType: 'HIST_SIZE', + startTimestamp: startTimestamp.toISOString(), + endTimestamp: endTimestamp.toISOString(), + aggregateDurationSeconds, + resolutionSeconds, + }), + ]; +}; + +const initialFilters = { + selectedTimeFrame: defaultTimeframeSeconds, + startTimestamp: getStartTimestamp(defaultTimeframeSeconds), + endTimestamp: new Date(), + aggregateDurationSeconds: 600, + resolutionSeconds: 600, + dfsp: undefined, +} as TechnicalDashboardFilters; + +export const initialState: TechnicalDashboardState = { + filters: initialFilters, + metricRequests: getMetricRequests(initialFilters), +}; + +export default function dashboardReducer( + state = initialState, + action: TechnicalDashboardActionTypes +): TechnicalDashboardState { + switch (action.type) { + case SET_TECHNICAL_DASHBOARD_FILTERS: + // eslint-disable-next-line no-case-declarations + const { field, value } = action.data; + + if (field === 'selectedTimeFrame') { + const filters = { + ...state.filters, + selectedTimeFrame: Number(value), + startTimestamp: getStartTimestamp(value), + endTimestamp: new Date(), + aggregateDurationSeconds: getAggregateDurationFromTimeFrame(value), + resolutionSeconds: getResolutionSecondsFromTimeFrame(value), + }; + + return { + ...state, + filters, + metricRequests: getMetricRequests(filters), + }; + } + return state; + default: + return state; + } +} diff --git a/src/App/FxpTechnicalDashboard/sagas.ts b/src/App/FxpTechnicalDashboard/sagas.ts index 2a791ff..3a4cb0b 100644 --- a/src/App/FxpTechnicalDashboard/sagas.ts +++ b/src/App/FxpTechnicalDashboard/sagas.ts @@ -1,33 +1,33 @@ -import { all, put, takeEvery, select } from 'redux-saga/effects'; -import { - REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA, - RequestTechnicalDashboardPageDataAction, - SET_TECHNICAL_DASHBOARD_FILTERS, - SetTechnicalDashboardFiltersAction, -} from './types'; - -import { requestTechnicalDashboardPageData as rtdpd } from './actions'; -import { getMetricRequests } from './selectors'; - -function* requestTechnicalDashboardPageData(action: RequestTechnicalDashboardPageDataAction) { - yield all(action.metricRequests.map((r) => put(r))); -} - -export function* requestTechnicalDashboardPageDataSaga() { - yield takeEvery([REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA], requestTechnicalDashboardPageData); -} - -// this is pretty dumb...we watch for an action changing one bit of state in order to trigger -// an action based on that new state...not loving react/redux at this point! -function* watchTechnicalDashboardFilters(action: SetTechnicalDashboardFiltersAction) { - const metricRequests = yield select(getMetricRequests); - yield put(rtdpd({ metricRequests })); -} - -export function* watchTechnicalDashboardFiltersSaga() { - yield takeEvery([SET_TECHNICAL_DASHBOARD_FILTERS], watchTechnicalDashboardFilters); -} - -export default function* rootSaga() { - yield all([requestTechnicalDashboardPageDataSaga(), watchTechnicalDashboardFiltersSaga()]); -} +import { all, put, takeEvery, select } from 'redux-saga/effects'; +import { + REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA, + RequestTechnicalDashboardPageDataAction, + SET_TECHNICAL_DASHBOARD_FILTERS, + SetTechnicalDashboardFiltersAction, +} from './types'; + +import { requestTechnicalDashboardPageData as rtdpd } from './actions'; +import { getMetricRequests } from './selectors'; + +function* requestTechnicalDashboardPageData(action: RequestTechnicalDashboardPageDataAction) { + yield all(action.metricRequests.map((r) => put(r))); +} + +export function* requestTechnicalDashboardPageDataSaga() { + yield takeEvery([REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA], requestTechnicalDashboardPageData); +} + +// this is pretty dumb...we watch for an action changing one bit of state in order to trigger +// an action based on that new state...not loving react/redux at this point! +function* watchTechnicalDashboardFilters(action: SetTechnicalDashboardFiltersAction) { + const metricRequests = yield select(getMetricRequests); + yield put(rtdpd({ metricRequests })); +} + +export function* watchTechnicalDashboardFiltersSaga() { + yield takeEvery([SET_TECHNICAL_DASHBOARD_FILTERS], watchTechnicalDashboardFilters); +} + +export default function* rootSaga() { + yield all([requestTechnicalDashboardPageDataSaga(), watchTechnicalDashboardFiltersSaga()]); +} diff --git a/src/App/FxpTechnicalDashboard/selectors.ts b/src/App/FxpTechnicalDashboard/selectors.ts index 6a02202..87c375c 100644 --- a/src/App/FxpTechnicalDashboard/selectors.ts +++ b/src/App/FxpTechnicalDashboard/selectors.ts @@ -1,48 +1,48 @@ -import { createSelector } from 'reselect'; -import { State } from 'store/types'; -import { MetricDataWrapper, MetricData, XYCoordinate, RequestMetricAction } from 'App/types'; -import { TechnicalDashboardFilters } from './types'; - -export const getRawMetricData = ( - state: State, - metricName: string -): MetricDataWrapper | undefined => { - if (state && state.app && state.app.metricsData && state.app.metricsData[metricName]) { - return state.app.metricsData[metricName]; - } - return undefined; -}; - -export const getMetricData = createSelector( - [getRawMetricData], - ( - metricWrapper: MetricDataWrapper | undefined - ): MetricDataWrapper | undefined => { - if (metricWrapper) { - // jump through hoops to keep typescript happy as we are converting - // from one generic type to another - const ret: MetricDataWrapper = { - metricName: metricWrapper.metricName, - startTimestamp: metricWrapper.startTimestamp, - endTimestamp: metricWrapper.endTimestamp, - data: [] as XYCoordinate[], - }; - - ret.data = metricWrapper.data.map((d: MetricData) => { - return { - x: d.timestamp, - y: d.value, - } as XYCoordinate; - }); - - return ret; - } - return undefined; - } -); - -export const getTechnicalDashboardFilters = (state: State): TechnicalDashboardFilters => - state.technicalDashboard.filters; - -export const getMetricRequests = (state: State): RequestMetricAction[] => - state.technicalDashboard.metricRequests; +import { createSelector } from 'reselect'; +import { State } from 'store/types'; +import { MetricDataWrapper, MetricData, XYCoordinate, RequestMetricAction } from 'App/types'; +import { TechnicalDashboardFilters } from './types'; + +export const getRawMetricData = ( + state: State, + metricName: string +): MetricDataWrapper | undefined => { + if (state && state.app && state.app.metricsData && state.app.metricsData[metricName]) { + return state.app.metricsData[metricName]; + } + return undefined; +}; + +export const getMetricData = createSelector( + [getRawMetricData], + ( + metricWrapper: MetricDataWrapper | undefined + ): MetricDataWrapper | undefined => { + if (metricWrapper) { + // jump through hoops to keep typescript happy as we are converting + // from one generic type to another + const ret: MetricDataWrapper = { + metricName: metricWrapper.metricName, + startTimestamp: metricWrapper.startTimestamp, + endTimestamp: metricWrapper.endTimestamp, + data: [] as XYCoordinate[], + }; + + ret.data = metricWrapper.data.map((d: MetricData) => { + return { + x: d.timestamp, + y: d.value, + } as XYCoordinate; + }); + + return ret; + } + return undefined; + } +); + +export const getTechnicalDashboardFilters = (state: State): TechnicalDashboardFilters => + state.technicalDashboard.filters; + +export const getMetricRequests = (state: State): RequestMetricAction[] => + state.technicalDashboard.metricRequests; diff --git a/src/App/FxpTechnicalDashboard/types.ts b/src/App/FxpTechnicalDashboard/types.ts index 3aeccdc..9b8c2b7 100644 --- a/src/App/FxpTechnicalDashboard/types.ts +++ b/src/App/FxpTechnicalDashboard/types.ts @@ -1,35 +1,35 @@ -import { RequestMetricAction } from 'App/types'; - -export const REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA = 'Technical Dashboard / Request Page Data'; -export const SET_TECHNICAL_DASHBOARD_FILTERS = 'Technical Dashboard / Set Filters'; - -export interface TechnicalDashboardState { - filters: TechnicalDashboardFilters; - metricRequests: RequestMetricAction[]; -} - -export interface TechnicalDashboardFilters { - selectedTimeFrame: number; - startTimestamp: Date; - endTimestamp: Date; - dfsp: string | undefined; - aggregateDurationSeconds: number; - resolutionSeconds: number; -} - -export interface RequestTechnicalDashboardPageDataAction { - type: typeof REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA; - metricRequests: RequestMetricAction[]; -} - -export interface SetTechnicalDashboardFiltersAction { - type: typeof SET_TECHNICAL_DASHBOARD_FILTERS; - data: { - field: string; - value: string | number; - }; -} - -export type TechnicalDashboardActionTypes = - | RequestTechnicalDashboardPageDataAction - | SetTechnicalDashboardFiltersAction; +import { RequestMetricAction } from 'App/types'; + +export const REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA = 'Technical Dashboard / Request Page Data'; +export const SET_TECHNICAL_DASHBOARD_FILTERS = 'Technical Dashboard / Set Filters'; + +export interface TechnicalDashboardState { + filters: TechnicalDashboardFilters; + metricRequests: RequestMetricAction[]; +} + +export interface TechnicalDashboardFilters { + selectedTimeFrame: number; + startTimestamp: Date; + endTimestamp: Date; + dfsp: string | undefined; + aggregateDurationSeconds: number; + resolutionSeconds: number; +} + +export interface RequestTechnicalDashboardPageDataAction { + type: typeof REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA; + metricRequests: RequestMetricAction[]; +} + +export interface SetTechnicalDashboardFiltersAction { + type: typeof SET_TECHNICAL_DASHBOARD_FILTERS; + data: { + field: string; + value: string | number; + }; +} + +export type TechnicalDashboardActionTypes = + | RequestTechnicalDashboardPageDataAction + | SetTechnicalDashboardFiltersAction; diff --git a/src/App/FxpTechnicalDashboard/types.ts.new b/src/App/FxpTechnicalDashboard/types.ts.new index 3aeccdc..9b8c2b7 100644 --- a/src/App/FxpTechnicalDashboard/types.ts.new +++ b/src/App/FxpTechnicalDashboard/types.ts.new @@ -1,35 +1,35 @@ -import { RequestMetricAction } from 'App/types'; - -export const REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA = 'Technical Dashboard / Request Page Data'; -export const SET_TECHNICAL_DASHBOARD_FILTERS = 'Technical Dashboard / Set Filters'; - -export interface TechnicalDashboardState { - filters: TechnicalDashboardFilters; - metricRequests: RequestMetricAction[]; -} - -export interface TechnicalDashboardFilters { - selectedTimeFrame: number; - startTimestamp: Date; - endTimestamp: Date; - dfsp: string | undefined; - aggregateDurationSeconds: number; - resolutionSeconds: number; -} - -export interface RequestTechnicalDashboardPageDataAction { - type: typeof REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA; - metricRequests: RequestMetricAction[]; -} - -export interface SetTechnicalDashboardFiltersAction { - type: typeof SET_TECHNICAL_DASHBOARD_FILTERS; - data: { - field: string; - value: string | number; - }; -} - -export type TechnicalDashboardActionTypes = - | RequestTechnicalDashboardPageDataAction - | SetTechnicalDashboardFiltersAction; +import { RequestMetricAction } from 'App/types'; + +export const REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA = 'Technical Dashboard / Request Page Data'; +export const SET_TECHNICAL_DASHBOARD_FILTERS = 'Technical Dashboard / Set Filters'; + +export interface TechnicalDashboardState { + filters: TechnicalDashboardFilters; + metricRequests: RequestMetricAction[]; +} + +export interface TechnicalDashboardFilters { + selectedTimeFrame: number; + startTimestamp: Date; + endTimestamp: Date; + dfsp: string | undefined; + aggregateDurationSeconds: number; + resolutionSeconds: number; +} + +export interface RequestTechnicalDashboardPageDataAction { + type: typeof REQUEST_TECHNICAL_DASHBOARD_PAGE_DATA; + metricRequests: RequestMetricAction[]; +} + +export interface SetTechnicalDashboardFiltersAction { + type: typeof SET_TECHNICAL_DASHBOARD_FILTERS; + data: { + field: string; + value: string | number; + }; +} + +export type TechnicalDashboardActionTypes = + | RequestTechnicalDashboardPageDataAction + | SetTechnicalDashboardFiltersAction; diff --git a/src/App/Layout/Container/Container.css b/src/App/Layout/Container/Container.css index 1f4f263..0a1020f 100644 --- a/src/App/Layout/Container/Container.css +++ b/src/App/Layout/Container/Container.css @@ -1,6 +1,6 @@ -.container { - height: 100%; - width: 100%; - display: flex; - flex-direction: column; -} +.container { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; +} diff --git a/src/App/Layout/Container/index.tsx b/src/App/Layout/Container/index.tsx index a022ec6..dd5ca54 100644 --- a/src/App/Layout/Container/index.tsx +++ b/src/App/Layout/Container/index.tsx @@ -1,10 +1,10 @@ -import React, { FC } from 'react'; -import './Container.css'; - -type Container = {}; - -const SideMenu: FC = ({ children }) => { - return
{children}
; -}; - -export default SideMenu; +import React, { FC } from 'react'; +import './Container.css'; + +type Container = {}; + +const SideMenu: FC = ({ children }) => { + return
{children}
; +}; + +export default SideMenu; diff --git a/src/App/Layout/Content/Content.css b/src/App/Layout/Content/Content.css index 9eb69e0..ade708f 100644 --- a/src/App/Layout/Content/Content.css +++ b/src/App/Layout/Content/Content.css @@ -1,8 +1,8 @@ -.content { - flex: 1 1 auto; - max-width: 100%; - display: flex; - flex-direction: row; - min-width: 0; - overflow: hidden; -} +.content { + flex: 1 1 auto; + max-width: 100%; + display: flex; + flex-direction: row; + min-width: 0; + overflow: hidden; +} diff --git a/src/App/Layout/Content/index.tsx b/src/App/Layout/Content/index.tsx index de07118..ddd4d77 100644 --- a/src/App/Layout/Content/index.tsx +++ b/src/App/Layout/Content/index.tsx @@ -1,10 +1,10 @@ -import React, { FC } from 'react'; -import './Content.css'; - -type ContentProps = {}; - -const Content: FC = ({ children }) => { - return
{children}
; -}; - -export default Content; +import React, { FC } from 'react'; +import './Content.css'; + +type ContentProps = {}; + +const Content: FC = ({ children }) => { + return
{children}
; +}; + +export default Content; diff --git a/src/App/Layout/Navbar/Navbar.css b/src/App/Layout/Navbar/Navbar.css index 01993ee..b6d8804 100644 --- a/src/App/Layout/Navbar/Navbar.css +++ b/src/App/Layout/Navbar/Navbar.css @@ -1,65 +1,65 @@ -#navbar { - flex: 0 0 55px; - width: 100%; - background: #987; - webkit-user-select: none; - user-select: none; - height: 55px; - width: 100%; - background: linear-gradient(269.81deg, #043865 0.01%, #02182b 100%); - border-bottom: 5px solid #4fc7e7; - display: flex; - align-items: center; -} - -#navbar__controls { - flex: 0 0 auto; -} -#navbar__link { - margin-left: 30px; - color: #fff; - font-size: 17px; - font-family: ubuntu; -} -#navbar__user { - flex: 0 1 auto; - display: flex; - justify-content: flex-end; - align-items: center; - padding-right: 20px; -} -#navbar__logout { - flex: 0 1 auto; - display: flex; - justify-content: flex-end; - align-items: center; - padding-right: 20px; - color: #fff; - cursor: pointer; -} -#navbar__user__icon { - align-items: center; - justify-content: center; - display: flex; - height: 30px; - width: 30px; - background: rgba(0, 0, 0, 0.4); - border-radius: 20px; - margin: 0px 20px; -} -#navbar__user__name { - color: #fff; -} -#navbar__active__connection { - flex: 1 1 auto; - display: flex; - justify-content: flex-end; - align-items: center; - color: #ffffff; -} -.navbar__connection-led { - height: 14px; - width: 14px; - border-radius: 50%; - margin-left: 10px; -} +#navbar { + flex: 0 0 55px; + width: 100%; + background: #987; + webkit-user-select: none; + user-select: none; + height: 55px; + width: 100%; + background: linear-gradient(269.81deg, #043865 0.01%, #02182b 100%); + border-bottom: 5px solid #4fc7e7; + display: flex; + align-items: center; +} + +#navbar__controls { + flex: 0 0 auto; +} +#navbar__link { + margin-left: 30px; + color: #fff; + font-size: 17px; + font-family: ubuntu; +} +#navbar__user { + flex: 0 1 auto; + display: flex; + justify-content: flex-end; + align-items: center; + padding-right: 20px; +} +#navbar__logout { + flex: 0 1 auto; + display: flex; + justify-content: flex-end; + align-items: center; + padding-right: 20px; + color: #fff; + cursor: pointer; +} +#navbar__user__icon { + align-items: center; + justify-content: center; + display: flex; + height: 30px; + width: 30px; + background: rgba(0, 0, 0, 0.4); + border-radius: 20px; + margin: 0px 20px; +} +#navbar__user__name { + color: #fff; +} +#navbar__active__connection { + flex: 1 1 auto; + display: flex; + justify-content: flex-end; + align-items: center; + color: #ffffff; +} +.navbar__connection-led { + height: 14px; + width: 14px; + border-radius: 50%; + margin-left: 10px; +} diff --git a/src/App/Layout/Navbar/index.tsx b/src/App/Layout/Navbar/index.tsx index 30daa31..cb4cd6e 100644 --- a/src/App/Layout/Navbar/index.tsx +++ b/src/App/Layout/Navbar/index.tsx @@ -1,63 +1,63 @@ -import React, { FC } from 'react'; -import { Icon } from 'components'; -import './Navbar.css'; - -type Navbar = { - username?: string; - logoutUrl?: string; - activeConnectionName: string; - activeConnectionStatusColor: string; - kratos?: boolean; -}; - -const Navbar: FC = ({ - username, - activeConnectionName, - activeConnectionStatusColor, - logoutUrl, - kratos, -}) => { - const clickFunc = () => { - if (logoutUrl) { - if (kratos) { - fetch(`${logoutUrl}`, { - headers: { - accept: 'application/json', - }, - }) - .then((response) => response.json()) - .then(({ logout_url }) => { - if (logout_url) window.location.assign(logout_url); - }); - } else window.location.href = logoutUrl; - } - }; - - return ( -