From 7d5ee756100354c374225406aec1ed1f57be69e9 Mon Sep 17 00:00:00 2001 From: Dexter Date: Thu, 17 Feb 2022 00:21:49 +0000 Subject: [PATCH] add apollo target nx script and run --- apps/explorer/project.json | 10 ++ .../explorer/src/__generated__/globalTypes.ts | 126 ++++++++++++++++++ .../assets/__generated__/AssetsQuery.ts | 2 +- .../__generated__/ProposalsQuery.ts | 2 +- .../markets/__generated__/MarketsQuery.ts | 2 +- .../id/__generated__/PartyAssetsQuery.ts | 2 +- .../validators/__generated__/NodesQuery.ts | 2 +- package.json | 3 +- 8 files changed, 142 insertions(+), 7 deletions(-) create mode 100644 apps/explorer/src/__generated__/globalTypes.ts diff --git a/apps/explorer/project.json b/apps/explorer/project.json index f3bee88e6..1b2ba94a7 100644 --- a/apps/explorer/project.json +++ b/apps/explorer/project.json @@ -64,6 +64,16 @@ "jestConfig": "apps/explorer/jest.config.js", "passWithNoTests": true } + }, + "generate": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "commands": [ + { + "command": "npx apollo codegen:generate --config=apps/explorer/apollo.config.js --target=typescript --globalTypesFile=apps/explorer/src/__generated__/globalTypes.ts" + } + ] + } } }, "tags": [] diff --git a/apps/explorer/src/__generated__/globalTypes.ts b/apps/explorer/src/__generated__/globalTypes.ts new file mode 100644 index 000000000..95fd90e8d --- /dev/null +++ b/apps/explorer/src/__generated__/globalTypes.ts @@ -0,0 +1,126 @@ +/* tslint:disable */ +/* eslint-disable */ +// @generated +// This file was automatically generated and should not be edited. + +//============================================================== +// START Enums and Input Objects +//============================================================== + +/** + * The various account types we have (used by collateral) + */ +export enum AccountType { + Bond = 'Bond', + FeeInfrastructure = 'FeeInfrastructure', + FeeLiquidity = 'FeeLiquidity', + General = 'General', + GlobalInsurance = 'GlobalInsurance', + Insurance = 'Insurance', + LockWithdraw = 'LockWithdraw', + Margin = 'Margin', + Settlement = 'Settlement', +} + +export enum AuctionTrigger { + Batch = 'Batch', + Liquidity = 'Liquidity', + Opening = 'Opening', + Price = 'Price', + Unspecified = 'Unspecified', +} + +/** + * The current state of a market + */ +export enum MarketState { + Active = 'Active', + Cancelled = 'Cancelled', + Closed = 'Closed', + Pending = 'Pending', + Proposed = 'Proposed', + Rejected = 'Rejected', + Settled = 'Settled', + Suspended = 'Suspended', + TradingTerminated = 'TradingTerminated', +} + +/** + * What market trading mode are we in + */ +export enum MarketTradingMode { + BatchAuction = 'BatchAuction', + Continuous = 'Continuous', + MonitoringAuction = 'MonitoringAuction', + OpeningAuction = 'OpeningAuction', +} + +export enum NodeStatus { + NonValidator = 'NonValidator', + Validator = 'Validator', +} + +/** + * Reason for the proposal being rejected by the core node + */ +export enum ProposalRejectionReason { + CloseTimeTooLate = 'CloseTimeTooLate', + CloseTimeTooSoon = 'CloseTimeTooSoon', + CouldNotInstantiateMarket = 'CouldNotInstantiateMarket', + EnactTimeTooLate = 'EnactTimeTooLate', + EnactTimeTooSoon = 'EnactTimeTooSoon', + IncompatibleTimestamps = 'IncompatibleTimestamps', + InsufficientTokens = 'InsufficientTokens', + InvalidAsset = 'InvalidAsset', + InvalidAssetDetails = 'InvalidAssetDetails', + InvalidFeeAmount = 'InvalidFeeAmount', + InvalidFutureMaturityTimestamp = 'InvalidFutureMaturityTimestamp', + InvalidFutureProduct = 'InvalidFutureProduct', + InvalidInstrumentSecurity = 'InvalidInstrumentSecurity', + InvalidRiskParameter = 'InvalidRiskParameter', + InvalidShape = 'InvalidShape', + MajorityThresholdNotReached = 'MajorityThresholdNotReached', + MarketMissingLiquidityCommitment = 'MarketMissingLiquidityCommitment', + MissingBuiltinAssetField = 'MissingBuiltinAssetField', + MissingCommitmentAmount = 'MissingCommitmentAmount', + MissingERC20ContractAddress = 'MissingERC20ContractAddress', + NetworkParameterInvalidKey = 'NetworkParameterInvalidKey', + NetworkParameterInvalidValue = 'NetworkParameterInvalidValue', + NetworkParameterValidationFailed = 'NetworkParameterValidationFailed', + NoProduct = 'NoProduct', + NoRiskParameters = 'NoRiskParameters', + NoTradingMode = 'NoTradingMode', + NodeValidationFailed = 'NodeValidationFailed', + OpeningAuctionDurationTooLarge = 'OpeningAuctionDurationTooLarge', + OpeningAuctionDurationTooSmall = 'OpeningAuctionDurationTooSmall', + ParticipationThresholdNotReached = 'ParticipationThresholdNotReached', + ProductMaturityIsPassed = 'ProductMaturityIsPassed', + UnsupportedProduct = 'UnsupportedProduct', + UnsupportedTradingMode = 'UnsupportedTradingMode', +} + +/** + * Various states a proposal can transition through: + * Open -> + * - Passed -> Enacted. + * - Rejected. + * Proposal can enter Failed state from any other state. + */ +export enum ProposalState { + Declined = 'Declined', + Enacted = 'Enacted', + Failed = 'Failed', + Open = 'Open', + Passed = 'Passed', + Rejected = 'Rejected', + WaitingForNodeVote = 'WaitingForNodeVote', +} + +export enum VoteValue { + No = 'No', + Yes = 'Yes', +} + +//============================================================== +// END Enums and Input Objects +//============================================================== diff --git a/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts b/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts index 966cafc71..ae0f80b04 100644 --- a/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts +++ b/apps/explorer/src/app/routes/assets/__generated__/AssetsQuery.ts @@ -3,7 +3,7 @@ // @generated // This file was automatically generated and should not be edited. -import { AccountType } from '../../../__generated__/globalTypes'; +import { AccountType } from './../../../../__generated__/globalTypes'; // ==================================================== // GraphQL query operation: AssetsQuery diff --git a/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts b/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts index 44688a848..c19e3ff2d 100644 --- a/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts +++ b/apps/explorer/src/app/routes/governance/__generated__/ProposalsQuery.ts @@ -7,7 +7,7 @@ import { ProposalState, ProposalRejectionReason, VoteValue, -} from '../../../__generated__/globalTypes'; +} from './../../../../__generated__/globalTypes'; // ==================================================== // GraphQL query operation: ProposalsQuery diff --git a/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts b/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts index cfee79215..49f849c78 100644 --- a/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts +++ b/apps/explorer/src/app/routes/markets/__generated__/MarketsQuery.ts @@ -8,7 +8,7 @@ import { MarketState, AccountType, AuctionTrigger, -} from '../../../__generated__/globalTypes'; +} from './../../../../__generated__/globalTypes'; // ==================================================== // GraphQL query operation: MarketsQuery diff --git a/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts b/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts index e613eea6d..7136fa8f2 100644 --- a/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts +++ b/apps/explorer/src/app/routes/parties/id/__generated__/PartyAssetsQuery.ts @@ -3,7 +3,7 @@ // @generated // This file was automatically generated and should not be edited. -import { AccountType } from '../../../../__generated__/globalTypes'; +import { AccountType } from './../../../../../__generated__/globalTypes'; // ==================================================== // GraphQL query operation: PartyAssetsQuery diff --git a/apps/explorer/src/app/routes/validators/__generated__/NodesQuery.ts b/apps/explorer/src/app/routes/validators/__generated__/NodesQuery.ts index 9c9d4d1eb..e926f6466 100644 --- a/apps/explorer/src/app/routes/validators/__generated__/NodesQuery.ts +++ b/apps/explorer/src/app/routes/validators/__generated__/NodesQuery.ts @@ -3,7 +3,7 @@ // @generated // This file was automatically generated and should not be edited. -import { NodeStatus } from '../../../__generated__/globalTypes'; +import { NodeStatus } from './../../../../__generated__/globalTypes'; // ==================================================== // GraphQL query operation: NodesQuery diff --git a/package.json b/package.json index 296eca1ec..e72eafc1f 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,7 @@ "start": "nx serve", "build": "nx build", "test": "nx test", - "postinstall": "husky install", - "generate": "env-cmd yarn apollo codegen:generate --config=apps/explorer/apollo.config.js --target=typescript --globalTypesFile=src/__generated__/globalTypes.ts" + "postinstall": "husky install" }, "engines": { "node": "16.14.0"