talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 1 | /*! |
| 2 | * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 13 | * or implied. See the License for the specific language governing |
| 14 | * permissions and limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | import keyMirror from 'nfvo-utils/KeyMirror.js'; |
| 18 | |
| 19 | export const actionTypes = keyMirror({ |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 20 | LOAD_CONFLICTS: null, |
| 21 | ADD_ACTIONS: null, |
| 22 | LOAD_CONFLICT: null, |
| 23 | DATA_PROCESSED: null |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 24 | }); |
| 25 | |
| 26 | export const rules = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 27 | SKIP: 'skip', |
| 28 | PARSE: 'parse', |
| 29 | FUNCTION: 'function', |
| 30 | BOOLEAN: 'boolean' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | export const SyncStates = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 34 | MERGE: 'Merging', |
| 35 | OUT_OF_SYNC: 'OutOfSync', |
| 36 | UP_TO_DATE: 'UpToDate' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | export const ResolutionTypes = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 40 | YOURS: 'YOURS', |
| 41 | THEIRS: 'THEIRS' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | export const fileTypes = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 45 | LKG: 'LicenseKeyGroup', |
| 46 | VLM: 'VendorLicenseModel', |
| 47 | EP: 'EntitlementPool', |
| 48 | FG: 'FeatureGroup', |
| 49 | LA: 'LicenseAgreement', |
| 50 | VSP: 'VendorSoftwareProduct', |
| 51 | LIMIT: 'Limit', |
| 52 | VSP_Q: 'VSPQuestionnaire', |
| 53 | COMPONENT: 'Component', |
| 54 | COMPONENT_Q: 'ComponentQuestionnaire', |
| 55 | COMPONENT_DEP: 'ComponentDependencies', |
| 56 | COMPUTE_Q: 'ComputeQuestionnaire', |
| 57 | COMPUTE: 'Compute', |
| 58 | COMPUTE_FLAVOR: 'ComputeFlavor', |
| 59 | NIC: 'Nic', |
| 60 | NIC_Q: 'NicQuestionnaire', |
| 61 | IMAGE: 'Image', |
| 62 | IMAGE_Q: 'ImageQuestionnaire', |
| 63 | PROCESS: 'Process', |
| 64 | DEPLOYMENT_FLAVOR: 'DeploymentFlavor', |
| 65 | VENDOR: 'Vendor', |
| 66 | NETWORK: 'Network', |
| 67 | ORCHESTRATION_TEMPLATE_CANDIDATE: 'OrchestrationTemplateCandidate' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | export const dataRules = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 71 | general: { |
| 72 | id: { |
| 73 | rule: rules.SKIP |
| 74 | }, |
| 75 | questionareData: { |
| 76 | rule: rules.PARSE, |
| 77 | moveFields: true |
| 78 | }, |
| 79 | startDate: { |
| 80 | rule: rules.FUNCTION, |
| 81 | functionName: 'parseDate' |
| 82 | }, |
| 83 | expiryDate: { |
| 84 | rule: rules.FUNCTION, |
| 85 | functionName: 'parseDate' |
| 86 | }, |
| 87 | featureGroups: { |
| 88 | rule: rules.FUNCTION, |
| 89 | functionName: 'reduceList', |
| 90 | args: { subField: 'name' } |
| 91 | }, |
| 92 | licenseKeyGroups: { |
| 93 | rule: rules.FUNCTION, |
| 94 | functionName: 'reduceList', |
| 95 | args: { subField: 'name' } |
| 96 | }, |
| 97 | entitlementPools: { |
| 98 | rule: rules.FUNCTION, |
| 99 | functionName: 'reduceList', |
| 100 | args: { subField: 'name' } |
| 101 | } |
| 102 | }, |
| 103 | [fileTypes.COMPONENT]: {}, |
| 104 | [fileTypes.COMPUTE_FLAVOR]: { |
| 105 | associatedToDeploymentFlavor: { |
| 106 | rule: rules.BOOLEAN, |
| 107 | trueValue: 'true' |
| 108 | } |
| 109 | }, |
| 110 | [fileTypes.COMPUTE_Q]: {}, |
| 111 | [fileTypes.COMPONENT_Q]: { |
| 112 | isComponentMandatory: { |
| 113 | rule: rules.BOOLEAN, |
| 114 | trueValue: 'YES', |
| 115 | falseValue: 'NO' |
| 116 | } |
| 117 | }, |
| 118 | [fileTypes.EP]: { |
| 119 | referencingFeatureGroups: { |
| 120 | rule: rules.SKIP, |
| 121 | functionName: 'getFeatureGroups' |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 122 | } |
| 123 | }, |
| 124 | [fileTypes.FG]: { |
| 125 | referencingLicenseAgreements: { |
| 126 | rule: rules.SKIP, |
| 127 | functionName: 'getLicenseAgreements' |
| 128 | } |
| 129 | }, |
| 130 | [fileTypes.LA]: { |
| 131 | licenseTerm: { |
| 132 | rule: rules.FUNCTION, |
| 133 | functionName: 'processChoice' |
| 134 | } |
| 135 | }, |
| 136 | [fileTypes.LIMIT]: { |
| 137 | type: { |
| 138 | rule: rules.FUNCTION, |
| 139 | functionName: 'getEnumValue', |
| 140 | args: { listName: 'limitType' } |
| 141 | }, |
| 142 | unit: { |
| 143 | rule: rules.FUNCTION, |
| 144 | functionName: 'getEnumValue', |
| 145 | args: { listName: 'limitUnit' } |
| 146 | } |
| 147 | }, |
| 148 | [fileTypes.LKG]: { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 149 | referencingFeatureGroups: { |
| 150 | rule: rules.SKIP, |
| 151 | functionName: 'getFeatureGroups' |
| 152 | } |
| 153 | }, |
| 154 | [fileTypes.NIC]: { |
| 155 | networkId: { |
| 156 | rule: rules.SKIP |
| 157 | } |
| 158 | }, |
| 159 | [fileTypes.NIC_Q]: {}, |
| 160 | [fileTypes.PROCESS]: { |
| 161 | type: { |
| 162 | rule: rules.FUNCTION, |
| 163 | functionName: 'getEnumValue', |
| 164 | args: { listName: 'processType' } |
| 165 | } |
| 166 | }, |
| 167 | [fileTypes.VLM]: { |
| 168 | iconRef: { |
| 169 | rule: rules.SKIP |
| 170 | } |
| 171 | }, |
| 172 | [fileTypes.VSP]: { |
| 173 | vendorId: { |
| 174 | rule: rules.SKIP |
| 175 | }, |
| 176 | onboardingMethod: { |
| 177 | rule: rules.SKIP |
| 178 | }, |
| 179 | validationData: { |
| 180 | rule: rules.SKIP |
| 181 | }, |
| 182 | isOldVersion: { |
| 183 | rule: rules.SKIP |
| 184 | }, |
| 185 | licensingVersion: { |
| 186 | rule: rules.FUNCTION, |
| 187 | functionName: 'fetchLMVersion' |
| 188 | }, |
| 189 | category: { |
| 190 | rule: rules.FUNCTION, |
| 191 | functionName: 'fetchCategory' |
| 192 | }, |
| 193 | subCategory: { |
| 194 | rule: rules.SKIP |
| 195 | } |
| 196 | }, |
| 197 | [fileTypes.VSP_Q]: { |
| 198 | affinityData: { |
| 199 | rule: rules.SKIP |
| 200 | }, |
| 201 | storageReplicationAcrossRegion: { |
| 202 | rule: rules.BOOLEAN, |
| 203 | trueValue: 'true', |
| 204 | falseValue: 'false' |
| 205 | } |
| 206 | }, |
| 207 | [fileTypes.ORCHESTRATION_TEMPLATE_CANDIDATE]: { |
| 208 | modules: { |
| 209 | rule: rules.FUNCTION, |
| 210 | functionName: 'convertArrayToObject' |
| 211 | } |
| 212 | } |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 213 | }; |