@simpleapps-com/augur-server 1.0.2 → 1.0.4

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
@@ -3,2250 +3,75 @@ import {
3
3
  createSuspenseQueryOptions
4
4
  } from "./chunk-I26RJDRF.js";
5
5
  import {
6
- batchFetch,
7
- createServerQueryClient,
8
- getServerQueryClient
9
- } from "./chunk-R3XKAWHN.js";
10
-
11
- // src/environment.ts
12
- function getEnvironment() {
13
- const deploymentEnv = process.env.DEPLOYMENT_ENV;
14
- if (deploymentEnv === "dev") return "staging";
15
- if (deploymentEnv === "live") return "production";
16
- if (typeof window === "undefined") {
17
- if (process.env.NODE_ENV === "development") return "development";
18
- return "production";
19
- }
20
- const host = window.location.hostname;
21
- if (host.includes("localhost") || host.includes("127.0.0.1"))
22
- return "development";
23
- if (host.includes("agr-hosting.dev")) return "staging";
24
- return "production";
25
- }
26
- var env = getEnvironment();
27
- var isDev = env === "development";
28
- var isStaging = env === "staging";
29
- var isProduction = env === "production";
30
-
31
- // src/cache/redis-client.ts
32
- var CIRCUIT_BREAKER_THRESHOLD = 5;
33
- var CIRCUIT_BREAKER_RESET_MS = 6e4;
34
- var g = globalThis;
35
- if (!g.__redisState) {
36
- g.__redisState = {
37
- client: null,
38
- consecutiveFailures: 0,
39
- circuitOpenUntil: 0
40
- };
41
- }
42
- var state = g.__redisState;
43
- var debugEnabled = isDev || isStaging;
44
- function log(...args) {
45
- if (debugEnabled) {
46
- console.log("[Redis]", ...args);
47
- }
48
- }
49
- function isCircuitOpen() {
50
- if (state.circuitOpenUntil === 0) return false;
51
- if (Date.now() >= state.circuitOpenUntil) {
52
- state.circuitOpenUntil = 0;
53
- state.consecutiveFailures = 0;
54
- log("Circuit breaker reset -- retrying Redis");
55
- return false;
56
- }
57
- return true;
58
- }
59
- function recordFailure() {
60
- state.consecutiveFailures++;
61
- if (state.consecutiveFailures >= CIRCUIT_BREAKER_THRESHOLD) {
62
- state.circuitOpenUntil = Date.now() + CIRCUIT_BREAKER_RESET_MS;
63
- log(
64
- `Circuit breaker OPEN -- skipping Redis for ${CIRCUIT_BREAKER_RESET_MS / 1e3}s`
65
- );
66
- }
67
- }
68
- function recordSuccess() {
69
- state.consecutiveFailures = 0;
70
- }
71
- function getRedisUrl() {
72
- const containerRedis = process.env.REDIS_SERVERS;
73
- if (containerRedis) return `redis://${containerRedis}`;
74
- if (isDev) return process.env.REDIS_URL_DEV;
75
- if (isStaging) return process.env.REDIS_URL_STAGING;
76
- return process.env.REDIS_URL_PROD;
77
- }
78
- async function getClient() {
79
- if (state.client) return state.client;
80
- const url = getRedisUrl();
81
- if (!url) {
82
- log("No REDIS_URL -- cache disabled");
83
- return null;
84
- }
85
- try {
86
- const { default: IORedis } = await import("ioredis");
87
- state.client = new IORedis(url, {
88
- maxRetriesPerRequest: 1,
89
- connectTimeout: 3e3,
90
- lazyConnect: true,
91
- enableOfflineQueue: false
92
- });
93
- state.client.on("error", (err) => {
94
- log("Connection error:", err.message);
95
- recordFailure();
96
- });
97
- state.client.on("connect", () => log("Connected"));
98
- state.client.connect().catch(() => {
99
- });
100
- return state.client;
101
- } catch {
102
- log("Failed to create client (ioredis not installed?)");
103
- return null;
104
- }
105
- }
106
- async function cacheGet(key) {
107
- if (isCircuitOpen()) return null;
108
- const client = await getClient();
109
- if (!client) return null;
110
- try {
111
- const value = await client.get(key);
112
- recordSuccess();
113
- return value;
114
- } catch {
115
- recordFailure();
116
- return null;
117
- }
118
- }
119
- async function cacheSet(key, value, ttlSeconds) {
120
- if (isCircuitOpen()) return;
121
- const client = await getClient();
122
- if (!client) return;
123
- try {
124
- await client.setex(key, ttlSeconds, value);
125
- recordSuccess();
126
- } catch {
127
- recordFailure();
128
- }
129
- }
130
- function getCircuitState() {
131
- return isCircuitOpen() ? "open" : "closed";
132
- }
133
- function isRedisConnected() {
134
- return state.client?.status === "ready";
135
- }
136
-
137
- // src/sdk-call.ts
138
- async function sdkCall(method, ...args) {
139
- return method(...args);
140
- }
141
- async function safeAction(fn, onError) {
142
- try {
143
- const data = await fn();
144
- return { ok: true, data };
145
- } catch (e) {
146
- const error = e instanceof Error ? e : new Error(String(e));
147
- if (onError) onError(error);
148
- return { ok: false, error: error.message };
149
- }
150
- }
151
-
152
- // src/cache/with-cache.ts
153
- import { buildCacheKey } from "@simpleapps-com/augur-core";
154
- async function withServerCache(prefix, redisTtl, methodPath, fn, ...keyArgs) {
155
- if (!redisTtl) return fn();
156
- const key = buildCacheKey(prefix, methodPath, keyArgs);
157
- try {
158
- const cached = await cacheGet(key);
159
- if (cached != null) return JSON.parse(cached);
160
- } catch {
161
- }
162
- const result = await fn();
163
- try {
164
- cacheSet(key, JSON.stringify(result), redisTtl).catch(() => {
165
- });
166
- } catch {
167
- }
168
- return result;
169
- }
170
-
171
- // src/pagination.ts
172
- function paginateOffset(items, pageParam, limit, total) {
173
- const hasMore = total !== void 0 ? (pageParam + 1) * limit < total : items.length === limit;
174
- return {
175
- data: items,
176
- total,
177
- nextCursor: hasMore ? pageParam + 1 : void 0,
178
- hasMore
179
- };
180
- }
181
-
182
- // src/actions/pricing.ts
183
- function resolveCustomerId(explicit, fallback) {
184
- const raw = explicit ?? fallback;
185
- const num = Number(raw);
186
- return num > 0 ? num : 0;
187
- }
188
- function createPricingActions(api, config = {}) {
189
- const {
190
- defaultCustomerId,
191
- cachePrefix = "",
192
- edgeCache = 2,
193
- redisTtl = 3600,
194
- taxRedisTtl = 1800
195
- } = config;
196
- async function getItemPrice(itemId, customerId, quantity = 1) {
197
- const custId = resolveCustomerId(customerId, defaultCustomerId);
198
- const params = { customerId: custId, itemId, quantity, edgeCache };
199
- return withServerCache(
200
- cachePrefix,
201
- redisTtl,
202
- "pricing.priceEngine.get",
203
- async () => {
204
- const response = await api.pricing.priceEngine.get(params);
205
- return response.data;
206
- },
207
- params
208
- );
209
- }
210
- async function batchGetItemPrices(itemIds, customerId, quantity = 1) {
211
- return batchFetch(
212
- itemIds,
213
- (id) => getItemPrice(id, customerId, quantity),
214
- (id) => id
215
- );
216
- }
217
- async function getTaxEstimate(customerId, postalCode, items) {
218
- const custId = resolveCustomerId(customerId, defaultCustomerId);
219
- const params = { customerId: custId, postalCode, items };
220
- return withServerCache(
221
- cachePrefix,
222
- taxRedisTtl,
223
- "pricing.taxEngine.create",
224
- async () => {
225
- const response = await api.pricing.taxEngine.create(params);
226
- return response.data;
227
- },
228
- params
229
- );
230
- }
231
- return { getItemPrice, batchGetItemPrices, getTaxEstimate };
232
- }
233
-
234
- // src/actions/items.ts
235
- function createItemActions(api, config = {}) {
236
- const {
237
- cachePrefix = "",
238
- edgeCache = 1,
239
- longEdgeCache = 8,
240
- redisTtl = 3600,
241
- longRedisTtl = 28800,
242
- sortChildren = true,
243
- sortByPrefix
244
- } = config;
245
- function sortCategoryChildren(children) {
246
- if (!sortChildren) return children;
247
- return [...children].sort((a, b) => a.sequenceNo - b.sequenceNo);
248
- }
249
- async function itemCategoryLookup(path) {
250
- return withServerCache(
251
- cachePrefix,
252
- redisTtl,
253
- "items.categories.lookup.get",
254
- async () => {
255
- const response = await api.items.categories.lookup.get({
256
- path,
257
- edgeCache
258
- });
259
- return response.data;
260
- },
261
- path
262
- );
263
- }
264
- async function getItemCategory(uid, options) {
265
- const category = await withServerCache(
266
- cachePrefix,
267
- redisTtl,
268
- "items.categories.get",
269
- async () => {
270
- const response = await api.items.categories.get(uid, {
271
- ...options,
272
- edgeCache
273
- });
274
- return response.data;
275
- },
276
- uid,
277
- options
278
- );
279
- const cat = category;
280
- return {
281
- ...cat,
282
- children: sortCategoryChildren(cat.children)
283
- };
284
- }
285
- async function getCategoryItems(uid, filters) {
286
- const merged = { ...filters };
287
- if (sortByPrefix && typeof merged.sortBy === "string" && merged.sortBy) {
288
- merged.sortBy = `${sortByPrefix}${merged.sortBy}`;
289
- }
290
- return withServerCache(
291
- cachePrefix,
292
- redisTtl,
293
- "items.categories.items.list",
294
- async () => {
295
- const response = await api.items.categories.items.list(uid, {
296
- ...merged,
297
- edgeCache
298
- });
299
- return response.data;
300
- },
301
- uid,
302
- merged
303
- );
304
- }
305
- async function getItemAttributes(categoryUid) {
306
- return withServerCache(
307
- cachePrefix,
308
- redisTtl,
309
- "items.categories.attributes.list",
310
- async () => {
311
- const response = await api.items.categories.attributes.list(
312
- categoryUid,
313
- { edgeCache }
314
- );
315
- return response.data.attributes;
316
- },
317
- categoryUid
318
- );
319
- }
320
- async function getInvMast(uid) {
321
- return withServerCache(
322
- cachePrefix,
323
- redisTtl,
324
- "items.invMast.get",
325
- async () => {
326
- const response = await api.items.invMast.get(uid, { edgeCache: 4 });
327
- return response.data;
328
- },
329
- uid
330
- );
331
- }
332
- async function getInvMastDoc(params) {
333
- return withServerCache(
334
- cachePrefix,
335
- redisTtl,
336
- "items.invMast.doc.list",
337
- async () => {
338
- const response = await api.items.invMast.doc.list(
339
- params.invMastUid ?? 0,
340
- {
341
- itemId: params.itemId,
342
- includePricing: params.includePricing,
343
- edgeCache: 4
344
- }
345
- );
346
- return response.data;
347
- },
348
- params.invMastUid,
349
- params.itemId,
350
- params.includePricing
351
- );
352
- }
353
- async function getStock(invMastUid) {
354
- return withServerCache(
355
- cachePrefix,
356
- redisTtl,
357
- "items.invMast.stock.list",
358
- async () => {
359
- const response = await api.items.invMast.stock.list(invMastUid, {
360
- edgeCache
361
- });
362
- return response.data?.stockData;
363
- },
364
- invMastUid
365
- );
366
- }
367
- async function getStockCompanySummary(invMastUid) {
368
- return withServerCache(
369
- cachePrefix,
370
- redisTtl,
371
- "items.invMast.stock.list.companySummary",
372
- async () => {
373
- const response = await api.items.invMast.stock.list(invMastUid, {
374
- edgeCache
375
- });
376
- return response.data?.companySummary;
377
- },
378
- invMastUid
379
- );
380
- }
381
- async function getItemFaqs(invMastUid) {
382
- return withServerCache(
383
- cachePrefix,
384
- longRedisTtl,
385
- "items.invMast.faq.list",
386
- async () => {
387
- const response = await api.items.invMast.faq.list(invMastUid, {
388
- edgeCache: longEdgeCache
389
- });
390
- return response.data;
391
- },
392
- invMastUid
393
- );
394
- }
395
- async function getItemSubstitutes(invMastUid) {
396
- return withServerCache(
397
- cachePrefix,
398
- longRedisTtl,
399
- "items.invMast.invSub.list",
400
- async () => {
401
- const response = await api.items.invMast.invSub.list(invMastUid, {
402
- edgeCache: longEdgeCache
403
- });
404
- return response.data;
405
- },
406
- invMastUid
407
- );
408
- }
409
- async function getItemAccessories(invMastUid) {
410
- return withServerCache(
411
- cachePrefix,
412
- redisTtl,
413
- "items.invMast.invAccessory.list",
414
- async () => {
415
- const response = await api.items.invMast.invAccessory.list(
416
- invMastUid,
417
- { edgeCache }
418
- );
419
- return response.data;
420
- },
421
- invMastUid
422
- );
423
- }
424
- async function getSimilarItems(invMastUid) {
425
- return withServerCache(
426
- cachePrefix,
427
- longRedisTtl,
428
- "items.invMast.similar.list",
429
- async () => {
430
- const response = await api.items.invMast.similar.list(invMastUid, {
431
- edgeCache: longEdgeCache
432
- });
433
- return response.data;
434
- },
435
- invMastUid
436
- );
437
- }
438
- async function batchGetInvMastDocs(params) {
439
- return batchFetch(
440
- params,
441
- (p) => getInvMastDoc(p),
442
- (p) => p.itemId ?? String(p.invMastUid)
443
- );
444
- }
445
- async function batchGetStockData(invMastUids) {
446
- return batchFetch(invMastUids, (uid) => getStock(uid), (uid) => uid);
447
- }
448
- return {
449
- itemCategoryLookup,
450
- getItemCategory,
451
- getCategoryItems,
452
- getItemAttributes,
453
- getInvMast,
454
- getInvMastDoc,
455
- getStock,
456
- getStockCompanySummary,
457
- getItemFaqs,
458
- getItemSubstitutes,
459
- getItemAccessories,
460
- getSimilarItems,
461
- batchGetInvMastDocs,
462
- batchGetStockData
463
- };
464
- }
465
-
466
- // src/actions/commerce.ts
467
- function createCommerceActions(api, config = {}) {
468
- const { defaultContactId, defaultCustomerId, convertUnitOfMeasure } = config;
469
- async function cartHdrLookup(params) {
470
- const lookupParams = { ...params };
471
- if (lookupParams.contactId == null && defaultContactId != null) {
472
- lookupParams.contactId = defaultContactId;
473
- }
474
- if (lookupParams.customerId == null && defaultCustomerId != null) {
475
- lookupParams.customerId = defaultCustomerId;
476
- }
477
- const response = await api.commerce.cartHdr.lookup.get(lookupParams);
478
- return response.data;
479
- }
480
- async function getCartLines(cartHdrUid) {
481
- const response = await api.commerce.cartLine.get(cartHdrUid);
482
- return response.data;
483
- }
484
- async function addToCart(cartHdrUid, items) {
485
- try {
486
- const mappedItems = items.map((item) => ({
487
- ...item,
488
- unitOfMeasure: convertUnitOfMeasure ? convertUnitOfMeasure(item.unitOfMeasure) : item.unitOfMeasure
489
- }));
490
- const response = await api.commerce.cartLine.add.create(
491
- cartHdrUid,
492
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
493
- { items: mappedItems }
494
- );
495
- return response.data;
496
- } catch {
497
- return void 0;
498
- }
499
- }
500
- async function updateCartLines(cartHdrUid, lines) {
501
- try {
502
- const mappedLines = lines.map((line) => ({
503
- ...line,
504
- unitOfMeasure: convertUnitOfMeasure ? convertUnitOfMeasure(line.unitOfMeasure) : line.unitOfMeasure
505
- }));
506
- const response = await api.commerce.cartLine.update.create(
507
- cartHdrUid,
508
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
509
- { lines: mappedLines }
510
- );
511
- return response.data;
512
- } catch {
513
- return void 0;
514
- }
515
- }
516
- async function deleteCartItems(cartHdrUid) {
517
- try {
518
- await api.commerce.cartLine.delete(cartHdrUid);
519
- } catch {
520
- }
521
- }
522
- async function getCartAlsoBought(cartHdrUid) {
523
- const response = await api.commerce.cartHdr.alsoBought.get(cartHdrUid);
524
- return response.data;
525
- }
526
- async function checkoutOrder(cartHdrUid, data) {
527
- try {
528
- const response = await api.commerce.checkout.create({
529
- ...data,
530
- cartHdrUid
531
- });
532
- return response.data;
533
- } catch {
534
- return void 0;
535
- }
536
- }
537
- return {
538
- cartHdrLookup,
539
- getCartLines,
540
- addToCart,
541
- updateCartLines,
542
- deleteCartItems,
543
- getCartAlsoBought,
544
- checkoutOrder
545
- };
546
- }
547
-
548
- // src/actions/orders.ts
549
- function createOrderActions(api, config = {}) {
550
- const { cachePrefix = "", edgeCache = 1, redisTtl = 3600 } = config;
551
- async function getOrderDoc(orderNo, postalCode) {
552
- return withServerCache(
553
- cachePrefix,
554
- redisTtl,
555
- "orders.oeHdr.doc.get",
556
- async () => {
557
- const response = await api.orders.oeHdr.doc.get(Number(orderNo), {
558
- postalCode,
559
- edgeCache
560
- });
561
- return response.data;
562
- },
563
- orderNo,
564
- postalCode
565
- );
566
- }
567
- return { getOrderDoc };
568
- }
569
-
570
- // src/actions/search.ts
571
- function createSearchActions(api, config = {}) {
572
- const {
573
- cachePrefix = "",
574
- edgeCache = 1,
575
- redisTtl = 3600,
576
- defaultSourceFields = "display_desc"
577
- } = config;
578
- const openSearch = api.opensearch;
579
- async function getSearchAttributes(q) {
580
- const params = { q, edgeCache };
581
- return withServerCache(
582
- cachePrefix,
583
- redisTtl,
584
- "openSearch.itemSearch.attributes.list",
585
- async () => {
586
- const response = (
587
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
588
- await openSearch.itemSearch.attributes.list(params)
589
- );
590
- return response.data.attributes;
591
- },
592
- q
593
- );
594
- }
595
- async function getSearchSuggestions(q, limit, offset) {
596
- const params = { q, edgeCache };
597
- if (limit !== void 0) params.size = limit;
598
- if (offset !== void 0) params.from = offset;
599
- return withServerCache(
600
- cachePrefix,
601
- redisTtl,
602
- "openSearch.suggestions.suggest.list",
603
- async () => {
604
- const response = (
605
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
606
- await openSearch.suggestions.suggest.list(params)
607
- );
608
- return response.data;
609
- },
610
- q
611
- );
612
- }
613
- async function itemSearch(filters, itemCategoryUid) {
614
- const params = {
615
- q: filters.q,
616
- searchType: "query",
617
- size: filters.limit,
618
- from: filters.offset,
619
- sortBy: filters.sortBy,
620
- classId5List: itemCategoryUid ? String(itemCategoryUid) : void 0,
621
- filters: filters.filters?.length ? JSON.stringify(filters.filters) : void 0,
622
- sourceFieldsList: defaultSourceFields,
623
- edgeCache
624
- };
625
- return withServerCache(
626
- cachePrefix,
627
- redisTtl,
628
- "openSearch.itemSearch.list",
629
- async () => {
630
- const response = await openSearch.itemSearch.list(params);
631
- return response.data;
632
- },
633
- filters,
634
- itemCategoryUid
635
- );
636
- }
637
- async function itemSearchInfinite(filters, itemCategoryUid, pageParam = 0) {
638
- const params = {
639
- q: filters.q,
640
- searchType: "query",
641
- size: filters.limit,
642
- from: pageParam,
643
- sortBy: filters.sortBy,
644
- classId5List: itemCategoryUid ? String(itemCategoryUid) : void 0,
645
- filters: filters.filters?.length ? JSON.stringify(filters.filters) : void 0,
646
- sourceFieldsList: defaultSourceFields,
647
- edgeCache
648
- };
649
- return withServerCache(
650
- cachePrefix,
651
- redisTtl,
652
- "openSearch.itemSearch.list",
653
- async () => {
654
- const response = await openSearch.itemSearch.list(params);
655
- const { items, totalResults } = response.data;
656
- const nextOffset = pageParam + filters.limit;
657
- return {
658
- data: items,
659
- total: totalResults,
660
- nextCursor: nextOffset < totalResults ? nextOffset : void 0
661
- };
662
- },
663
- filters,
664
- itemCategoryUid,
665
- pageParam
666
- );
667
- }
668
- return {
669
- getSearchAttributes,
670
- getSearchSuggestions,
671
- itemSearch,
672
- itemSearchInfinite
673
- };
674
- }
675
-
676
- // src/actions/shipping.ts
677
- function createShippingActions(api, config) {
678
- const {
679
- fromAddress,
680
- defaultServiceCodes,
681
- cachePrefix = "",
682
- edgeCache = 1,
683
- redisTtl = 3600
684
- } = config;
685
- async function getShippingRates(toAddress, weight, serviceCodes) {
686
- const params = {
687
- fromAddress,
688
- toAddress: { ...toAddress, country: toAddress.country ?? "US" },
689
- weight,
690
- serviceCodes: serviceCodes ?? defaultServiceCodes,
691
- edgeCache
692
- };
693
- return withServerCache(
694
- cachePrefix,
695
- redisTtl,
696
- "ups.ratesShop.get",
697
- async () => {
698
- const response = await api.ups.ratesShop.get(params);
699
- return response.data;
700
- },
701
- params
702
- );
703
- }
704
- return { getShippingRates };
705
- }
706
-
707
- // src/actions/joomla.ts
708
- function createJoomlaActions(api, config = {}) {
709
- const { cachePrefix = "", edgeCache = 1, redisTtl = 3600 } = config;
710
- async function getJoomlaContent(articleId) {
711
- return withServerCache(
712
- cachePrefix,
713
- redisTtl,
714
- "joomla.content.doc.get",
715
- async () => {
716
- const response = await api.joomla.content.doc.get(articleId, {
717
- edgeCache
718
- });
719
- return response.data;
720
- },
721
- articleId
722
- );
723
- }
724
- async function getJoomlaContentList(params) {
725
- return withServerCache(
726
- cachePrefix,
727
- redisTtl,
728
- "joomla.content.list",
729
- async () => {
730
- const response = await api.joomla.content.list({
731
- ...params,
732
- edgeCache
733
- });
734
- return response.data;
735
- },
736
- params
737
- );
738
- }
739
- async function getJoomlaMenu(params) {
740
- return withServerCache(
741
- cachePrefix,
742
- redisTtl,
743
- "joomla.menu.list",
744
- async () => {
745
- const response = await api.joomla.menu.list({
746
- ...params,
747
- edgeCache
748
- });
749
- return response.data;
750
- },
751
- params
752
- );
753
- }
754
- async function getJoomlaMenuDoc(menuId) {
755
- return withServerCache(
756
- cachePrefix,
757
- redisTtl,
758
- "joomla.menu.doc.get",
759
- async () => {
760
- const response = await api.joomla.menu.doc.get(String(menuId));
761
- return response.data;
762
- },
763
- menuId
764
- );
765
- }
766
- async function getUserProfile(userId) {
767
- return withServerCache(
768
- cachePrefix,
769
- redisTtl,
770
- "joomla.users.doc.get",
771
- async () => {
772
- const response = await api.joomla.users.doc.get(userId, {
773
- edgeCache
774
- });
775
- const raw = response.data;
776
- if (!raw) throw new Error("User not found");
777
- const customerId = String(
778
- raw.customerId ?? raw.customer_id ?? raw.p21_customer_id ?? ""
779
- );
780
- const groups = Array.isArray(raw.groups) ? raw.groups : [];
781
- const permissions = groups.map(
782
- (g2) => String(g2.title ?? g2.name ?? "")
783
- ).filter(Boolean);
784
- return {
785
- id: String(raw.id ?? userId),
786
- name: String(raw.name ?? ""),
787
- email: String(raw.email ?? ""),
788
- customerId,
789
- permissions
790
- };
791
- },
792
- userId
793
- );
794
- }
795
- return { getJoomlaContent, getJoomlaContentList, getJoomlaMenu, getJoomlaMenuDoc, getUserProfile };
796
- }
797
-
798
- // src/actions/legacy.ts
799
- function createLegacyActions(api, config = {}) {
800
- const {
801
- cachePrefix = "",
802
- edgeCache = 1,
803
- longEdgeCache = 8,
804
- redisTtl = 3600,
805
- longRedisTtl = 28800
806
- } = config;
807
- async function getItemWebDesc(invMastUid) {
808
- return withServerCache(
809
- cachePrefix,
810
- redisTtl,
811
- "legacy.invMast.webDesc.list",
812
- async () => {
813
- const response = await api.legacy.invMast.webDesc.list(invMastUid, {
814
- edgeCache
815
- });
816
- return response.data[0];
817
- },
818
- invMastUid
819
- );
820
- }
821
- async function getAlsoBoughtItems(invMastUid) {
822
- return withServerCache(
823
- cachePrefix,
824
- redisTtl,
825
- "legacy.invMast.alsoBought.list",
826
- async () => {
827
- const response = await api.legacy.invMast.alsoBought.list(
828
- invMastUid,
829
- { edgeCache }
830
- );
831
- return response.data;
832
- },
833
- invMastUid
834
- );
835
- }
836
- async function getItemTags(invMastUid) {
837
- return withServerCache(
838
- cachePrefix,
839
- redisTtl,
840
- "legacy.invMast.tags.list",
841
- async () => {
842
- const response = await api.legacy.invMast.tags.list(invMastUid, {
843
- edgeCache
844
- });
845
- return response.data;
846
- },
847
- invMastUid
848
- );
849
- }
850
- async function getStates(params) {
851
- return withServerCache(
852
- cachePrefix,
853
- longRedisTtl,
854
- "legacy.legacy.state.list",
855
- async () => {
856
- const response = await api.legacy.legacy.state.list({
857
- ...params,
858
- edgeCache: longEdgeCache
859
- });
860
- return response.data;
861
- },
862
- params?.twoLetterCode
863
- );
864
- }
865
- return {
866
- getItemWebDesc,
867
- getAlsoBoughtItems,
868
- getItemTags,
869
- getStates
870
- };
871
- }
872
-
873
- // src/actions/customers.ts
874
- function createCustomersActions(api, config = {}) {
875
- const { cachePrefix = "", edgeCache = 1, redisTtl = 3600 } = config;
876
- async function getCustomer(customerId) {
877
- return withServerCache(
878
- cachePrefix,
879
- redisTtl,
880
- "customers.customer.get",
881
- async () => {
882
- const response = await api.customers.customer.get(customerId, {
883
- edgeCache
884
- });
885
- return response.data;
886
- },
887
- customerId
888
- );
889
- }
890
- async function customerLookup(params) {
891
- return withServerCache(
892
- cachePrefix,
893
- redisTtl,
894
- "customers.customer.lookup.get",
895
- async () => {
896
- const response = await api.customers.customer.lookup.get({
897
- ...params,
898
- edgeCache
899
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
900
- });
901
- return response.data;
902
- },
903
- params
904
- );
905
- }
906
- async function getCustomerDoc(customerId) {
907
- return withServerCache(
908
- cachePrefix,
909
- redisTtl,
910
- "customers.customer.doc.get",
911
- async () => {
912
- const response = await api.customers.customer.doc.get(customerId, {
913
- edgeCache
914
- });
915
- return response.data;
916
- },
917
- customerId
918
- );
919
- }
920
- async function getCustomerOrders(customerId, params) {
921
- return withServerCache(
922
- cachePrefix,
923
- redisTtl,
924
- "customers.customer.orders.list",
925
- async () => {
926
- const response = await api.customers.customer.orders.list(customerId, {
927
- ...params,
928
- edgeCache
929
- });
930
- return { data: response.data, total: response.total };
931
- },
932
- customerId,
933
- params
934
- );
935
- }
936
- async function getCustomerOrderDetail(customerId, orderId) {
937
- return withServerCache(
938
- cachePrefix,
939
- redisTtl,
940
- "customers.customer.orders.get",
941
- async () => {
942
- const response = await api.customers.customer.orders.get(
943
- customerId,
944
- orderId,
945
- { edgeCache }
946
- );
947
- return response.data;
948
- },
949
- customerId,
950
- orderId
951
- );
952
- }
953
- async function getCustomerInvoices(customerId, params) {
954
- return withServerCache(
955
- cachePrefix,
956
- redisTtl,
957
- "customers.customer.invoices.list",
958
- async () => {
959
- const response = await api.customers.customer.invoices.list(
960
- customerId,
961
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
962
- { ...params, edgeCache }
963
- );
964
- return { data: response.data, total: response.total };
965
- },
966
- customerId,
967
- params
968
- );
969
- }
970
- async function getCustomerInvoiceDetail(customerId, invoiceNo) {
971
- return withServerCache(
972
- cachePrefix,
973
- redisTtl,
974
- "customers.customer.invoices.get",
975
- async () => {
976
- const response = await api.customers.customer.invoices.get(
977
- customerId,
978
- invoiceNo,
979
- { edgeCache }
980
- );
981
- return response.data;
982
- },
983
- customerId,
984
- invoiceNo
985
- );
986
- }
987
- async function getCustomerQuotes(customerId, params) {
988
- return withServerCache(
989
- cachePrefix,
990
- redisTtl,
991
- "customers.customer.quotes.list",
992
- async () => {
993
- const response = await api.customers.customer.quotes.list(customerId, {
994
- ...params,
995
- edgeCache
996
- });
997
- return { data: response.data, total: response.total };
998
- },
999
- customerId,
1000
- params
1001
- );
1002
- }
1003
- async function getCustomerQuoteDetail(customerId, quoteNo) {
1004
- return withServerCache(
1005
- cachePrefix,
1006
- redisTtl,
1007
- "customers.customer.quotes.get",
1008
- async () => {
1009
- const response = await api.customers.customer.quotes.get(
1010
- customerId,
1011
- quoteNo,
1012
- { edgeCache }
1013
- );
1014
- return response.data;
1015
- },
1016
- customerId,
1017
- quoteNo
1018
- );
1019
- }
1020
- async function getContacts(params) {
1021
- return withServerCache(
1022
- cachePrefix,
1023
- redisTtl,
1024
- "customers.contacts.list",
1025
- async () => {
1026
- const response = await api.customers.contacts.list({
1027
- ...params,
1028
- edgeCache
1029
- });
1030
- return response.data;
1031
- },
1032
- params
1033
- );
1034
- }
1035
- async function getShipToAddresses(customerId) {
1036
- return withServerCache(
1037
- cachePrefix,
1038
- redisTtl,
1039
- "customers.customer.shipTo.list",
1040
- async () => {
1041
- const response = await api.customers.customer.shipTo.list(customerId, {
1042
- edgeCache
1043
- });
1044
- return response.data;
1045
- },
1046
- customerId
1047
- );
1048
- }
1049
- return {
1050
- getCustomer,
1051
- customerLookup,
1052
- getCustomerDoc,
1053
- getCustomerOrders,
1054
- getCustomerOrderDetail,
1055
- getCustomerInvoices,
1056
- getCustomerInvoiceDetail,
1057
- getCustomerQuotes,
1058
- getCustomerQuoteDetail,
1059
- getContacts,
1060
- getShipToAddresses
1061
- };
1062
- }
1063
-
1064
- // src/actions/smarty-streets.ts
1065
- function createSmartyStreetsActions(api, config = {}) {
1066
- const { cachePrefix: _cachePrefix = "" } = config;
1067
- async function validateAddress(params) {
1068
- try {
1069
- const response = await api.smartyStreets.us.lookup.get(params);
1070
- const data = response.data;
1071
- if (data) {
1072
- return { data, status: "success" };
1073
- }
1074
- return { data: void 0, status: "not_found" };
1075
- } catch (e) {
1076
- const message = e instanceof Error ? e.message : String(e);
1077
- return { data: void 0, status: "error", error: { message } };
1078
- }
1079
- }
1080
- return {
1081
- validateAddress
1082
- };
1083
- }
1084
-
1085
- // src/actions/p21-pim.ts
1086
- function createP21PimActions(api, config = {}) {
1087
- const { cachePrefix = "", edgeCache = 1, redisTtl = 3600 } = config;
1088
- async function getInvMastExt(invMastUid) {
1089
- return withServerCache(
1090
- cachePrefix,
1091
- redisTtl,
1092
- "p21Pim.invMastExt.get",
1093
- async () => {
1094
- const response = await api.p21Pim.invMastExt.get(invMastUid);
1095
- return response.data;
1096
- },
1097
- invMastUid
1098
- );
1099
- }
1100
- async function listInvMastExt(params) {
1101
- return withServerCache(
1102
- cachePrefix,
1103
- redisTtl,
1104
- "p21Pim.invMastExt.list",
1105
- async () => {
1106
- const response = await api.p21Pim.invMastExt.list({
1107
- ...params,
1108
- edgeCache
1109
- });
1110
- return response.data;
1111
- },
1112
- params
1113
- );
1114
- }
1115
- return {
1116
- getInvMastExt,
1117
- listInvMastExt
1118
- };
1119
- }
1120
-
1121
- // src/actions/agr-site.ts
1122
- function createAgrSiteActions(api, config = {}) {
1123
- const {
1124
- cachePrefix = "",
1125
- longEdgeCache = 8,
1126
- longRedisTtl = 28800
1127
- } = config;
1128
- async function getSettings(serviceName) {
1129
- return withServerCache(
1130
- cachePrefix,
1131
- longRedisTtl,
1132
- "agrSite.settings.list",
1133
- async () => {
1134
- const response = await api.agrSite.settings.list({
1135
- ...serviceName ? { serviceName } : {},
1136
- edgeCache: longEdgeCache
1137
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1138
- });
1139
- return response.data;
1140
- },
1141
- serviceName
1142
- );
1143
- }
1144
- async function getMetaFiles(params) {
1145
- return withServerCache(
1146
- cachePrefix,
1147
- longRedisTtl,
1148
- "agrSite.metaFiles.list",
1149
- async () => {
1150
- const response = await api.agrSite.metaFiles.list({
1151
- ...params,
1152
- edgeCache: longEdgeCache
1153
- });
1154
- return response.data;
1155
- },
1156
- params
1157
- );
1158
- }
1159
- return {
1160
- getSettings,
1161
- getMetaFiles
1162
- };
1163
- }
1164
-
1165
- // src/actions/avalara.ts
1166
- function createAvalaraActions(api, config = {}) {
1167
- const { cachePrefix: _cachePrefix = "" } = config;
1168
- async function calculateTax(data) {
1169
- const response = await api.avalara.rates.create(data);
1170
- return response.data;
1171
- }
1172
- return {
1173
- calculateTax
1174
- };
1175
- }
1176
-
1177
- // src/actions/payments.ts
1178
- function createPaymentsActions(api, config = {}) {
1179
- const { cachePrefix: _cachePrefix = "", mode = "live" } = config;
1180
- function withMode(params) {
1181
- return { mode, ...params };
1182
- }
1183
- async function transactionSetup(params) {
1184
- try {
1185
- const response = (
1186
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1187
- await api.payments.unified.transactionSetup.get(withMode(params))
1188
- );
1189
- return response.data;
1190
- } catch {
1191
- return void 0;
1192
- }
1193
- }
1194
- async function accountQuery(params) {
1195
- try {
1196
- const response = (
1197
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1198
- await api.payments.unified.accountQuery.get(withMode(params))
1199
- );
1200
- return response.data;
1201
- } catch {
1202
- return void 0;
1203
- }
1204
- }
1205
- async function getSurcharge(params) {
1206
- try {
1207
- const response = (
1208
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1209
- await api.payments.unified.surcharge.get(withMode(params))
1210
- );
1211
- return response.data;
1212
- } catch {
1213
- return void 0;
1214
- }
1215
- }
1216
- async function cardInfo(params) {
1217
- try {
1218
- const response = (
1219
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1220
- await api.payments.unified.cardInfo.get(withMode(params))
1221
- );
1222
- return response.data;
1223
- } catch {
1224
- return void 0;
1225
- }
1226
- }
1227
- async function billingUpdate(params) {
1228
- try {
1229
- const response = (
1230
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1231
- await api.payments.unified.billingUpdate.get(withMode(params))
1232
- );
1233
- return response.data;
1234
- } catch {
1235
- return void 0;
1236
- }
1237
- }
1238
- async function validatePayment(params) {
1239
- try {
1240
- const response = (
1241
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1242
- await api.payments.unified.validate.get(withMode(params))
1243
- );
1244
- return response.data;
1245
- } catch {
1246
- return void 0;
1247
- }
1248
- }
1249
- return {
1250
- transactionSetup,
1251
- accountQuery,
1252
- getSurcharge,
1253
- cardInfo,
1254
- billingUpdate,
1255
- validatePayment
1256
- };
1257
- }
1258
-
1259
- // src/actions/ups.ts
1260
- function createUpsActions(api, config = {}) {
1261
- const { cachePrefix: _cachePrefix = "" } = config;
1262
- async function getRates(params) {
1263
- try {
1264
- const response = await api.ups.ratesShop.get(params);
1265
- return response.data;
1266
- } catch {
1267
- return void 0;
1268
- }
1269
- }
1270
- return {
1271
- getRates
1272
- };
1273
- }
1274
-
1275
- // src/actions/logistics.ts
1276
- function createLogisticsActions(api, config = {}) {
1277
- const {
1278
- cachePrefix = "",
1279
- longEdgeCache = 8,
1280
- longRedisTtl = 28800
1281
- } = config;
1282
- async function getFreightRates(params) {
1283
- try {
1284
- const response = await api.logistics.speedship.freight.get(params);
1285
- return response.data;
1286
- } catch {
1287
- return void 0;
1288
- }
1289
- }
1290
- async function getShipVia(params) {
1291
- return withServerCache(
1292
- cachePrefix,
1293
- longRedisTtl,
1294
- "logistics.shipvia.rates.list",
1295
- async () => {
1296
- const response = await api.logistics.shipvia.rates.list({
1297
- ...params,
1298
- edgeCache: longEdgeCache
1299
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1300
- });
1301
- return response.data;
1302
- },
1303
- params ? JSON.stringify(params) : void 0
1304
- );
1305
- }
1306
- return {
1307
- getFreightRates,
1308
- getShipVia
1309
- };
1310
- }
1311
-
1312
- // src/actions/nexus.ts
1313
- function createNexusActions(api, config = {}) {
1314
- const {
1315
- cachePrefix = "",
1316
- edgeCache = 1,
1317
- redisTtl = 3600
1318
- } = config;
1319
- async function createBinTransfer(data) {
1320
- try {
1321
- const response = await api.nexus.binTransfer.create(data);
1322
- return response.data;
1323
- } catch {
1324
- return void 0;
1325
- }
1326
- }
1327
- async function createReceiving(data) {
1328
- try {
1329
- const response = await api.nexus.receiving.create(data);
1330
- return response.data;
1331
- } catch {
1332
- return void 0;
1333
- }
1334
- }
1335
- async function createTransfer(data) {
1336
- try {
1337
- const response = await api.nexus.transfer.create(data);
1338
- return response.data;
1339
- } catch {
1340
- return void 0;
1341
- }
1342
- }
1343
- async function getPurchaseOrderReceipts(params) {
1344
- return withServerCache(
1345
- cachePrefix,
1346
- redisTtl,
1347
- "nexus.purchaseOrderReceipt.list",
1348
- async () => {
1349
- const response = await api.nexus.purchaseOrderReceipt.list({
1350
- ...params,
1351
- edgeCache
1352
- });
1353
- return response.data;
1354
- },
1355
- params ? JSON.stringify(params) : void 0
1356
- );
1357
- }
1358
- async function getTransferReceipts(params) {
1359
- return withServerCache(
1360
- cachePrefix,
1361
- redisTtl,
1362
- "nexus.transferReceipt.list",
1363
- async () => {
1364
- const response = await api.nexus.transferReceipt.list({
1365
- ...params,
1366
- edgeCache
1367
- });
1368
- return response.data;
1369
- },
1370
- params ? JSON.stringify(params) : void 0
1371
- );
1372
- }
1373
- async function getTransferShipping(params) {
1374
- return withServerCache(
1375
- cachePrefix,
1376
- redisTtl,
1377
- "nexus.transferShipping.list",
1378
- async () => {
1379
- const response = await api.nexus.transferShipping.list({
1380
- ...params,
1381
- edgeCache
1382
- });
1383
- return response.data;
1384
- },
1385
- params ? JSON.stringify(params) : void 0
1386
- );
1387
- }
1388
- return {
1389
- createBinTransfer,
1390
- createReceiving,
1391
- createTransfer,
1392
- getPurchaseOrderReceipts,
1393
- getTransferReceipts,
1394
- getTransferShipping
1395
- };
1396
- }
1397
-
1398
- // src/actions/vmi.ts
1399
- function createVmiActions(api, config = {}) {
1400
- const {
1401
- cachePrefix = "",
1402
- edgeCache = 1,
1403
- redisTtl = 3600,
1404
- shortRedisTtl = 300
1405
- } = config;
1406
- async function getWarehouses(params) {
1407
- return withServerCache(
1408
- cachePrefix,
1409
- redisTtl,
1410
- "vmi.warehouse.list",
1411
- async () => {
1412
- const response = await api.vmi.warehouse.list({
1413
- ...params,
1414
- edgeCache
1415
- });
1416
- return response.data;
1417
- },
1418
- params ? JSON.stringify(params) : void 0
1419
- );
1420
- }
1421
- async function getWarehouseAvailability(warehouseUid, params) {
1422
- return withServerCache(
1423
- cachePrefix,
1424
- shortRedisTtl,
1425
- "vmi.warehouse.availability.get",
1426
- async () => {
1427
- const response = await api.vmi.warehouse.availability.get(
1428
- warehouseUid,
1429
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1430
- { ...params, edgeCache }
1431
- );
1432
- return response.data;
1433
- },
1434
- warehouseUid,
1435
- params ? JSON.stringify(params) : void 0
1436
- );
1437
- }
1438
- async function getDistributors(params) {
1439
- return withServerCache(
1440
- cachePrefix,
1441
- redisTtl,
1442
- "vmi.distributors.list",
1443
- async () => {
1444
- const response = await api.vmi.distributors.list({
1445
- ...params,
1446
- edgeCache
1447
- });
1448
- return response.data;
1449
- },
1450
- params ? JSON.stringify(params) : void 0
1451
- );
1452
- }
1453
- async function getProducts(params) {
1454
- return withServerCache(
1455
- cachePrefix,
1456
- redisTtl,
1457
- "vmi.products.list",
1458
- async () => {
1459
- const response = await api.vmi.products.list({
1460
- ...params,
1461
- edgeCache
1462
- });
1463
- return response.data;
1464
- },
1465
- params ? JSON.stringify(params) : void 0
1466
- );
1467
- }
1468
- async function getInventoryProfiles(params) {
1469
- return withServerCache(
1470
- cachePrefix,
1471
- redisTtl,
1472
- "vmi.invProfileHdr.list",
1473
- async () => {
1474
- const response = await api.vmi.invProfileHdr.list({
1475
- ...params,
1476
- edgeCache
1477
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1478
- });
1479
- return response.data;
1480
- },
1481
- params ? JSON.stringify(params) : void 0
1482
- );
1483
- }
1484
- async function getRestockHeaders(params) {
1485
- return withServerCache(
1486
- cachePrefix,
1487
- redisTtl,
1488
- "vmi.restockHdr.list",
1489
- async () => {
1490
- const response = await api.vmi.restockHdr.list({
1491
- ...params,
1492
- edgeCache
1493
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1494
- });
1495
- return response.data;
1496
- },
1497
- params ? JSON.stringify(params) : void 0
1498
- );
1499
- }
1500
- async function getSections(params) {
1501
- return withServerCache(
1502
- cachePrefix,
1503
- redisTtl,
1504
- "vmi.sections.list",
1505
- async () => {
1506
- const response = await api.vmi.sections.list({
1507
- ...params,
1508
- edgeCache
1509
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1510
- });
1511
- return response.data;
1512
- },
1513
- params ? JSON.stringify(params) : void 0
1514
- );
1515
- }
1516
- return {
1517
- getWarehouses,
1518
- getWarehouseAvailability,
1519
- getDistributors,
1520
- getProducts,
1521
- getInventoryProfiles,
1522
- getRestockHeaders,
1523
- getSections
1524
- };
1525
- }
1526
-
1527
- // src/actions/p21-core.ts
1528
- function createP21CoreActions(api, config = {}) {
1529
- const {
1530
- cachePrefix = "",
1531
- edgeCache = 1,
1532
- longEdgeCache = 8,
1533
- redisTtl = 3600,
1534
- longRedisTtl = 28800
1535
- } = config;
1536
- async function getAddresses(params) {
1537
- return withServerCache(
1538
- cachePrefix,
1539
- redisTtl,
1540
- "p21Core.address.list",
1541
- async () => {
1542
- const response = await api.p21Core.address.list({
1543
- ...params,
1544
- edgeCache
1545
- });
1546
- return response.data;
1547
- },
1548
- params
1549
- );
1550
- }
1551
- async function getCompanies(params) {
1552
- return withServerCache(
1553
- cachePrefix,
1554
- longRedisTtl,
1555
- "p21Core.company.list",
1556
- async () => {
1557
- const response = await api.p21Core.company.list({
1558
- ...params,
1559
- edgeCache: longEdgeCache
1560
- });
1561
- return response.data;
1562
- },
1563
- params
1564
- );
1565
- }
1566
- async function getCompany(companyId) {
1567
- return withServerCache(
1568
- cachePrefix,
1569
- longRedisTtl,
1570
- "p21Core.company.get",
1571
- async () => {
1572
- const response = await api.p21Core.company.get({
1573
- companyUid: companyId,
1574
- edgeCache: longEdgeCache
1575
- });
1576
- return response.data;
1577
- },
1578
- companyId
1579
- );
1580
- }
1581
- async function getLocations(params) {
1582
- return withServerCache(
1583
- cachePrefix,
1584
- longRedisTtl,
1585
- "p21Core.location.list",
1586
- async () => {
1587
- const response = await api.p21Core.location.list({
1588
- ...params,
1589
- edgeCache: longEdgeCache
1590
- });
1591
- return response.data;
1592
- },
1593
- params
1594
- );
1595
- }
1596
- async function getPaymentTypes(params) {
1597
- return withServerCache(
1598
- cachePrefix,
1599
- longRedisTtl,
1600
- "p21Core.paymentTypes.list",
1601
- async () => {
1602
- const response = await api.p21Core.paymentTypes.list({
1603
- ...params,
1604
- edgeCache: longEdgeCache
1605
- });
1606
- return response.data;
1607
- },
1608
- params
1609
- );
1610
- }
1611
- async function getCashDrawers(params) {
1612
- return withServerCache(
1613
- cachePrefix,
1614
- redisTtl,
1615
- "p21Core.cashDrawer.list",
1616
- async () => {
1617
- const response = await api.p21Core.cashDrawer.list({
1618
- ...params,
1619
- edgeCache
1620
- });
1621
- return response.data;
1622
- },
1623
- params
1624
- );
1625
- }
1626
- async function getCodeP21(params) {
1627
- return withServerCache(
1628
- cachePrefix,
1629
- longRedisTtl,
1630
- "p21Core.codeP21.list",
1631
- async () => {
1632
- const response = await api.p21Core.codeP21.list({
1633
- ...params,
1634
- edgeCache: longEdgeCache
1635
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1636
- });
1637
- return response.data;
1638
- },
1639
- params
1640
- );
1641
- }
1642
- return {
1643
- getAddresses,
1644
- getCompanies,
1645
- getCompany,
1646
- getLocations,
1647
- getPaymentTypes,
1648
- getCashDrawers,
1649
- getCodeP21
1650
- };
1651
- }
1652
-
1653
- // src/actions/p21-apis.ts
1654
- function createP21ApisActions(api, config = {}) {
1655
- const {
1656
- cachePrefix = "",
1657
- edgeCache = 1,
1658
- redisTtl = 3600
1659
- } = config;
1660
- async function getCategories(params) {
1661
- return withServerCache(
1662
- cachePrefix,
1663
- redisTtl,
1664
- "p21Apis.transCategory.list",
1665
- async () => {
1666
- const response = await api.p21Apis.transCategory.list({
1667
- ...params,
1668
- edgeCache
1669
- });
1670
- return response.data;
1671
- },
1672
- params
1673
- );
1674
- }
1675
- async function getCategoryDefaults(categoryId) {
1676
- return withServerCache(
1677
- cachePrefix,
1678
- redisTtl,
1679
- "p21Apis.transCategory.defaults.get",
1680
- async () => {
1681
- const response = await api.p21Apis.transCategory.defaults.get(
1682
- categoryId,
1683
- { edgeCache }
1684
- );
1685
- return response.data;
1686
- },
1687
- categoryId
1688
- );
1689
- }
1690
- async function getCompanies(params) {
1691
- return withServerCache(
1692
- cachePrefix,
1693
- redisTtl,
1694
- "p21Apis.transCompany.list",
1695
- async () => {
1696
- const response = await api.p21Apis.transCompany.list({
1697
- ...params,
1698
- edgeCache
1699
- });
1700
- return response.data;
1701
- },
1702
- params
1703
- );
1704
- }
1705
- async function getUsers(params) {
1706
- return withServerCache(
1707
- cachePrefix,
1708
- redisTtl,
1709
- "p21Apis.transUser.list",
1710
- async () => {
1711
- const response = await api.p21Apis.transUser.list({
1712
- ...params,
1713
- edgeCache
1714
- });
1715
- return response.data;
1716
- },
1717
- params
1718
- );
1719
- }
1720
- async function getWebDisplayTypes(params) {
1721
- return withServerCache(
1722
- cachePrefix,
1723
- redisTtl,
1724
- "p21Apis.transWebDisplayType.list",
1725
- async () => {
1726
- const response = await api.p21Apis.transWebDisplayType.list({
1727
- ...params,
1728
- edgeCache
1729
- });
1730
- return response.data;
1731
- },
1732
- params
1733
- );
1734
- }
1735
- async function getWebDisplayTypeDefaults(id) {
1736
- return withServerCache(
1737
- cachePrefix,
1738
- redisTtl,
1739
- "p21Apis.transWebDisplayType.defaults.get",
1740
- async () => {
1741
- const response = await api.p21Apis.transWebDisplayType.defaults.get({
1742
- id,
1743
- edgeCache
1744
- });
1745
- return response.data;
1746
- },
1747
- id
1748
- );
1749
- }
1750
- async function refreshContacts(params) {
1751
- try {
1752
- const response = (
1753
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1754
- await api.p21Apis.entityContacts.refresh.create(params)
1755
- );
1756
- return response.data;
1757
- } catch {
1758
- return void 0;
1759
- }
1760
- }
1761
- async function refreshCustomers(params) {
1762
- try {
1763
- const response = (
1764
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1765
- await api.p21Apis.entityCustomers.refresh.create(params)
1766
- );
1767
- return response.data;
1768
- } catch {
1769
- return void 0;
1770
- }
1771
- }
1772
- return {
1773
- getCategories,
1774
- getCategoryDefaults,
1775
- getCompanies,
1776
- getUsers,
1777
- getWebDisplayTypes,
1778
- getWebDisplayTypeDefaults,
1779
- refreshContacts,
1780
- refreshCustomers
1781
- };
1782
- }
1783
-
1784
- // src/actions/p21-sism.ts
1785
- function createP21SismActions(api, config = {}) {
1786
- const {
1787
- cachePrefix = "",
1788
- edgeCache = 1,
1789
- redisTtl = 3600
1790
- } = config;
1791
- async function getRecentImports(params) {
1792
- return withServerCache(
1793
- cachePrefix,
1794
- redisTtl,
1795
- "p21Sism.import.recent.list",
1796
- async () => {
1797
- const response = await api.p21Sism.import.recent.list({
1798
- ...params,
1799
- edgeCache
1800
- });
1801
- return response.data;
1802
- },
1803
- params
1804
- );
1805
- }
1806
- async function getImport(importId) {
1807
- return withServerCache(
1808
- cachePrefix,
1809
- redisTtl,
1810
- "p21Sism.import.get",
1811
- async () => {
1812
- const response = await api.p21Sism.import.get(importId);
1813
- return response.data;
1814
- },
1815
- importId
1816
- );
1817
- }
1818
- async function getImportLines(importId, params) {
1819
- return withServerCache(
1820
- cachePrefix,
1821
- redisTtl,
1822
- "p21Sism.impOeLine.list",
1823
- async () => {
1824
- const response = await api.p21Sism.impOeLine.list({
1825
- ...params,
1826
- importUid: importId,
1827
- edgeCache
1828
- });
1829
- return response.data;
1830
- },
1831
- importId,
1832
- params
1833
- );
1834
- }
1835
- async function getScheduledImports(params) {
1836
- return withServerCache(
1837
- cachePrefix,
1838
- redisTtl,
1839
- "p21Sism.scheduledImportMaster.list",
1840
- async () => {
1841
- const response = await api.p21Sism.scheduledImportMaster.list({
1842
- ...params,
1843
- edgeCache
1844
- });
1845
- return response.data;
1846
- },
1847
- params
1848
- );
1849
- }
1850
- return {
1851
- getRecentImports,
1852
- getImport,
1853
- getImportLines,
1854
- getScheduledImports
1855
- };
1856
- }
1857
-
1858
- // src/actions/agr-work.ts
1859
- function createAgrWorkActions(api, _config = {}) {
1860
- async function healthCheck() {
1861
- try {
1862
- const response = await api.agrWork.healthCheck.get();
1863
- return response.data;
1864
- } catch {
1865
- return void 0;
1866
- }
1867
- }
1868
- async function ping() {
1869
- try {
1870
- const response = await api.agrWork.ping.get();
1871
- return response.data;
1872
- } catch {
1873
- return void 0;
1874
- }
1875
- }
1876
- return {
1877
- healthCheck,
1878
- ping
1879
- };
1880
- }
1881
-
1882
- // src/actions/agr-info.ts
1883
- function createAgrInfoActions(api, config = {}) {
1884
- const {
1885
- cachePrefix = "",
1886
- edgeCache = 1,
1887
- longEdgeCache = 8,
1888
- redisTtl = 3600,
1889
- longRedisTtl = 28800
1890
- } = config;
1891
- async function getContext(params) {
1892
- return withServerCache(
1893
- cachePrefix,
1894
- redisTtl,
1895
- "agrInfo.context.list",
1896
- async () => {
1897
- const siteId = params?.siteId ?? "";
1898
- const response = await api.agrInfo.context.get(siteId, {
1899
- ...params,
1900
- edgeCache
1901
- });
1902
- return Array.isArray(response.data) ? response.data : [response.data];
1903
- },
1904
- params
1905
- );
1906
- }
1907
- async function getRubrics(params) {
1908
- return withServerCache(
1909
- cachePrefix,
1910
- redisTtl,
1911
- "agrInfo.rubrics.list",
1912
- async () => {
1913
- const response = await api.agrInfo.rubrics.list({
1914
- ...params,
1915
- edgeCache
1916
- });
1917
- return response.data;
1918
- },
1919
- params
1920
- );
1921
- }
1922
- async function getMicroservices(params) {
1923
- return withServerCache(
1924
- cachePrefix,
1925
- longRedisTtl,
1926
- "agrInfo.microservices.list",
1927
- async () => {
1928
- const response = await api.agrInfo.microservices.list({
1929
- ...params,
1930
- edgeCache: longEdgeCache
1931
- });
1932
- return response.data;
1933
- },
1934
- params
1935
- );
1936
- }
1937
- async function generateAkasha(data) {
1938
- try {
1939
- const response = await api.agrInfo.akasha.generate.create(data);
1940
- return response.data;
1941
- } catch {
1942
- return void 0;
1943
- }
1944
- }
1945
- async function generateJoomla(data) {
1946
- try {
1947
- const response = await api.agrInfo.joomla.generate.create(data);
1948
- return response.data;
1949
- } catch {
1950
- return void 0;
1951
- }
1952
- }
1953
- return {
1954
- getContext,
1955
- getRubrics,
1956
- getMicroservices,
1957
- generateAkasha,
1958
- generateJoomla
1959
- };
1960
- }
1961
-
1962
- // src/actions/basecamp2.ts
1963
- function createBasecamp2Actions(api, config = {}) {
1964
- const {
1965
- cachePrefix = "",
1966
- edgeCache = 1,
1967
- longEdgeCache = 8,
1968
- redisTtl = 3600,
1969
- longRedisTtl = 28800
1970
- } = config;
1971
- async function getTodos(params) {
1972
- return withServerCache(
1973
- cachePrefix,
1974
- redisTtl,
1975
- "basecamp2.todos.list",
1976
- async () => {
1977
- const response = await api.basecamp2.todos.list({
1978
- ...params,
1979
- edgeCache
1980
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1981
- });
1982
- return response.data;
1983
- },
1984
- params
1985
- );
1986
- }
1987
- async function getTodo(todoId) {
1988
- return withServerCache(
1989
- cachePrefix,
1990
- redisTtl,
1991
- "basecamp2.todos.get",
1992
- async () => {
1993
- const response = await api.basecamp2.todos.get(todoId, { edgeCache });
1994
- return response.data;
1995
- },
1996
- todoId
1997
- );
1998
- }
1999
- async function getTodosSummary(params) {
2000
- return withServerCache(
2001
- cachePrefix,
2002
- redisTtl,
2003
- "basecamp2.todosSummary.list",
2004
- async () => {
2005
- const response = await api.basecamp2.todosSummary.list({
2006
- ...params,
2007
- edgeCache
2008
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2009
- });
2010
- return response.data;
2011
- },
2012
- params
2013
- );
2014
- }
2015
- async function getComments(params) {
2016
- return withServerCache(
2017
- cachePrefix,
2018
- redisTtl,
2019
- "basecamp2.comments.list",
2020
- async () => {
2021
- const response = await api.basecamp2.comments.list({
2022
- ...params,
2023
- edgeCache
2024
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2025
- });
2026
- return response.data;
2027
- },
2028
- params
2029
- );
2030
- }
2031
- async function getPeople(params) {
2032
- return withServerCache(
2033
- cachePrefix,
2034
- longRedisTtl,
2035
- "basecamp2.people.list",
2036
- async () => {
2037
- const response = await api.basecamp2.people.list({
2038
- ...params,
2039
- edgeCache: longEdgeCache
2040
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2041
- });
2042
- return response.data;
2043
- },
2044
- params
2045
- );
2046
- }
2047
- async function getProjects(params) {
2048
- return withServerCache(
2049
- cachePrefix,
2050
- redisTtl,
2051
- "basecamp2.projects.list",
2052
- async () => {
2053
- const response = await api.basecamp2.projects.list({
2054
- ...params,
2055
- edgeCache
2056
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2057
- });
2058
- return response.data;
2059
- },
2060
- params
2061
- );
2062
- }
2063
- async function getEvents(params) {
2064
- return withServerCache(
2065
- cachePrefix,
2066
- redisTtl,
2067
- "basecamp2.events.list",
2068
- async () => {
2069
- const response = await api.basecamp2.events.list({
2070
- ...params,
2071
- edgeCache
2072
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2073
- });
2074
- return response.data;
2075
- },
2076
- params
2077
- );
2078
- }
2079
- async function getMetrics(params) {
2080
- return withServerCache(
2081
- cachePrefix,
2082
- redisTtl,
2083
- "basecamp2.metrics.list",
2084
- async () => {
2085
- const response = await api.basecamp2.metrics.list({
2086
- ...params,
2087
- edgeCache
2088
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2089
- });
2090
- return response.data;
2091
- },
2092
- params
2093
- );
2094
- }
2095
- async function getTodolists(params) {
2096
- return withServerCache(
2097
- cachePrefix,
2098
- redisTtl,
2099
- "basecamp2.todolists.list",
2100
- async () => {
2101
- const response = await api.basecamp2.todolists.list({
2102
- ...params,
2103
- edgeCache
2104
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2105
- });
2106
- return response.data;
2107
- },
2108
- params
2109
- );
2110
- }
2111
- return {
2112
- getTodos,
2113
- getTodo,
2114
- getTodosSummary,
2115
- getComments,
2116
- getPeople,
2117
- getProjects,
2118
- getEvents,
2119
- getMetrics,
2120
- getTodolists
2121
- };
2122
- }
6
+ createServerQueryClient,
7
+ getServerQueryClient
8
+ } from "./chunk-I7EWYSPA.js";
9
+ import {
10
+ cacheGet,
11
+ cacheSet,
12
+ createAgrInfoActions,
13
+ createAgrSiteActions,
14
+ createAgrWorkActions,
15
+ createAvalaraActions,
16
+ createBasecamp2Actions,
17
+ createBrandFolderActions,
18
+ createCommerceActions,
19
+ createCustomersActions,
20
+ createGregorovichActions,
21
+ createItemActions,
22
+ createJoomlaActions,
23
+ createLegacyActions,
24
+ createLogisticsActions,
25
+ createNexusActions,
26
+ createOrderActions,
27
+ createP21ApisActions,
28
+ createP21CoreActions,
29
+ createP21PimActions,
30
+ createP21SismActions,
31
+ createPaymentsActions,
32
+ createPricingActions,
33
+ createSearchActions,
34
+ createShippingActions,
35
+ createSiteActions,
36
+ createSlackActions,
37
+ createSmartyStreetsActions,
38
+ createUpsActions,
39
+ createVmiActions,
40
+ env,
41
+ getCircuitState,
42
+ isDev,
43
+ isProduction,
44
+ isRedisConnected,
45
+ isStaging,
46
+ withServerCache
47
+ } from "./chunk-AFVX4ZDP.js";
48
+ import {
49
+ batchFetch
50
+ } from "./chunk-XGRQ53P2.js";
2123
51
 
2124
- // src/actions/brand-folder.ts
2125
- function createBrandFolderActions(api, config = {}) {
2126
- const { cachePrefix = "", edgeCache = 1, redisTtl = 3600 } = config;
2127
- async function getCategories(params) {
2128
- return withServerCache(
2129
- cachePrefix,
2130
- redisTtl,
2131
- "brandFolder.categories.list",
2132
- async () => {
2133
- const response = await api.brandFolder.categories.list({
2134
- ...params,
2135
- edgeCache
2136
- });
2137
- return response.data;
2138
- },
2139
- params
2140
- );
2141
- }
2142
- async function getCategory(categoryId) {
2143
- return withServerCache(
2144
- cachePrefix,
2145
- redisTtl,
2146
- "brandFolder.categories.get",
2147
- async () => {
2148
- const response = await api.brandFolder.categories.get(categoryId, {
2149
- edgeCache
2150
- });
2151
- return response.data;
2152
- },
2153
- categoryId
2154
- );
2155
- }
2156
- async function createFocus(categoryId, data) {
2157
- try {
2158
- const response = await api.brandFolder.categories.focus.create({
2159
- ...data,
2160
- categoryId
2161
- });
2162
- return response.data;
2163
- } catch {
2164
- return void 0;
2165
- }
2166
- }
2167
- return {
2168
- getCategories,
2169
- getCategory,
2170
- createFocus
2171
- };
52
+ // src/sdk-call.ts
53
+ async function sdkCall(method, ...args) {
54
+ return method(...args);
2172
55
  }
2173
-
2174
- // src/actions/gregorovich.ts
2175
- function createGregorovichActions(api, config = {}) {
2176
- const { cachePrefix = "", redisTtl = 3600 } = config;
2177
- async function askChatGpt(params) {
2178
- try {
2179
- const response = await api.gregorovich.chatGpt.ask.get(params);
2180
- return response.data;
2181
- } catch {
2182
- return void 0;
2183
- }
2184
- }
2185
- async function getDocuments(params) {
2186
- return withServerCache(
2187
- cachePrefix,
2188
- redisTtl,
2189
- "gregorovich.documents.list",
2190
- async () => {
2191
- const response = await api.gregorovich.documents.list();
2192
- return response.data;
2193
- },
2194
- params
2195
- );
2196
- }
2197
- async function createDocument(data) {
2198
- try {
2199
- const response = await api.gregorovich.documents.create(data);
2200
- return response.data;
2201
- } catch {
2202
- return void 0;
2203
- }
2204
- }
2205
- async function generateOllama(data) {
2206
- try {
2207
- const response = await api.gregorovich.ollama.generate.create(data);
2208
- return response.data;
2209
- } catch {
2210
- return void 0;
2211
- }
56
+ async function safeAction(fn, onError) {
57
+ try {
58
+ const data = await fn();
59
+ return { ok: true, data };
60
+ } catch (e) {
61
+ const error = e instanceof Error ? e : new Error(String(e));
62
+ if (onError) onError(error);
63
+ return { ok: false, error: error.message };
2212
64
  }
2213
- return {
2214
- askChatGpt,
2215
- getDocuments,
2216
- createDocument,
2217
- generateOllama
2218
- };
2219
65
  }
2220
66
 
2221
- // src/actions/slack.ts
2222
- function createSlackActions(api, config = {}) {
2223
- const { cachePrefix = "", edgeCache = 1, redisTtl = 3600 } = config;
2224
- async function sendWebhook(data) {
2225
- try {
2226
- const response = await api.slack.webHook.create(data);
2227
- return response.data;
2228
- } catch {
2229
- return void 0;
2230
- }
2231
- }
2232
- async function getWebhooks(params) {
2233
- return withServerCache(
2234
- cachePrefix,
2235
- redisTtl,
2236
- "slack.webHook.list",
2237
- async () => {
2238
- const response = await api.slack.webHook.list({
2239
- ...params,
2240
- edgeCache
2241
- });
2242
- return response.data;
2243
- },
2244
- params
2245
- );
2246
- }
67
+ // src/pagination.ts
68
+ function paginateOffset(items, pageParam, limit, total) {
69
+ const hasMore = total !== void 0 ? (pageParam + 1) * limit < total : items.length === limit;
2247
70
  return {
2248
- sendWebhook,
2249
- getWebhooks
71
+ data: items,
72
+ total,
73
+ nextCursor: hasMore ? pageParam + 1 : void 0,
74
+ hasMore
2250
75
  };
2251
76
  }
2252
77
 
@@ -2341,224 +166,6 @@ function createFavoritesActions(api, config = {}) {
2341
166
  }
2342
167
  return { getFavorites, addFavorite, removeFavorite };
2343
168
  }
2344
-
2345
- // src/actions/site.ts
2346
- function createSiteActions(api, config = {}) {
2347
- const {
2348
- cachePrefix,
2349
- edgeCache,
2350
- redisTtl,
2351
- longEdgeCache,
2352
- longRedisTtl,
2353
- defaultContactId,
2354
- defaultCustomerId,
2355
- convertUnitOfMeasure
2356
- } = config;
2357
- const cache = { cachePrefix, edgeCache, redisTtl };
2358
- const longCache = { ...cache, longEdgeCache, longRedisTtl };
2359
- function castApi() {
2360
- return api;
2361
- }
2362
- function lazy(fn) {
2363
- let instance;
2364
- return {
2365
- get() {
2366
- if (instance === void 0) instance = fn();
2367
- return instance;
2368
- }
2369
- };
2370
- }
2371
- const pricing = lazy(
2372
- () => createPricingActions(castApi(), {
2373
- ...cache,
2374
- defaultCustomerId,
2375
- ...config.pricing
2376
- })
2377
- );
2378
- const items = lazy(
2379
- () => createItemActions(castApi(), {
2380
- ...longCache,
2381
- ...config.items
2382
- })
2383
- );
2384
- const commerce = lazy(
2385
- () => createCommerceActions(castApi(), {
2386
- defaultContactId,
2387
- defaultCustomerId,
2388
- convertUnitOfMeasure
2389
- })
2390
- );
2391
- const search = lazy(
2392
- () => createSearchActions(castApi(), {
2393
- ...cache,
2394
- ...config.search
2395
- })
2396
- );
2397
- const orders = lazy(
2398
- () => createOrderActions(castApi(), cache)
2399
- );
2400
- const shipping = lazy(
2401
- () => createShippingActions(
2402
- castApi(),
2403
- { ...cache, ...config.shipping }
2404
- )
2405
- );
2406
- const joomla = lazy(
2407
- () => createJoomlaActions(castApi(), cache)
2408
- );
2409
- const legacy = lazy(
2410
- () => createLegacyActions(castApi(), longCache)
2411
- );
2412
- const customers = lazy(
2413
- () => createCustomersActions(castApi(), cache)
2414
- );
2415
- const smartyStreets = lazy(
2416
- () => createSmartyStreetsActions(castApi(), {
2417
- cachePrefix
2418
- })
2419
- );
2420
- const p21Pim = lazy(
2421
- () => createP21PimActions(castApi(), cache)
2422
- );
2423
- const agrSite = lazy(
2424
- () => createAgrSiteActions(castApi(), {
2425
- cachePrefix,
2426
- longEdgeCache,
2427
- longRedisTtl
2428
- })
2429
- );
2430
- const avalara = lazy(
2431
- () => createAvalaraActions(castApi(), { cachePrefix })
2432
- );
2433
- const payments = lazy(
2434
- () => createPaymentsActions(castApi(), {
2435
- cachePrefix,
2436
- ...config.payments
2437
- })
2438
- );
2439
- const ups = lazy(
2440
- () => createUpsActions(castApi(), { cachePrefix })
2441
- );
2442
- const logistics = lazy(
2443
- () => createLogisticsActions(castApi(), longCache)
2444
- );
2445
- const nexus = lazy(
2446
- () => createNexusActions(castApi(), cache)
2447
- );
2448
- const vmi = lazy(
2449
- () => createVmiActions(castApi(), { ...cache, ...config.vmi })
2450
- );
2451
- const p21Core = lazy(
2452
- () => createP21CoreActions(castApi(), longCache)
2453
- );
2454
- const p21Apis = lazy(
2455
- () => createP21ApisActions(castApi(), cache)
2456
- );
2457
- const p21Sism = lazy(
2458
- () => createP21SismActions(castApi(), cache)
2459
- );
2460
- const agrWork = lazy(
2461
- () => createAgrWorkActions(castApi(), { cachePrefix })
2462
- );
2463
- const agrInfo = lazy(
2464
- () => createAgrInfoActions(castApi(), longCache)
2465
- );
2466
- const basecamp2 = lazy(
2467
- () => createBasecamp2Actions(castApi(), longCache)
2468
- );
2469
- const brandFolder = lazy(
2470
- () => createBrandFolderActions(castApi(), cache)
2471
- );
2472
- const gregorovich = lazy(
2473
- () => createGregorovichActions(castApi(), cache)
2474
- );
2475
- const slack = lazy(
2476
- () => createSlackActions(castApi(), cache)
2477
- );
2478
- return {
2479
- get pricing() {
2480
- return pricing.get();
2481
- },
2482
- get items() {
2483
- return items.get();
2484
- },
2485
- get commerce() {
2486
- return commerce.get();
2487
- },
2488
- get search() {
2489
- return search.get();
2490
- },
2491
- get orders() {
2492
- return orders.get();
2493
- },
2494
- get shipping() {
2495
- return shipping.get();
2496
- },
2497
- get joomla() {
2498
- return joomla.get();
2499
- },
2500
- get legacy() {
2501
- return legacy.get();
2502
- },
2503
- get customers() {
2504
- return customers.get();
2505
- },
2506
- get smartyStreets() {
2507
- return smartyStreets.get();
2508
- },
2509
- get p21Pim() {
2510
- return p21Pim.get();
2511
- },
2512
- get agrSite() {
2513
- return agrSite.get();
2514
- },
2515
- get avalara() {
2516
- return avalara.get();
2517
- },
2518
- get payments() {
2519
- return payments.get();
2520
- },
2521
- get ups() {
2522
- return ups.get();
2523
- },
2524
- get logistics() {
2525
- return logistics.get();
2526
- },
2527
- get nexus() {
2528
- return nexus.get();
2529
- },
2530
- get vmi() {
2531
- return vmi.get();
2532
- },
2533
- get p21Core() {
2534
- return p21Core.get();
2535
- },
2536
- get p21Apis() {
2537
- return p21Apis.get();
2538
- },
2539
- get p21Sism() {
2540
- return p21Sism.get();
2541
- },
2542
- get agrWork() {
2543
- return agrWork.get();
2544
- },
2545
- get agrInfo() {
2546
- return agrInfo.get();
2547
- },
2548
- get basecamp2() {
2549
- return basecamp2.get();
2550
- },
2551
- get brandFolder() {
2552
- return brandFolder.get();
2553
- },
2554
- get gregorovich() {
2555
- return gregorovich.get();
2556
- },
2557
- get slack() {
2558
- return slack.get();
2559
- }
2560
- };
2561
- }
2562
169
  export {
2563
170
  batchFetch,
2564
171
  cacheGet,