@simpleapps-com/augur-server 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2050,69 +2050,201 @@ function createSiteActions(api, config = {}) {
2050
2050
  function castApi() {
2051
2051
  return api;
2052
2052
  }
2053
- return {
2054
- pricing: createPricingActions(castApi(), {
2053
+ function lazy(fn) {
2054
+ let instance;
2055
+ return {
2056
+ get() {
2057
+ if (instance === void 0) instance = fn();
2058
+ return instance;
2059
+ }
2060
+ };
2061
+ }
2062
+ const pricing = lazy(
2063
+ () => createPricingActions(castApi(), {
2055
2064
  ...cache,
2056
2065
  defaultCustomerId,
2057
2066
  ...config.pricing
2058
- }),
2059
- items: createItemActions(castApi(), {
2067
+ })
2068
+ );
2069
+ const items = lazy(
2070
+ () => createItemActions(castApi(), {
2060
2071
  ...longCache,
2061
2072
  ...config.items
2062
- }),
2063
- commerce: createCommerceActions(castApi(), {
2073
+ })
2074
+ );
2075
+ const commerce = lazy(
2076
+ () => createCommerceActions(castApi(), {
2064
2077
  defaultContactId,
2065
2078
  defaultCustomerId,
2066
2079
  convertUnitOfMeasure
2067
- }),
2068
- search: createSearchActions(castApi(), {
2080
+ })
2081
+ );
2082
+ const search = lazy(
2083
+ () => createSearchActions(castApi(), {
2069
2084
  ...cache,
2070
2085
  ...config.search
2071
- }),
2072
- orders: createOrderActions(castApi(), cache),
2073
- shipping: createShippingActions(
2086
+ })
2087
+ );
2088
+ const orders = lazy(
2089
+ () => createOrderActions(castApi(), cache)
2090
+ );
2091
+ const shipping = lazy(
2092
+ () => createShippingActions(
2074
2093
  castApi(),
2075
2094
  { ...cache, ...config.shipping }
2076
- ),
2077
- joomla: createJoomlaActions(castApi(), cache),
2078
- legacy: createLegacyActions(castApi(), longCache),
2079
- customers: createCustomersActions(castApi(), cache),
2080
- smartyStreets: createSmartyStreetsActions(
2081
- castApi(),
2082
- { cachePrefix }
2083
- ),
2084
- p21Pim: createP21PimActions(castApi(), cache),
2085
- agrSite: createAgrSiteActions(castApi(), {
2095
+ )
2096
+ );
2097
+ const joomla = lazy(
2098
+ () => createJoomlaActions(castApi(), cache)
2099
+ );
2100
+ const legacy = lazy(
2101
+ () => createLegacyActions(castApi(), longCache)
2102
+ );
2103
+ const customers = lazy(
2104
+ () => createCustomersActions(castApi(), cache)
2105
+ );
2106
+ const smartyStreets = lazy(
2107
+ () => createSmartyStreetsActions(castApi(), {
2108
+ cachePrefix
2109
+ })
2110
+ );
2111
+ const p21Pim = lazy(
2112
+ () => createP21PimActions(castApi(), cache)
2113
+ );
2114
+ const agrSite = lazy(
2115
+ () => createAgrSiteActions(castApi(), {
2086
2116
  cachePrefix,
2087
2117
  longEdgeCache,
2088
2118
  longRedisTtl
2089
- }),
2090
- avalara: createAvalaraActions(castApi(), { cachePrefix }),
2091
- payments: createPaymentsActions(castApi(), {
2092
- cachePrefix
2093
- }),
2094
- ups: createUpsActions(castApi(), { cachePrefix }),
2095
- logistics: createLogisticsActions(castApi(), longCache),
2096
- nexus: createNexusActions(castApi(), cache),
2097
- vmi: createVmiActions(castApi(), {
2098
- ...cache,
2099
- ...config.vmi
2100
- }),
2101
- p21Core: createP21CoreActions(castApi(), longCache),
2102
- p21Apis: createP21ApisActions(castApi(), cache),
2103
- p21Sism: createP21SismActions(castApi(), cache),
2104
- agrWork: createAgrWorkActions(castApi(), { cachePrefix }),
2105
- agrInfo: createAgrInfoActions(castApi(), longCache),
2106
- basecamp2: createBasecamp2Actions(castApi(), longCache),
2107
- brandFolder: createBrandFolderActions(
2108
- castApi(),
2109
- cache
2110
- ),
2111
- gregorovich: createGregorovichActions(
2112
- castApi(),
2113
- cache
2114
- ),
2115
- slack: createSlackActions(castApi(), cache)
2119
+ })
2120
+ );
2121
+ const avalara = lazy(
2122
+ () => createAvalaraActions(castApi(), { cachePrefix })
2123
+ );
2124
+ const payments = lazy(
2125
+ () => createPaymentsActions(castApi(), { cachePrefix })
2126
+ );
2127
+ const ups = lazy(
2128
+ () => createUpsActions(castApi(), { cachePrefix })
2129
+ );
2130
+ const logistics = lazy(
2131
+ () => createLogisticsActions(castApi(), longCache)
2132
+ );
2133
+ const nexus = lazy(
2134
+ () => createNexusActions(castApi(), cache)
2135
+ );
2136
+ const vmi = lazy(
2137
+ () => createVmiActions(castApi(), { ...cache, ...config.vmi })
2138
+ );
2139
+ const p21Core = lazy(
2140
+ () => createP21CoreActions(castApi(), longCache)
2141
+ );
2142
+ const p21Apis = lazy(
2143
+ () => createP21ApisActions(castApi(), cache)
2144
+ );
2145
+ const p21Sism = lazy(
2146
+ () => createP21SismActions(castApi(), cache)
2147
+ );
2148
+ const agrWork = lazy(
2149
+ () => createAgrWorkActions(castApi(), { cachePrefix })
2150
+ );
2151
+ const agrInfo = lazy(
2152
+ () => createAgrInfoActions(castApi(), longCache)
2153
+ );
2154
+ const basecamp2 = lazy(
2155
+ () => createBasecamp2Actions(castApi(), longCache)
2156
+ );
2157
+ const brandFolder = lazy(
2158
+ () => createBrandFolderActions(castApi(), cache)
2159
+ );
2160
+ const gregorovich = lazy(
2161
+ () => createGregorovichActions(castApi(), cache)
2162
+ );
2163
+ const slack = lazy(
2164
+ () => createSlackActions(castApi(), cache)
2165
+ );
2166
+ return {
2167
+ get pricing() {
2168
+ return pricing.get();
2169
+ },
2170
+ get items() {
2171
+ return items.get();
2172
+ },
2173
+ get commerce() {
2174
+ return commerce.get();
2175
+ },
2176
+ get search() {
2177
+ return search.get();
2178
+ },
2179
+ get orders() {
2180
+ return orders.get();
2181
+ },
2182
+ get shipping() {
2183
+ return shipping.get();
2184
+ },
2185
+ get joomla() {
2186
+ return joomla.get();
2187
+ },
2188
+ get legacy() {
2189
+ return legacy.get();
2190
+ },
2191
+ get customers() {
2192
+ return customers.get();
2193
+ },
2194
+ get smartyStreets() {
2195
+ return smartyStreets.get();
2196
+ },
2197
+ get p21Pim() {
2198
+ return p21Pim.get();
2199
+ },
2200
+ get agrSite() {
2201
+ return agrSite.get();
2202
+ },
2203
+ get avalara() {
2204
+ return avalara.get();
2205
+ },
2206
+ get payments() {
2207
+ return payments.get();
2208
+ },
2209
+ get ups() {
2210
+ return ups.get();
2211
+ },
2212
+ get logistics() {
2213
+ return logistics.get();
2214
+ },
2215
+ get nexus() {
2216
+ return nexus.get();
2217
+ },
2218
+ get vmi() {
2219
+ return vmi.get();
2220
+ },
2221
+ get p21Core() {
2222
+ return p21Core.get();
2223
+ },
2224
+ get p21Apis() {
2225
+ return p21Apis.get();
2226
+ },
2227
+ get p21Sism() {
2228
+ return p21Sism.get();
2229
+ },
2230
+ get agrWork() {
2231
+ return agrWork.get();
2232
+ },
2233
+ get agrInfo() {
2234
+ return agrInfo.get();
2235
+ },
2236
+ get basecamp2() {
2237
+ return basecamp2.get();
2238
+ },
2239
+ get brandFolder() {
2240
+ return brandFolder.get();
2241
+ },
2242
+ get gregorovich() {
2243
+ return gregorovich.get();
2244
+ },
2245
+ get slack() {
2246
+ return slack.get();
2247
+ }
2116
2248
  };
2117
2249
  }
2118
2250
  export {