@simpleapps-com/augur-server 1.0.12 → 1.0.14

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.
@@ -0,0 +1,623 @@
1
+ "use server";
2
+
3
+ // src/server-site-registry.ts
4
+ var _actions;
5
+ function getSiteActions() {
6
+ if (!_actions) {
7
+ throw new Error(
8
+ "Server actions not initialized. Call createServerSite() before importing server actions."
9
+ );
10
+ }
11
+ return _actions;
12
+ }
13
+
14
+ // src/sdk-call.ts
15
+ async function safeAction(fn, onError) {
16
+ try {
17
+ const data = await fn();
18
+ return { ok: true, data: data ?? true };
19
+ } catch (e) {
20
+ const error = e instanceof Error ? e : new Error(String(e));
21
+ if (onError) onError(error);
22
+ return { ok: false, error: error.message };
23
+ }
24
+ }
25
+
26
+ // src/server-actions.ts
27
+ async function getCustomer(customerId) {
28
+ return safeAction(() => getSiteActions().customers.getCustomer(customerId));
29
+ }
30
+ async function customerLookup(params) {
31
+ return safeAction(() => getSiteActions().customers.customerLookup(params));
32
+ }
33
+ async function getCustomerDoc(customerId) {
34
+ return safeAction(() => getSiteActions().customers.getCustomerDoc(customerId));
35
+ }
36
+ async function getCustomerOrders(customerId, params) {
37
+ return safeAction(
38
+ () => getSiteActions().customers.getCustomerOrders(customerId, params)
39
+ );
40
+ }
41
+ async function getCustomerOrderDetail(customerId, orderId) {
42
+ return safeAction(
43
+ () => getSiteActions().customers.getCustomerOrderDetail(customerId, orderId)
44
+ );
45
+ }
46
+ async function getCustomerInvoices(customerId, params) {
47
+ return safeAction(
48
+ () => getSiteActions().customers.getCustomerInvoices(customerId, params)
49
+ );
50
+ }
51
+ async function getCustomerInvoiceDetail(customerId, invoiceNo) {
52
+ return safeAction(
53
+ () => getSiteActions().customers.getCustomerInvoiceDetail(customerId, invoiceNo)
54
+ );
55
+ }
56
+ async function getCustomerQuotes(customerId, params) {
57
+ return safeAction(
58
+ () => getSiteActions().customers.getCustomerQuotes(customerId, params)
59
+ );
60
+ }
61
+ async function getCustomerQuoteDetail(customerId, quoteNo) {
62
+ return safeAction(
63
+ () => getSiteActions().customers.getCustomerQuoteDetail(customerId, quoteNo)
64
+ );
65
+ }
66
+ async function getContacts(params) {
67
+ return safeAction(() => getSiteActions().customers.getContacts(params));
68
+ }
69
+ async function getShipToAddresses(customerId) {
70
+ return safeAction(
71
+ () => getSiteActions().customers.getShipToAddresses(customerId)
72
+ );
73
+ }
74
+ async function itemCategoryLookup(path) {
75
+ return safeAction(() => getSiteActions().items.itemCategoryLookup(path));
76
+ }
77
+ async function getItemCategory(uid, options) {
78
+ return safeAction(
79
+ () => getSiteActions().items.getItemCategory(uid, options)
80
+ );
81
+ }
82
+ async function getCategoryItems(uid, filters) {
83
+ return safeAction(
84
+ () => getSiteActions().items.getCategoryItems(uid, filters)
85
+ );
86
+ }
87
+ async function getItemAttributes(categoryUid) {
88
+ return safeAction(
89
+ () => getSiteActions().items.getItemAttributes(categoryUid)
90
+ );
91
+ }
92
+ async function getInvMast(uid) {
93
+ return safeAction(() => getSiteActions().items.getInvMast(uid));
94
+ }
95
+ async function getInvMastDoc(params) {
96
+ return safeAction(() => getSiteActions().items.getInvMastDoc(params));
97
+ }
98
+ async function getStock(invMastUid) {
99
+ return safeAction(() => getSiteActions().items.getStock(invMastUid));
100
+ }
101
+ async function getStockCompanySummary(invMastUid) {
102
+ return safeAction(
103
+ () => getSiteActions().items.getStockCompanySummary(invMastUid)
104
+ );
105
+ }
106
+ async function getItemFaqs(invMastUid) {
107
+ return safeAction(() => getSiteActions().items.getItemFaqs(invMastUid));
108
+ }
109
+ async function getItemSubstitutes(invMastUid) {
110
+ return safeAction(
111
+ () => getSiteActions().items.getItemSubstitutes(invMastUid)
112
+ );
113
+ }
114
+ async function getItemAccessories(invMastUid) {
115
+ return safeAction(
116
+ () => getSiteActions().items.getItemAccessories(invMastUid)
117
+ );
118
+ }
119
+ async function getSimilarItems(invMastUid) {
120
+ return safeAction(
121
+ () => getSiteActions().items.getSimilarItems(invMastUid)
122
+ );
123
+ }
124
+ async function batchGetInvMastDocs(params) {
125
+ return safeAction(() => getSiteActions().items.batchGetInvMastDocs(params));
126
+ }
127
+ async function batchGetStockData(invMastUids) {
128
+ return safeAction(
129
+ () => getSiteActions().items.batchGetStockData(invMastUids)
130
+ );
131
+ }
132
+ async function cartHdrLookup(params) {
133
+ return safeAction(() => getSiteActions().commerce.cartHdrLookup(params));
134
+ }
135
+ async function getCartLines(cartHdrUid) {
136
+ return safeAction(() => getSiteActions().commerce.getCartLines(cartHdrUid));
137
+ }
138
+ async function addToCart(cartHdrUid, items) {
139
+ return safeAction(
140
+ () => getSiteActions().commerce.addToCart(cartHdrUid, items)
141
+ );
142
+ }
143
+ async function updateCartLines(cartHdrUid, lines) {
144
+ return safeAction(
145
+ () => getSiteActions().commerce.updateCartLines(cartHdrUid, lines)
146
+ );
147
+ }
148
+ async function deleteCartItems(cartHdrUid) {
149
+ return safeAction(
150
+ () => getSiteActions().commerce.deleteCartItems(cartHdrUid)
151
+ );
152
+ }
153
+ async function getCartAlsoBought(cartHdrUid) {
154
+ return safeAction(
155
+ () => getSiteActions().commerce.getCartAlsoBought(cartHdrUid)
156
+ );
157
+ }
158
+ async function checkoutOrder(cartHdrUid, data) {
159
+ return safeAction(
160
+ () => getSiteActions().commerce.checkoutOrder(cartHdrUid, data)
161
+ );
162
+ }
163
+ async function getItemPrice(itemId, customerId, quantity) {
164
+ return safeAction(
165
+ () => getSiteActions().pricing.getItemPrice(itemId, customerId, quantity)
166
+ );
167
+ }
168
+ async function batchGetItemPrices(itemIds, customerId, quantity) {
169
+ return safeAction(
170
+ () => getSiteActions().pricing.batchGetItemPrices(itemIds, customerId, quantity)
171
+ );
172
+ }
173
+ async function getTaxEstimate(customerId, postalCode, items) {
174
+ return safeAction(
175
+ () => getSiteActions().pricing.getTaxEstimate(customerId, postalCode, items)
176
+ );
177
+ }
178
+ async function getSearchAttributes(q) {
179
+ return safeAction(() => getSiteActions().search.getSearchAttributes(q));
180
+ }
181
+ async function getSearchSuggestions(q, limit, offset) {
182
+ return safeAction(
183
+ () => getSiteActions().search.getSearchSuggestions(q, limit, offset)
184
+ );
185
+ }
186
+ async function itemSearch(filters, itemCategoryUid) {
187
+ return safeAction(
188
+ () => getSiteActions().search.itemSearch(filters, itemCategoryUid)
189
+ );
190
+ }
191
+ async function itemSearchInfinite(filters, itemCategoryUid, pageParam) {
192
+ return safeAction(
193
+ () => getSiteActions().search.itemSearchInfinite(
194
+ filters,
195
+ itemCategoryUid,
196
+ pageParam
197
+ )
198
+ );
199
+ }
200
+ async function getOrderDoc(orderNo, postalCode) {
201
+ return safeAction(
202
+ () => getSiteActions().orders.getOrderDoc(orderNo, postalCode)
203
+ );
204
+ }
205
+ async function getShippingRates(toAddress, weight, serviceCodes) {
206
+ return safeAction(
207
+ () => getSiteActions().shipping.getShippingRates(
208
+ toAddress,
209
+ weight,
210
+ serviceCodes
211
+ )
212
+ );
213
+ }
214
+ async function getJoomlaContent(articleId) {
215
+ return safeAction(
216
+ () => getSiteActions().joomla.getJoomlaContent(articleId)
217
+ );
218
+ }
219
+ async function getJoomlaContentList(params) {
220
+ return safeAction(
221
+ () => getSiteActions().joomla.getJoomlaContentList(params)
222
+ );
223
+ }
224
+ async function getJoomlaMenu(params) {
225
+ return safeAction(() => getSiteActions().joomla.getJoomlaMenu(params));
226
+ }
227
+ async function getJoomlaMenuDoc(menuId) {
228
+ return safeAction(() => getSiteActions().joomla.getJoomlaMenuDoc(menuId));
229
+ }
230
+ async function getUserProfile(userId) {
231
+ return safeAction(() => getSiteActions().joomla.getUserProfile(userId));
232
+ }
233
+ async function getItemWebDesc(invMastUid) {
234
+ return safeAction(() => getSiteActions().legacy.getItemWebDesc(invMastUid));
235
+ }
236
+ async function getAlsoBoughtItems(invMastUid) {
237
+ return safeAction(
238
+ () => getSiteActions().legacy.getAlsoBoughtItems(invMastUid)
239
+ );
240
+ }
241
+ async function getItemTags(invMastUid) {
242
+ return safeAction(() => getSiteActions().legacy.getItemTags(invMastUid));
243
+ }
244
+ async function getStates(params) {
245
+ return safeAction(() => getSiteActions().legacy.getStates(params));
246
+ }
247
+ async function validateAddress(params) {
248
+ return safeAction(
249
+ () => getSiteActions().smartyStreets.validateAddress(params)
250
+ );
251
+ }
252
+ async function getInvMastExt(invMastUid) {
253
+ return safeAction(() => getSiteActions().p21Pim.getInvMastExt(invMastUid));
254
+ }
255
+ async function listInvMastExt(params) {
256
+ return safeAction(() => getSiteActions().p21Pim.listInvMastExt(params));
257
+ }
258
+ async function getSettings(serviceName) {
259
+ return safeAction(() => getSiteActions().agrSite.getSettings(serviceName));
260
+ }
261
+ async function getMetaFiles(params) {
262
+ return safeAction(() => getSiteActions().agrSite.getMetaFiles(params));
263
+ }
264
+ async function calculateTax(data) {
265
+ return safeAction(() => getSiteActions().avalara.calculateTax(data));
266
+ }
267
+ async function transactionSetup(params) {
268
+ return safeAction(
269
+ () => getSiteActions().payments.transactionSetup(params)
270
+ );
271
+ }
272
+ async function accountQuery(params) {
273
+ return safeAction(() => getSiteActions().payments.accountQuery(params));
274
+ }
275
+ async function getSurcharge(params) {
276
+ return safeAction(() => getSiteActions().payments.getSurcharge(params));
277
+ }
278
+ async function cardInfo(params) {
279
+ return safeAction(() => getSiteActions().payments.cardInfo(params));
280
+ }
281
+ async function billingUpdate(params) {
282
+ return safeAction(() => getSiteActions().payments.billingUpdate(params));
283
+ }
284
+ async function validatePayment(params) {
285
+ return safeAction(() => getSiteActions().payments.validatePayment(params));
286
+ }
287
+ async function getRates(params) {
288
+ return safeAction(() => getSiteActions().ups.getRates(params));
289
+ }
290
+ async function getFreightRates(params) {
291
+ return safeAction(() => getSiteActions().logistics.getFreightRates(params));
292
+ }
293
+ async function getShipVia(params) {
294
+ return safeAction(() => getSiteActions().logistics.getShipVia(params));
295
+ }
296
+ async function createBinTransfer(data) {
297
+ return safeAction(() => getSiteActions().nexus.createBinTransfer(data));
298
+ }
299
+ async function createReceiving(data) {
300
+ return safeAction(() => getSiteActions().nexus.createReceiving(data));
301
+ }
302
+ async function createTransfer(data) {
303
+ return safeAction(() => getSiteActions().nexus.createTransfer(data));
304
+ }
305
+ async function getPurchaseOrderReceipts(params) {
306
+ return safeAction(
307
+ () => getSiteActions().nexus.getPurchaseOrderReceipts(params)
308
+ );
309
+ }
310
+ async function getTransferReceipts(params) {
311
+ return safeAction(
312
+ () => getSiteActions().nexus.getTransferReceipts(params)
313
+ );
314
+ }
315
+ async function getTransferShipping(params) {
316
+ return safeAction(
317
+ () => getSiteActions().nexus.getTransferShipping(params)
318
+ );
319
+ }
320
+ async function getWarehouses(params) {
321
+ return safeAction(() => getSiteActions().vmi.getWarehouses(params));
322
+ }
323
+ async function getWarehouseAvailability(warehouseUid, params) {
324
+ return safeAction(
325
+ () => getSiteActions().vmi.getWarehouseAvailability(warehouseUid, params)
326
+ );
327
+ }
328
+ async function getDistributors(params) {
329
+ return safeAction(() => getSiteActions().vmi.getDistributors(params));
330
+ }
331
+ async function getProducts(params) {
332
+ return safeAction(() => getSiteActions().vmi.getProducts(params));
333
+ }
334
+ async function getInventoryProfiles(params) {
335
+ return safeAction(() => getSiteActions().vmi.getInventoryProfiles(params));
336
+ }
337
+ async function getRestockHeaders(params) {
338
+ return safeAction(() => getSiteActions().vmi.getRestockHeaders(params));
339
+ }
340
+ async function getSections(params) {
341
+ return safeAction(() => getSiteActions().vmi.getSections(params));
342
+ }
343
+ async function getAddresses(params) {
344
+ return safeAction(() => getSiteActions().p21Core.getAddresses(params));
345
+ }
346
+ async function getCompanies(params) {
347
+ return safeAction(() => getSiteActions().p21Core.getCompanies(params));
348
+ }
349
+ async function getCompany(companyId) {
350
+ return safeAction(() => getSiteActions().p21Core.getCompany(companyId));
351
+ }
352
+ async function getLocations(params) {
353
+ return safeAction(() => getSiteActions().p21Core.getLocations(params));
354
+ }
355
+ async function getPaymentTypes(params) {
356
+ return safeAction(() => getSiteActions().p21Core.getPaymentTypes(params));
357
+ }
358
+ async function getCashDrawers(params) {
359
+ return safeAction(() => getSiteActions().p21Core.getCashDrawers(params));
360
+ }
361
+ async function getCodeP21(params) {
362
+ return safeAction(() => getSiteActions().p21Core.getCodeP21(params));
363
+ }
364
+ async function getP21Categories(params) {
365
+ return safeAction(() => getSiteActions().p21Apis.getCategories(params));
366
+ }
367
+ async function getCategoryDefaults(categoryId) {
368
+ return safeAction(
369
+ () => getSiteActions().p21Apis.getCategoryDefaults(categoryId)
370
+ );
371
+ }
372
+ async function getP21Companies(params) {
373
+ return safeAction(() => getSiteActions().p21Apis.getCompanies(params));
374
+ }
375
+ async function getUsers(params) {
376
+ return safeAction(() => getSiteActions().p21Apis.getUsers(params));
377
+ }
378
+ async function getWebDisplayTypes(params) {
379
+ return safeAction(
380
+ () => getSiteActions().p21Apis.getWebDisplayTypes(params)
381
+ );
382
+ }
383
+ async function getWebDisplayTypeDefaults(id) {
384
+ return safeAction(
385
+ () => getSiteActions().p21Apis.getWebDisplayTypeDefaults(id)
386
+ );
387
+ }
388
+ async function refreshContacts(params) {
389
+ return safeAction(() => getSiteActions().p21Apis.refreshContacts(params));
390
+ }
391
+ async function refreshCustomers(params) {
392
+ return safeAction(
393
+ () => getSiteActions().p21Apis.refreshCustomers(params)
394
+ );
395
+ }
396
+ async function getRecentImports(params) {
397
+ return safeAction(() => getSiteActions().p21Sism.getRecentImports(params));
398
+ }
399
+ async function getImport(importId) {
400
+ return safeAction(() => getSiteActions().p21Sism.getImport(importId));
401
+ }
402
+ async function getImportLines(importId, params) {
403
+ return safeAction(
404
+ () => getSiteActions().p21Sism.getImportLines(importId, params)
405
+ );
406
+ }
407
+ async function getScheduledImports(params) {
408
+ return safeAction(
409
+ () => getSiteActions().p21Sism.getScheduledImports(params)
410
+ );
411
+ }
412
+ async function healthCheck() {
413
+ return safeAction(() => getSiteActions().agrWork.healthCheck());
414
+ }
415
+ async function ping() {
416
+ return safeAction(() => getSiteActions().agrWork.ping());
417
+ }
418
+ async function getContext(params) {
419
+ return safeAction(() => getSiteActions().agrInfo.getContext(params));
420
+ }
421
+ async function getRubrics(params) {
422
+ return safeAction(() => getSiteActions().agrInfo.getRubrics(params));
423
+ }
424
+ async function getMicroservices(params) {
425
+ return safeAction(() => getSiteActions().agrInfo.getMicroservices(params));
426
+ }
427
+ async function generateAkasha(data) {
428
+ return safeAction(() => getSiteActions().agrInfo.generateAkasha(data));
429
+ }
430
+ async function generateJoomla(data) {
431
+ return safeAction(() => getSiteActions().agrInfo.generateJoomla(data));
432
+ }
433
+ async function getTodos(params) {
434
+ return safeAction(() => getSiteActions().basecamp2.getTodos(params));
435
+ }
436
+ async function getTodo(todoId) {
437
+ return safeAction(() => getSiteActions().basecamp2.getTodo(todoId));
438
+ }
439
+ async function getTodosSummary(params) {
440
+ return safeAction(
441
+ () => getSiteActions().basecamp2.getTodosSummary(params)
442
+ );
443
+ }
444
+ async function getComments(params) {
445
+ return safeAction(() => getSiteActions().basecamp2.getComments(params));
446
+ }
447
+ async function getPeople(params) {
448
+ return safeAction(() => getSiteActions().basecamp2.getPeople(params));
449
+ }
450
+ async function getProjects(params) {
451
+ return safeAction(() => getSiteActions().basecamp2.getProjects(params));
452
+ }
453
+ async function getEvents(params) {
454
+ return safeAction(() => getSiteActions().basecamp2.getEvents(params));
455
+ }
456
+ async function getMetrics(params) {
457
+ return safeAction(() => getSiteActions().basecamp2.getMetrics(params));
458
+ }
459
+ async function getTodolists(params) {
460
+ return safeAction(() => getSiteActions().basecamp2.getTodolists(params));
461
+ }
462
+ async function getBrandFolderCategories(params) {
463
+ return safeAction(
464
+ () => getSiteActions().brandFolder.getCategories(params)
465
+ );
466
+ }
467
+ async function getCategory(categoryId) {
468
+ return safeAction(
469
+ () => getSiteActions().brandFolder.getCategory(categoryId)
470
+ );
471
+ }
472
+ async function createFocus(categoryId, data) {
473
+ return safeAction(
474
+ () => getSiteActions().brandFolder.createFocus(categoryId, data)
475
+ );
476
+ }
477
+ async function askChatGpt(params) {
478
+ return safeAction(() => getSiteActions().gregorovich.askChatGpt(params));
479
+ }
480
+ async function getDocuments(params) {
481
+ return safeAction(() => getSiteActions().gregorovich.getDocuments(params));
482
+ }
483
+ async function createDocument(data) {
484
+ return safeAction(
485
+ () => getSiteActions().gregorovich.createDocument(data)
486
+ );
487
+ }
488
+ async function generateOllama(data) {
489
+ return safeAction(
490
+ () => getSiteActions().gregorovich.generateOllama(data)
491
+ );
492
+ }
493
+ async function sendWebhook(data) {
494
+ return safeAction(() => getSiteActions().slack.sendWebhook(data));
495
+ }
496
+ async function getWebhooks(params) {
497
+ return safeAction(() => getSiteActions().slack.getWebhooks(params));
498
+ }
499
+ export {
500
+ accountQuery,
501
+ addToCart,
502
+ askChatGpt,
503
+ batchGetInvMastDocs,
504
+ batchGetItemPrices,
505
+ batchGetStockData,
506
+ billingUpdate,
507
+ calculateTax,
508
+ cardInfo,
509
+ cartHdrLookup,
510
+ checkoutOrder,
511
+ createBinTransfer,
512
+ createDocument,
513
+ createFocus,
514
+ createReceiving,
515
+ createTransfer,
516
+ customerLookup,
517
+ deleteCartItems,
518
+ generateAkasha,
519
+ generateJoomla,
520
+ generateOllama,
521
+ getAddresses,
522
+ getAlsoBoughtItems,
523
+ getBrandFolderCategories,
524
+ getCartAlsoBought,
525
+ getCartLines,
526
+ getCashDrawers,
527
+ getCategory,
528
+ getCategoryDefaults,
529
+ getCategoryItems,
530
+ getCodeP21,
531
+ getComments,
532
+ getCompanies,
533
+ getCompany,
534
+ getContacts,
535
+ getContext,
536
+ getCustomer,
537
+ getCustomerDoc,
538
+ getCustomerInvoiceDetail,
539
+ getCustomerInvoices,
540
+ getCustomerOrderDetail,
541
+ getCustomerOrders,
542
+ getCustomerQuoteDetail,
543
+ getCustomerQuotes,
544
+ getDistributors,
545
+ getDocuments,
546
+ getEvents,
547
+ getFreightRates,
548
+ getImport,
549
+ getImportLines,
550
+ getInvMast,
551
+ getInvMastDoc,
552
+ getInvMastExt,
553
+ getInventoryProfiles,
554
+ getItemAccessories,
555
+ getItemAttributes,
556
+ getItemCategory,
557
+ getItemFaqs,
558
+ getItemPrice,
559
+ getItemSubstitutes,
560
+ getItemTags,
561
+ getItemWebDesc,
562
+ getJoomlaContent,
563
+ getJoomlaContentList,
564
+ getJoomlaMenu,
565
+ getJoomlaMenuDoc,
566
+ getLocations,
567
+ getMetaFiles,
568
+ getMetrics,
569
+ getMicroservices,
570
+ getOrderDoc,
571
+ getP21Categories,
572
+ getP21Companies,
573
+ getPaymentTypes,
574
+ getPeople,
575
+ getProducts,
576
+ getProjects,
577
+ getPurchaseOrderReceipts,
578
+ getRates,
579
+ getRecentImports,
580
+ getRestockHeaders,
581
+ getRubrics,
582
+ getScheduledImports,
583
+ getSearchAttributes,
584
+ getSearchSuggestions,
585
+ getSections,
586
+ getSettings,
587
+ getShipToAddresses,
588
+ getShipVia,
589
+ getShippingRates,
590
+ getSimilarItems,
591
+ getStates,
592
+ getStock,
593
+ getStockCompanySummary,
594
+ getSurcharge,
595
+ getTaxEstimate,
596
+ getTodo,
597
+ getTodolists,
598
+ getTodos,
599
+ getTodosSummary,
600
+ getTransferReceipts,
601
+ getTransferShipping,
602
+ getUserProfile,
603
+ getUsers,
604
+ getWarehouseAvailability,
605
+ getWarehouses,
606
+ getWebDisplayTypeDefaults,
607
+ getWebDisplayTypes,
608
+ getWebhooks,
609
+ healthCheck,
610
+ itemCategoryLookup,
611
+ itemSearch,
612
+ itemSearchInfinite,
613
+ listInvMastExt,
614
+ ping,
615
+ refreshContacts,
616
+ refreshCustomers,
617
+ sendWebhook,
618
+ transactionSetup,
619
+ updateCartLines,
620
+ validateAddress,
621
+ validatePayment
622
+ };
623
+ //# sourceMappingURL=actions.js.map