|
| 1 | +const routes = { |
| 2 | + dashboard: 'dashboard', |
| 3 | + userProfile: 'userProfile', |
| 4 | + settings: 'settings', |
| 5 | + |
| 6 | + devops: 'devops', |
| 7 | + extensions: 'extensions', |
| 8 | + extensionDevops: { |
| 9 | + name: 'devops.services.details', |
| 10 | + requires: 'id', |
| 11 | + }, |
| 12 | + extensionSettings: { |
| 13 | + name: 'settings.extensions', |
| 14 | + requires: 'id', |
| 15 | + }, |
| 16 | + |
| 17 | + subscriptions: 'subscriptions', |
| 18 | + subscriptionDetails: { |
| 19 | + name: 'subscriptions.directory.details', |
| 20 | + requires: 'id', |
| 21 | + }, |
| 22 | + fulfillmentRequests: { |
| 23 | + name: 'subscriptions', |
| 24 | + tab: 'fulfillment', |
| 25 | + }, |
| 26 | + fulfillmentRequestDetails: { |
| 27 | + name: 'subscriptions.fulfillment.details', |
| 28 | + requires: 'id', |
| 29 | + }, |
| 30 | + subscriptionsBillingRequests: { |
| 31 | + name: 'subscriptions', |
| 32 | + tab: 'billing', |
| 33 | + }, |
| 34 | + subscriptionsBillingRequestDetails: { |
| 35 | + name: 'subscriptions.billing.details', |
| 36 | + requires: 'id', |
| 37 | + }, |
| 38 | + tierConfigs: 'tierConfigs', |
| 39 | + tierConfigDetails: { |
| 40 | + name: 'tierConfigs.directory.details', |
| 41 | + requires: 'id', |
| 42 | + }, |
| 43 | + tierConfigRequests: { |
| 44 | + name: 'tierConfigs', |
| 45 | + tab: 'requests', |
| 46 | + }, |
| 47 | + tierConfigRequestDetails: { |
| 48 | + name: 'tierConfigs.requests.details', |
| 49 | + requires: 'id', |
| 50 | + }, |
| 51 | + products: 'products', |
| 52 | + productDetails: { |
| 53 | + name: 'product', |
| 54 | + requires: 'id', |
| 55 | + }, |
| 56 | + productItems: { |
| 57 | + name: 'product.items', |
| 58 | + requires: 'id', |
| 59 | + }, |
| 60 | + productParameters: { |
| 61 | + name: 'product.parameters', |
| 62 | + requires: 'id', |
| 63 | + }, |
| 64 | + productSettings: { |
| 65 | + name: 'product.settings', |
| 66 | + requires: 'id', |
| 67 | + }, |
| 68 | + productEmbedding: { |
| 69 | + name: 'product.embedding', |
| 70 | + requires: 'id', |
| 71 | + }, |
| 72 | + productVersions: { |
| 73 | + name: 'product.versions', |
| 74 | + requires: 'id', |
| 75 | + }, |
| 76 | + productLocalization: { |
| 77 | + name: 'product.localization', |
| 78 | + requires: 'id', |
| 79 | + }, |
| 80 | + productSSO: { |
| 81 | + name: 'product.ssoServices', |
| 82 | + requires: 'id', |
| 83 | + }, |
| 84 | + |
| 85 | + catalog: 'catalog', |
| 86 | + |
| 87 | + customers: 'customers', |
| 88 | + customerDetails: { |
| 89 | + name: 'customers.directory.details', |
| 90 | + requires: 'id', |
| 91 | + }, |
| 92 | + customerRequests: { |
| 93 | + name: 'customers', |
| 94 | + tab: 'requests', |
| 95 | + }, |
| 96 | + customerRequestsDetails: { |
| 97 | + name: 'customers.requests.details', |
| 98 | + requires: 'id', |
| 99 | + }, |
| 100 | + |
| 101 | + pricing: 'pricings', |
| 102 | + pricingDetails: { |
| 103 | + name: 'pricings.lists.details', |
| 104 | + requires: 'id', |
| 105 | + }, |
| 106 | + |
| 107 | + offers: 'offers', |
| 108 | + offerDetails: { |
| 109 | + name: 'offers.details', |
| 110 | + requires: 'id', |
| 111 | + }, |
| 112 | + |
| 113 | + helpdesk: 'helpdesk', |
| 114 | + helpdeskCaseDetails: { |
| 115 | + name: 'helpdesk.cases.details', |
| 116 | + requires: 'id', |
| 117 | + }, |
| 118 | + |
| 119 | + news: 'news', |
| 120 | + |
| 121 | + pim: 'pim', |
| 122 | + pimAttributes: 'pim.attributes', |
| 123 | + pimAttributeDetails: { |
| 124 | + name: 'pim.attributes.details', |
| 125 | + requires: 'id', |
| 126 | + }, |
| 127 | + pimGroups: 'pim.groups', |
| 128 | + pimGroupDetails: { |
| 129 | + name: 'pim.groups.details', |
| 130 | + requires: 'id', |
| 131 | + }, |
| 132 | + pimClassDetails: { |
| 133 | + name: 'pim.classes.details', |
| 134 | + requires: 'id', |
| 135 | + }, |
| 136 | + pimCategoryDetails: { |
| 137 | + name: 'pim.categories.details', |
| 138 | + requires: 'id', |
| 139 | + }, |
| 140 | + pimVariants: 'pim.variants', |
| 141 | + pimVariantDetails: { |
| 142 | + name: 'pim.variants.details', |
| 143 | + requires: 'id', |
| 144 | + }, |
| 145 | + |
| 146 | + marketplaces: 'marketplaces', |
| 147 | + marketplaceDetails: { |
| 148 | + name: 'marketplaces.details', |
| 149 | + requires: 'id', |
| 150 | + }, |
| 151 | + hubs: 'hubs', |
| 152 | + hubDetails: { |
| 153 | + name: 'hubs.details', |
| 154 | + requires: 'id', |
| 155 | + }, |
| 156 | + |
| 157 | + localizationContexts: { |
| 158 | + name: 'localization', |
| 159 | + tab: 'contexts', |
| 160 | + }, |
| 161 | + localizationTranslations: { |
| 162 | + name: 'localization', |
| 163 | + tab: 'translations', |
| 164 | + }, |
| 165 | + localizationTranslationDetails: { |
| 166 | + name: 'localization.translations.details', |
| 167 | + requires: 'id', |
| 168 | + }, |
| 169 | + localizationLocales: { |
| 170 | + name: 'localization', |
| 171 | + tab: 'locales', |
| 172 | + }, |
| 173 | + |
| 174 | + usage: 'usages', |
| 175 | + usageDetails: { |
| 176 | + name: 'usages.details', |
| 177 | + requires: 'id', |
| 178 | + }, |
| 179 | + |
| 180 | + listings: 'listings', |
| 181 | + listingsRequests: { |
| 182 | + name: 'listings', |
| 183 | + tab: 'requests', |
| 184 | + }, |
| 185 | + listingDetails: { |
| 186 | + name: 'listings.directory.details', |
| 187 | + requires: 'id', |
| 188 | + }, |
| 189 | + listingsRequestDetails: { |
| 190 | + name: 'listings.requests.details', |
| 191 | + requires: 'id', |
| 192 | + }, |
| 193 | + |
| 194 | + integrations: 'integrations', |
| 195 | + integrationsWebhooks: 'integrations.webhooks', |
| 196 | + integrationsTokens: 'integrations.tokens', |
| 197 | + integrationsExtensions: 'integrations.extensions', |
| 198 | + |
| 199 | + reports: 'reports', |
| 200 | + reportsSchedules: { |
| 201 | + name: 'reports', |
| 202 | + tab: 'schedules', |
| 203 | + }, |
| 204 | + reportDetails: { |
| 205 | + name: 'reports.details', |
| 206 | + requires: 'id', |
| 207 | + }, |
| 208 | + reportsRequestDetails: { |
| 209 | + name: 'reports.requests.details', |
| 210 | + requires: 'id', |
| 211 | + }, |
| 212 | + |
| 213 | + billingStreams: 'commerce.billing.streams', |
| 214 | + billingStreamDetails: { |
| 215 | + name: 'commerce.billing.streams.details', |
| 216 | + requires: 'id', |
| 217 | + }, |
| 218 | + billingBatches: 'commerce.billing.batches', |
| 219 | + billingBatchDetails: { |
| 220 | + name: 'commerce.billing.batches.details', |
| 221 | + requires: 'id', |
| 222 | + }, |
| 223 | + billingRequests: 'commerce.billing.requests', |
| 224 | + billingRequestDetails: { |
| 225 | + name: 'commerce.billing.requests.details', |
| 226 | + requires: 'id', |
| 227 | + }, |
| 228 | + |
| 229 | + pricingStreams: 'commerce.pricing.streams', |
| 230 | + pricingStreamDetails: { |
| 231 | + name: 'commerce.pricing.streams.details', |
| 232 | + requires: 'id', |
| 233 | + }, |
| 234 | + pricingBatches: 'commerce.pricing.batches', |
| 235 | + pricingBatchDetails: { |
| 236 | + name: 'commerce.pricing.batches.details', |
| 237 | + requires: 'id', |
| 238 | + }, |
| 239 | + pricingRequests: 'commerce.pricing.requests', |
| 240 | + pricingRequestDetails: { |
| 241 | + name: 'commerce.pricing.requests.details', |
| 242 | + requires: 'id', |
| 243 | + }, |
| 244 | + |
| 245 | + partners: 'partners', |
| 246 | + partnerDetails: { |
| 247 | + name: 'partners.details', |
| 248 | + requires: 'id', |
| 249 | + }, |
| 250 | + partnersForms: 'partners.forms', |
| 251 | + agreements: 'partners.agreements', |
| 252 | + agreementDetails: { |
| 253 | + name: 'partners.agreements.details', |
| 254 | + requires: 'id', |
| 255 | + }, |
| 256 | + contracts: 'partners.contracts', |
| 257 | + contractDetails: { |
| 258 | + name: 'partners.contracts.details', |
| 259 | + requires: 'id', |
| 260 | + }, |
| 261 | +}; |
| 262 | + |
| 263 | +export const connectPortalRoutesDict = Object.freeze(Object.keys(routes).reduce((acc, curr) => { |
| 264 | + acc[curr] = Symbol(curr); |
| 265 | + |
| 266 | + return acc; |
| 267 | +}, {})); |
| 268 | + |
| 269 | +// Transform all route keys to Symbol and freeze resulting object |
| 270 | +export const connectPortalRoutes = Object.freeze(Object.entries(routes).reduce((acc, [key, value]) => { |
| 271 | + acc[connectPortalRoutesDict[key]] = value; |
| 272 | + |
| 273 | + return acc; |
| 274 | +}, {})); |
0 commit comments