talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 1 | /*! |
svishnev | bacc715 | 2018-11-05 12:11:30 +0200 | [diff] [blame] | 2 | * Copyright © 2016-2018 European Support Limited |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 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 | */ |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 16 | import keyMirror from 'nfvo-utils/KeyMirror.js'; |
| 17 | |
svishnev | bacc715 | 2018-11-05 12:11:30 +0200 | [diff] [blame] | 18 | export const actionTypes = keyMirror( |
| 19 | { |
| 20 | LOAD_CONFLICTS: null, |
| 21 | ADD_ACTIONS: null, |
| 22 | LOAD_CONFLICT: null, |
| 23 | DATA_PROCESSED: null |
| 24 | }, |
| 25 | 'mergeEditor' |
| 26 | ); |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 27 | |
| 28 | export const rules = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 29 | SKIP: 'skip', |
| 30 | PARSE: 'parse', |
| 31 | FUNCTION: 'function', |
| 32 | BOOLEAN: 'boolean' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | export const SyncStates = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 36 | MERGE: 'Merging', |
| 37 | OUT_OF_SYNC: 'OutOfSync', |
| 38 | UP_TO_DATE: 'UpToDate' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | export const ResolutionTypes = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 42 | YOURS: 'YOURS', |
| 43 | THEIRS: 'THEIRS' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | export const fileTypes = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 47 | LKG: 'LicenseKeyGroup', |
| 48 | VLM: 'VendorLicenseModel', |
| 49 | EP: 'EntitlementPool', |
| 50 | FG: 'FeatureGroup', |
| 51 | LA: 'LicenseAgreement', |
| 52 | VSP: 'VendorSoftwareProduct', |
| 53 | LIMIT: 'Limit', |
| 54 | VSP_Q: 'VSPQuestionnaire', |
| 55 | COMPONENT: 'Component', |
| 56 | COMPONENT_Q: 'ComponentQuestionnaire', |
| 57 | COMPONENT_DEP: 'ComponentDependencies', |
| 58 | COMPUTE_Q: 'ComputeQuestionnaire', |
| 59 | COMPUTE: 'Compute', |
| 60 | COMPUTE_FLAVOR: 'ComputeFlavor', |
| 61 | NIC: 'Nic', |
| 62 | NIC_Q: 'NicQuestionnaire', |
| 63 | IMAGE: 'Image', |
| 64 | IMAGE_Q: 'ImageQuestionnaire', |
| 65 | PROCESS: 'Process', |
| 66 | DEPLOYMENT_FLAVOR: 'DeploymentFlavor', |
| 67 | VENDOR: 'Vendor', |
| 68 | NETWORK: 'Network', |
| 69 | ORCHESTRATION_TEMPLATE_CANDIDATE: 'OrchestrationTemplateCandidate' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 70 | }; |
| 71 | |
| 72 | export const dataRules = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 73 | general: { |
| 74 | id: { |
| 75 | rule: rules.SKIP |
| 76 | }, |
| 77 | questionareData: { |
| 78 | rule: rules.PARSE, |
| 79 | moveFields: true |
| 80 | }, |
| 81 | startDate: { |
| 82 | rule: rules.FUNCTION, |
| 83 | functionName: 'parseDate' |
| 84 | }, |
| 85 | expiryDate: { |
| 86 | rule: rules.FUNCTION, |
| 87 | functionName: 'parseDate' |
| 88 | }, |
| 89 | featureGroups: { |
| 90 | rule: rules.FUNCTION, |
| 91 | functionName: 'reduceList', |
| 92 | args: { subField: 'name' } |
| 93 | }, |
| 94 | licenseKeyGroups: { |
| 95 | rule: rules.FUNCTION, |
| 96 | functionName: 'reduceList', |
| 97 | args: { subField: 'name' } |
| 98 | }, |
| 99 | entitlementPools: { |
| 100 | rule: rules.FUNCTION, |
| 101 | functionName: 'reduceList', |
| 102 | args: { subField: 'name' } |
| 103 | } |
| 104 | }, |
| 105 | [fileTypes.COMPONENT]: {}, |
| 106 | [fileTypes.COMPUTE_FLAVOR]: { |
| 107 | associatedToDeploymentFlavor: { |
| 108 | rule: rules.BOOLEAN, |
| 109 | trueValue: 'true' |
| 110 | } |
| 111 | }, |
| 112 | [fileTypes.COMPUTE_Q]: {}, |
| 113 | [fileTypes.COMPONENT_Q]: { |
| 114 | isComponentMandatory: { |
| 115 | rule: rules.BOOLEAN, |
| 116 | trueValue: 'YES', |
| 117 | falseValue: 'NO' |
| 118 | } |
| 119 | }, |
| 120 | [fileTypes.EP]: { |
| 121 | referencingFeatureGroups: { |
| 122 | rule: rules.SKIP, |
| 123 | functionName: 'getFeatureGroups' |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 124 | } |
| 125 | }, |
| 126 | [fileTypes.FG]: { |
| 127 | referencingLicenseAgreements: { |
| 128 | rule: rules.SKIP, |
| 129 | functionName: 'getLicenseAgreements' |
| 130 | } |
| 131 | }, |
| 132 | [fileTypes.LA]: { |
| 133 | licenseTerm: { |
| 134 | rule: rules.FUNCTION, |
| 135 | functionName: 'processChoice' |
| 136 | } |
| 137 | }, |
| 138 | [fileTypes.LIMIT]: { |
| 139 | type: { |
| 140 | rule: rules.FUNCTION, |
| 141 | functionName: 'getEnumValue', |
| 142 | args: { listName: 'limitType' } |
| 143 | }, |
| 144 | unit: { |
| 145 | rule: rules.FUNCTION, |
| 146 | functionName: 'getEnumValue', |
| 147 | args: { listName: 'limitUnit' } |
| 148 | } |
| 149 | }, |
| 150 | [fileTypes.LKG]: { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 151 | referencingFeatureGroups: { |
| 152 | rule: rules.SKIP, |
| 153 | functionName: 'getFeatureGroups' |
| 154 | } |
| 155 | }, |
| 156 | [fileTypes.NIC]: { |
| 157 | networkId: { |
| 158 | rule: rules.SKIP |
| 159 | } |
| 160 | }, |
| 161 | [fileTypes.NIC_Q]: {}, |
| 162 | [fileTypes.PROCESS]: { |
| 163 | type: { |
| 164 | rule: rules.FUNCTION, |
| 165 | functionName: 'getEnumValue', |
| 166 | args: { listName: 'processType' } |
| 167 | } |
| 168 | }, |
| 169 | [fileTypes.VLM]: { |
| 170 | iconRef: { |
| 171 | rule: rules.SKIP |
| 172 | } |
| 173 | }, |
| 174 | [fileTypes.VSP]: { |
| 175 | vendorId: { |
| 176 | rule: rules.SKIP |
| 177 | }, |
| 178 | onboardingMethod: { |
| 179 | rule: rules.SKIP |
| 180 | }, |
| 181 | validationData: { |
| 182 | rule: rules.SKIP |
| 183 | }, |
| 184 | isOldVersion: { |
| 185 | rule: rules.SKIP |
| 186 | }, |
| 187 | licensingVersion: { |
| 188 | rule: rules.FUNCTION, |
| 189 | functionName: 'fetchLMVersion' |
| 190 | }, |
| 191 | category: { |
| 192 | rule: rules.FUNCTION, |
| 193 | functionName: 'fetchCategory' |
| 194 | }, |
| 195 | subCategory: { |
| 196 | rule: rules.SKIP |
| 197 | } |
| 198 | }, |
| 199 | [fileTypes.VSP_Q]: { |
| 200 | affinityData: { |
| 201 | rule: rules.SKIP |
| 202 | }, |
| 203 | storageReplicationAcrossRegion: { |
| 204 | rule: rules.BOOLEAN, |
| 205 | trueValue: 'true', |
| 206 | falseValue: 'false' |
| 207 | } |
| 208 | }, |
| 209 | [fileTypes.ORCHESTRATION_TEMPLATE_CANDIDATE]: { |
| 210 | modules: { |
| 211 | rule: rules.FUNCTION, |
| 212 | functionName: 'convertArrayToObject' |
| 213 | } |
| 214 | } |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 215 | }; |