@simpleapps-com/augur-server 0.2.8 → 0.2.10

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
@@ -1049,10 +1049,37 @@ function createPaymentsActions(api, config = {}) {
1049
1049
  return void 0;
1050
1050
  }
1051
1051
  }
1052
+ async function cardInfo(params) {
1053
+ try {
1054
+ const response = await api.payments.unified.cardInfo.get(params);
1055
+ return response.data;
1056
+ } catch {
1057
+ return void 0;
1058
+ }
1059
+ }
1060
+ async function billingUpdate(params) {
1061
+ try {
1062
+ const response = await api.payments.unified.billingUpdate.get(params);
1063
+ return response.data;
1064
+ } catch {
1065
+ return void 0;
1066
+ }
1067
+ }
1068
+ async function validatePayment(params) {
1069
+ try {
1070
+ const response = await api.payments.unified.validate.get(params);
1071
+ return response.data;
1072
+ } catch {
1073
+ return void 0;
1074
+ }
1075
+ }
1052
1076
  return {
1053
1077
  transactionSetup,
1054
1078
  accountQuery,
1055
- getSurcharge
1079
+ getSurcharge,
1080
+ cardInfo,
1081
+ billingUpdate,
1082
+ validatePayment
1056
1083
  };
1057
1084
  }
1058
1085
 
@@ -2050,69 +2077,201 @@ function createSiteActions(api, config = {}) {
2050
2077
  function castApi() {
2051
2078
  return api;
2052
2079
  }
2053
- return {
2054
- pricing: createPricingActions(castApi(), {
2080
+ function lazy(fn) {
2081
+ let instance;
2082
+ return {
2083
+ get() {
2084
+ if (instance === void 0) instance = fn();
2085
+ return instance;
2086
+ }
2087
+ };
2088
+ }
2089
+ const pricing = lazy(
2090
+ () => createPricingActions(castApi(), {
2055
2091
  ...cache,
2056
2092
  defaultCustomerId,
2057
2093
  ...config.pricing
2058
- }),
2059
- items: createItemActions(castApi(), {
2094
+ })
2095
+ );
2096
+ const items = lazy(
2097
+ () => createItemActions(castApi(), {
2060
2098
  ...longCache,
2061
2099
  ...config.items
2062
- }),
2063
- commerce: createCommerceActions(castApi(), {
2100
+ })
2101
+ );
2102
+ const commerce = lazy(
2103
+ () => createCommerceActions(castApi(), {
2064
2104
  defaultContactId,
2065
2105
  defaultCustomerId,
2066
2106
  convertUnitOfMeasure
2067
- }),
2068
- search: createSearchActions(castApi(), {
2107
+ })
2108
+ );
2109
+ const search = lazy(
2110
+ () => createSearchActions(castApi(), {
2069
2111
  ...cache,
2070
2112
  ...config.search
2071
- }),
2072
- orders: createOrderActions(castApi(), cache),
2073
- shipping: createShippingActions(
2113
+ })
2114
+ );
2115
+ const orders = lazy(
2116
+ () => createOrderActions(castApi(), cache)
2117
+ );
2118
+ const shipping = lazy(
2119
+ () => createShippingActions(
2074
2120
  castApi(),
2075
2121
  { ...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(), {
2122
+ )
2123
+ );
2124
+ const joomla = lazy(
2125
+ () => createJoomlaActions(castApi(), cache)
2126
+ );
2127
+ const legacy = lazy(
2128
+ () => createLegacyActions(castApi(), longCache)
2129
+ );
2130
+ const customers = lazy(
2131
+ () => createCustomersActions(castApi(), cache)
2132
+ );
2133
+ const smartyStreets = lazy(
2134
+ () => createSmartyStreetsActions(castApi(), {
2135
+ cachePrefix
2136
+ })
2137
+ );
2138
+ const p21Pim = lazy(
2139
+ () => createP21PimActions(castApi(), cache)
2140
+ );
2141
+ const agrSite = lazy(
2142
+ () => createAgrSiteActions(castApi(), {
2086
2143
  cachePrefix,
2087
2144
  longEdgeCache,
2088
2145
  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)
2146
+ })
2147
+ );
2148
+ const avalara = lazy(
2149
+ () => createAvalaraActions(castApi(), { cachePrefix })
2150
+ );
2151
+ const payments = lazy(
2152
+ () => createPaymentsActions(castApi(), { cachePrefix })
2153
+ );
2154
+ const ups = lazy(
2155
+ () => createUpsActions(castApi(), { cachePrefix })
2156
+ );
2157
+ const logistics = lazy(
2158
+ () => createLogisticsActions(castApi(), longCache)
2159
+ );
2160
+ const nexus = lazy(
2161
+ () => createNexusActions(castApi(), cache)
2162
+ );
2163
+ const vmi = lazy(
2164
+ () => createVmiActions(castApi(), { ...cache, ...config.vmi })
2165
+ );
2166
+ const p21Core = lazy(
2167
+ () => createP21CoreActions(castApi(), longCache)
2168
+ );
2169
+ const p21Apis = lazy(
2170
+ () => createP21ApisActions(castApi(), cache)
2171
+ );
2172
+ const p21Sism = lazy(
2173
+ () => createP21SismActions(castApi(), cache)
2174
+ );
2175
+ const agrWork = lazy(
2176
+ () => createAgrWorkActions(castApi(), { cachePrefix })
2177
+ );
2178
+ const agrInfo = lazy(
2179
+ () => createAgrInfoActions(castApi(), longCache)
2180
+ );
2181
+ const basecamp2 = lazy(
2182
+ () => createBasecamp2Actions(castApi(), longCache)
2183
+ );
2184
+ const brandFolder = lazy(
2185
+ () => createBrandFolderActions(castApi(), cache)
2186
+ );
2187
+ const gregorovich = lazy(
2188
+ () => createGregorovichActions(castApi(), cache)
2189
+ );
2190
+ const slack = lazy(
2191
+ () => createSlackActions(castApi(), cache)
2192
+ );
2193
+ return {
2194
+ get pricing() {
2195
+ return pricing.get();
2196
+ },
2197
+ get items() {
2198
+ return items.get();
2199
+ },
2200
+ get commerce() {
2201
+ return commerce.get();
2202
+ },
2203
+ get search() {
2204
+ return search.get();
2205
+ },
2206
+ get orders() {
2207
+ return orders.get();
2208
+ },
2209
+ get shipping() {
2210
+ return shipping.get();
2211
+ },
2212
+ get joomla() {
2213
+ return joomla.get();
2214
+ },
2215
+ get legacy() {
2216
+ return legacy.get();
2217
+ },
2218
+ get customers() {
2219
+ return customers.get();
2220
+ },
2221
+ get smartyStreets() {
2222
+ return smartyStreets.get();
2223
+ },
2224
+ get p21Pim() {
2225
+ return p21Pim.get();
2226
+ },
2227
+ get agrSite() {
2228
+ return agrSite.get();
2229
+ },
2230
+ get avalara() {
2231
+ return avalara.get();
2232
+ },
2233
+ get payments() {
2234
+ return payments.get();
2235
+ },
2236
+ get ups() {
2237
+ return ups.get();
2238
+ },
2239
+ get logistics() {
2240
+ return logistics.get();
2241
+ },
2242
+ get nexus() {
2243
+ return nexus.get();
2244
+ },
2245
+ get vmi() {
2246
+ return vmi.get();
2247
+ },
2248
+ get p21Core() {
2249
+ return p21Core.get();
2250
+ },
2251
+ get p21Apis() {
2252
+ return p21Apis.get();
2253
+ },
2254
+ get p21Sism() {
2255
+ return p21Sism.get();
2256
+ },
2257
+ get agrWork() {
2258
+ return agrWork.get();
2259
+ },
2260
+ get agrInfo() {
2261
+ return agrInfo.get();
2262
+ },
2263
+ get basecamp2() {
2264
+ return basecamp2.get();
2265
+ },
2266
+ get brandFolder() {
2267
+ return brandFolder.get();
2268
+ },
2269
+ get gregorovich() {
2270
+ return gregorovich.get();
2271
+ },
2272
+ get slack() {
2273
+ return slack.get();
2274
+ }
2116
2275
  };
2117
2276
  }
2118
2277
  export {