@simpleapps-com/augur-server 2.1.0 → 2.1.1

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.
@@ -1,1032 +0,0 @@
1
- import { EdgeCacheValue, ListResult } from '@simpleapps-com/augur-core';
2
- import { AugurAPI } from '@simpleapps-com/augur-api';
3
- import { TPriceData, TTaxItem, TTax, TCartLookUp, TCartLine, TRelatedProduct, TCheckoutResult, TWebDesc, CustomerDocument, TTransactionSetup, TAccountQuery, TSurcharge, TCardInfo, TBillingUpdate, TPaymentValidation, TShippingMethod } from '@simpleapps-com/augur-utils';
4
- import { I as ItemActions, S as SearchActions, h as ShippingActions, J as JoomlaActions, l as SmartyStreetsActions, j as ShippingAddress } from './smarty-streets-xhe-ldMO.js';
5
-
6
- /** Derived from augur-api SDK — keeps types in sync automatically. */
7
- type PricingApiClient = Pick<AugurAPI, "pricing">;
8
- interface PricingActionsConfig {
9
- /** Default customer ID when none is provided by the caller. */
10
- defaultCustomerId?: string | number;
11
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
12
- cachePrefix?: string;
13
- /** CDN edge cache value passed to SDK. Default: 2 (hours). */
14
- edgeCache?: EdgeCacheValue;
15
- /** Redis TTL for price lookups in seconds. Default: 3600 (1 hour). */
16
- redisTtl?: number;
17
- /** Redis TTL for tax lookups in seconds. Default: 1800 (30 min). */
18
- taxRedisTtl?: number;
19
- }
20
- interface PricingActions {
21
- getItemPrice: (itemId: string, customerId?: string | number, quantity?: number) => Promise<TPriceData>;
22
- batchGetItemPrices: (itemIds: string[], customerId?: string | number, quantity?: number) => Promise<Record<string, TPriceData>>;
23
- getTaxEstimate: (customerId?: string | number, postalCode?: string, items?: TTaxItem[]) => Promise<TTax>;
24
- }
25
- /**
26
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
27
- *
28
- * Creates server-side pricing actions with Redis caching and edge cache support.
29
- *
30
- * Uses `withServerCache` which produces cache keys compatible with augur-hooks'
31
- * `withCache`, so server-prefetched data is shared with client-side hooks.
32
- *
33
- * @example
34
- * ```ts
35
- * // lib/pricing-actions.ts
36
- * import { createPricingActions } from "@simpleapps-com/augur-server";
37
- * import { getAugurClient } from "./augur-client";
38
- *
39
- * export const pricingActions = createPricingActions(getAugurClient(), {
40
- * // defaultCustomerId falls back to DEFAULT_CUSTOMER_ID env var automatically
41
- * cachePrefix: "ampro:",
42
- * });
43
- *
44
- * // In a server component:
45
- * const price = await pricingActions.getItemPrice("ITEM-1");
46
- * const prices = await pricingActions.batchGetItemPrices(["ITEM-1", "ITEM-2"]);
47
- * ```
48
- */
49
- declare function createPricingActions(api: PricingApiClient, config?: PricingActionsConfig): PricingActions;
50
-
51
- /** Derived from augur-api SDK — keeps types in sync automatically. */
52
- type CommerceApiClient = Pick<AugurAPI, "commerce">;
53
- interface CommerceActionsConfig {
54
- defaultContactId?: string | number;
55
- defaultCustomerId?: string | number;
56
- /** Optional UOM conversion function. E.g. (uom) => uom === "EA" ? "EACH" : uom */
57
- convertUnitOfMeasure?: (uom: string) => string;
58
- }
59
- interface CommerceActions {
60
- cartHdrLookup: (params: {
61
- userId?: string | number;
62
- cartToken?: string;
63
- contactId?: string | number;
64
- customerId?: string | number;
65
- }) => Promise<TCartLookUp>;
66
- getCartLines: (cartHdrUid: number) => Promise<ListResult<TCartLine>>;
67
- addToCart: (cartHdrUid: number, items: {
68
- itemId?: string;
69
- invMastUid?: number;
70
- quantity: number;
71
- unitOfMeasure: string;
72
- }[]) => Promise<unknown>;
73
- updateCartLines: (cartHdrUid: number, lines: {
74
- lineNo: number;
75
- quantity: number;
76
- unitOfMeasure: string;
77
- }[]) => Promise<unknown>;
78
- deleteCartItems: (cartHdrUid: number) => Promise<void>;
79
- getCartAlsoBought: (cartHdrUid: number) => Promise<ListResult<TRelatedProduct>>;
80
- checkoutOrder: (cartHdrUid: number, data: Record<string, unknown>) => Promise<TCheckoutResult | undefined>;
81
- }
82
- /**
83
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
84
- *
85
- * Creates server-side commerce actions for cart operations.
86
- *
87
- * Unlike pricing actions, commerce actions do NOT use caching because
88
- * cart operations are real-time and must always reflect current state.
89
- *
90
- * @example
91
- * ```ts
92
- * // lib/commerce-actions.ts
93
- * import { createCommerceActions } from "@simpleapps-com/augur-server";
94
- * import { getAugurClient } from "./augur-client";
95
- *
96
- * export const commerceActions = createCommerceActions(getAugurClient(), {
97
- * // defaultContactId/defaultCustomerId fall back to env vars automatically
98
- * convertUnitOfMeasure: (uom) => uom === "EA" ? "EACH" : uom,
99
- * });
100
- *
101
- * // In a server action:
102
- * const cart = await commerceActions.cartHdrLookup({ userId: 123 });
103
- * const lines = await commerceActions.getCartLines(cart.cartHdrUid);
104
- * ```
105
- */
106
- declare function createCommerceActions(api: CommerceApiClient, config?: CommerceActionsConfig): CommerceActions;
107
-
108
- /** Derived from augur-api SDK — keeps types in sync automatically. */
109
- type OrderApiClient = Pick<AugurAPI, "orders">;
110
- interface OrderActionsConfig {
111
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
112
- cachePrefix?: string;
113
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
114
- edgeCache?: EdgeCacheValue;
115
- /** Redis TTL for order doc lookups in seconds. Default: 3600 (1 hour). */
116
- redisTtl?: number;
117
- }
118
- interface OrderActions {
119
- getOrderDoc: (orderNo: string, postalCode: string) => Promise<unknown>;
120
- }
121
- /**
122
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
123
- *
124
- * Creates server-side order actions with Redis caching and edge cache support.
125
- *
126
- * Uses `withServerCache` which produces cache keys compatible with augur-hooks'
127
- * `withCache`, so server-prefetched data is shared with client-side hooks.
128
- *
129
- * @example
130
- * ```ts
131
- * // lib/order-actions.ts
132
- * import { createOrderActions } from "@simpleapps-com/augur-server";
133
- * import { getAugurClient } from "./augur-client";
134
- *
135
- * export const orderActions = createOrderActions(getAugurClient(), {
136
- * cachePrefix: "ampro:",
137
- * });
138
- *
139
- * // In a server component:
140
- * const doc = await orderActions.getOrderDoc("12345", "90210");
141
- * ```
142
- */
143
- declare function createOrderActions(api: OrderApiClient, config?: OrderActionsConfig): OrderActions;
144
-
145
- /** Derived from augur-api SDK — keeps types in sync automatically. */
146
- type LegacyApiClient = Pick<AugurAPI, "legacy">;
147
- interface LegacyActionsConfig {
148
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
149
- cachePrefix?: string;
150
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
151
- edgeCache?: EdgeCacheValue;
152
- /** CDN edge cache for rarely-changing data like states. Default: 8 (hours). */
153
- longEdgeCache?: EdgeCacheValue;
154
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
155
- redisTtl?: number;
156
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
157
- longRedisTtl?: number;
158
- }
159
- interface LegacyActions {
160
- getItemWebDesc: (invMastUid: number) => Promise<TWebDesc | undefined>;
161
- getAlsoBoughtItems: (invMastUid: number) => Promise<ListResult<TRelatedProduct>>;
162
- getItemTags: (invMastUid: number) => Promise<ListResult>;
163
- getStates: (params?: {
164
- twoLetterCode?: string;
165
- }) => Promise<ListResult>;
166
- }
167
- /**
168
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
169
- *
170
- * Creates server-side legacy actions with Redis caching and edge cache support.
171
- *
172
- * Covers the legacy microservice endpoints used by ecommerce sites:
173
- * webDesc, alsoBought, tags, and states.
174
- *
175
- * @example
176
- * ```ts
177
- * import { createLegacyActions } from "@simpleapps-com/augur-server";
178
- * import { getAugurClient } from "./augur-client";
179
- *
180
- * export const legacyActions = createLegacyActions(getAugurClient(), {
181
- * cachePrefix: "ampro:",
182
- * });
183
- *
184
- * const webDesc = await legacyActions.getItemWebDesc(12345);
185
- * const states = await legacyActions.getStates();
186
- * ```
187
- */
188
- declare function createLegacyActions(api: LegacyApiClient, config?: LegacyActionsConfig): LegacyActions;
189
-
190
- /** @deprecated Use `ListResult` from `../sdk-call` instead. */
191
- type CustomerListResult = ListResult;
192
- /** Derived from augur-api SDK — keeps types in sync automatically. */
193
- type CustomersApiClient = Pick<AugurAPI, "customers">;
194
- interface CustomersActionsConfig {
195
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
196
- cachePrefix?: string;
197
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
198
- edgeCache?: EdgeCacheValue;
199
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
200
- redisTtl?: number;
201
- }
202
- interface CustomersActions {
203
- getCustomer: (customerId: number) => Promise<CustomerDocument>;
204
- customerLookup: (params: Record<string, unknown>) => Promise<ListResult<CustomerDocument>>;
205
- getCustomerDoc: (customerId: number) => Promise<CustomerDocument>;
206
- getCustomerOrders: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
207
- getCustomerOrderDetail: (customerId: number, orderId: number) => Promise<unknown>;
208
- getCustomerInvoices: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
209
- getCustomerInvoiceDetail: (customerId: number, invoiceNo: number) => Promise<unknown>;
210
- getCustomerQuotes: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
211
- getCustomerQuoteDetail: (customerId: number, quoteNo: number) => Promise<unknown>;
212
- getContacts: (params?: Record<string, unknown>) => Promise<ListResult>;
213
- getShipToAddresses: (customerId: number) => Promise<ListResult>;
214
- }
215
- /**
216
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
217
- *
218
- * Creates server-side customer actions with Redis caching and edge cache support.
219
- *
220
- * Covers the customers microservice endpoints used by ecommerce sites:
221
- * customer get, lookup, doc, orders, contacts, and ship-to addresses.
222
- *
223
- * @example
224
- * ```ts
225
- * import { createCustomersActions } from "@simpleapps-com/augur-server";
226
- * import { getAugurClient } from "./augur-client";
227
- *
228
- * export const customersActions = createCustomersActions(getAugurClient(), {
229
- * cachePrefix: "ampro:",
230
- * });
231
- *
232
- * const customer = await customersActions.getCustomer(123);
233
- * const orders = await customersActions.getCustomerOrders(123);
234
- * ```
235
- */
236
- declare function createCustomersActions(api: CustomersApiClient, config?: CustomersActionsConfig): CustomersActions;
237
-
238
- /** Derived from augur-api SDK — keeps types in sync automatically. */
239
- type P21PimApiClient = Pick<AugurAPI, "p21Pim">;
240
- interface P21PimActionsConfig {
241
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
242
- cachePrefix?: string;
243
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
244
- edgeCache?: EdgeCacheValue;
245
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
246
- redisTtl?: number;
247
- }
248
- interface P21PimActions {
249
- getInvMastExt: (invMastUid: number) => Promise<unknown>;
250
- listInvMastExt: (params?: Record<string, unknown>) => Promise<ListResult>;
251
- }
252
- /**
253
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
254
- *
255
- * Creates server-side P21 PIM actions with Redis caching and edge cache support.
256
- *
257
- * Covers the P21 PIM microservice endpoints for extended inventory data
258
- * including UPC/EAN codes, brand information, and SEO metadata.
259
- *
260
- * @example
261
- * ```ts
262
- * import { createP21PimActions } from "@simpleapps-com/augur-server";
263
- * import { getAugurClient } from "./augur-client";
264
- *
265
- * export const p21PimActions = createP21PimActions(getAugurClient(), {
266
- * cachePrefix: "ampro:",
267
- * });
268
- *
269
- * const ext = await p21PimActions.getInvMastExt(12345);
270
- * const list = await p21PimActions.listInvMastExt({ limit: 20 });
271
- * ```
272
- */
273
- declare function createP21PimActions(api: P21PimApiClient, config?: P21PimActionsConfig): P21PimActions;
274
-
275
- /** Derived from augur-api SDK — keeps types in sync automatically. */
276
- type AgrSiteApiClient = Pick<AugurAPI, "agrSite">;
277
- interface AgrSiteActionsConfig {
278
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
279
- cachePrefix?: string;
280
- /** CDN edge cache value for rarely-changing data. Default: 8 (hours). */
281
- longEdgeCache?: EdgeCacheValue;
282
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
283
- longRedisTtl?: number;
284
- }
285
- interface AgrSiteActions {
286
- getSettings: (serviceName?: string) => Promise<ListResult>;
287
- getMetaFiles: (params?: Record<string, unknown>) => Promise<ListResult>;
288
- }
289
- /**
290
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
291
- *
292
- * Creates server-side AGR Site actions with Redis caching and edge cache support.
293
- *
294
- * Covers the AGR Site microservice endpoints for site configuration settings
295
- * and meta file management (robots.txt, etc.). Both endpoints use long TTLs
296
- * since site settings and meta files rarely change.
297
- *
298
- * @example
299
- * ```ts
300
- * import { createAgrSiteActions } from "@simpleapps-com/augur-server";
301
- * import { getAugurClient } from "./augur-client";
302
- *
303
- * export const agrSiteActions = createAgrSiteActions(getAugurClient(), {
304
- * cachePrefix: "ampro:",
305
- * });
306
- *
307
- * const settings = await agrSiteActions.getSettings("my-service");
308
- * const metaFiles = await agrSiteActions.getMetaFiles();
309
- * ```
310
- */
311
- declare function createAgrSiteActions(api: AgrSiteApiClient, config?: AgrSiteActionsConfig): AgrSiteActions;
312
-
313
- /** Derived from augur-api SDK — keeps types in sync automatically. */
314
- type AvalaraApiClient = Pick<AugurAPI, "avalara">;
315
- interface AvalaraActionsConfig {
316
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
317
- cachePrefix?: string;
318
- }
319
- interface AvalaraActions {
320
- calculateTax: (data: Record<string, unknown>) => Promise<unknown>;
321
- }
322
- /**
323
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
324
- *
325
- * Creates server-side Avalara actions for real-time tax calculation.
326
- *
327
- * Note: Tax calculation is a real-time operation and does NOT use caching.
328
- * Each call hits the Avalara API directly to ensure up-to-date tax rates.
329
- *
330
- * @example
331
- * ```ts
332
- * import { createAvalaraActions } from "@simpleapps-com/augur-server";
333
- * import { getAugurClient } from "./augur-client";
334
- *
335
- * export const avalaraActions = createAvalaraActions(getAugurClient());
336
- *
337
- * const taxResult = await avalaraActions.calculateTax({
338
- * lines: [{ amount: 100.00, description: "Widget" }],
339
- * addresses: {
340
- * shipTo: {
341
- * line1: "123 Main St",
342
- * city: "Irvine",
343
- * region: "CA",
344
- * country: "US",
345
- * postalCode: "92602",
346
- * },
347
- * },
348
- * type: "SalesOrder",
349
- * });
350
- * ```
351
- */
352
- declare function createAvalaraActions(api: AvalaraApiClient, config?: AvalaraActionsConfig): AvalaraActions;
353
-
354
- /** Derived from augur-api SDK — keeps types in sync automatically. */
355
- type PaymentsApiClient = Pick<AugurAPI, "payments">;
356
- interface PaymentsActionsConfig {
357
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
358
- cachePrefix?: string;
359
- /** Payment environment mode. Default: "live". */
360
- mode?: string;
361
- }
362
- interface PaymentsActions {
363
- transactionSetup: (params: Record<string, unknown>) => Promise<TTransactionSetup | undefined>;
364
- accountQuery: (params: Record<string, unknown>) => Promise<TAccountQuery | undefined>;
365
- getSurcharge: (params: Record<string, unknown>) => Promise<TSurcharge | undefined>;
366
- cardInfo: (params: Record<string, unknown>) => Promise<TCardInfo | undefined>;
367
- billingUpdate: (params: Record<string, unknown>) => Promise<TBillingUpdate | undefined>;
368
- validatePayment: (params: Record<string, unknown>) => Promise<TPaymentValidation | undefined>;
369
- }
370
- /**
371
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
372
- *
373
- * Creates server-side payment actions.
374
- *
375
- * Payment actions do NOT use caching because every call deals with
376
- * real-time payment processing that must always reflect current state.
377
- *
378
- * @example
379
- * ```ts
380
- * import { createPaymentsActions } from "@simpleapps-com/augur-server";
381
- * import { getAugurClient } from "./augur-client";
382
- *
383
- * export const paymentsActions = createPaymentsActions(getAugurClient());
384
- *
385
- * const setup = await paymentsActions.transactionSetup({ customerId: "123" });
386
- * const account = await paymentsActions.accountQuery({ transactionSetupId: "abc" });
387
- * const surcharge = await paymentsActions.getSurcharge({ amount: 100 });
388
- * ```
389
- */
390
- declare function createPaymentsActions(api: PaymentsApiClient, config?: PaymentsActionsConfig): PaymentsActions;
391
-
392
- /** Derived from augur-api SDK — keeps types in sync automatically. */
393
- type UpsApiClient = Pick<AugurAPI, "ups">;
394
- interface UpsActionsConfig {
395
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
396
- cachePrefix?: string;
397
- }
398
- interface UpsActions {
399
- getRates: (params: Record<string, unknown>) => Promise<ListResult<TShippingMethod>>;
400
- }
401
- /**
402
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
403
- *
404
- * Creates server-side UPS shipping actions.
405
- *
406
- * UPS rate actions do NOT use caching because rate quotes are real-time
407
- * and must always reflect current carrier pricing.
408
- *
409
- * @example
410
- * ```ts
411
- * import { createUpsActions } from "@simpleapps-com/augur-server";
412
- * import { getAugurClient } from "./augur-client";
413
- *
414
- * export const upsActions = createUpsActions(getAugurClient());
415
- *
416
- * const rates = await upsActions.getRates({
417
- * fromPostalCode: "90210",
418
- * toPostalCode: "10001",
419
- * weight: 5,
420
- * });
421
- * ```
422
- */
423
- declare function createUpsActions(api: UpsApiClient, config?: UpsActionsConfig): UpsActions;
424
-
425
- /** Derived from augur-api SDK — keeps types in sync automatically. */
426
- type LogisticsApiClient = Pick<AugurAPI, "logistics">;
427
- interface LogisticsActionsConfig {
428
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
429
- cachePrefix?: string;
430
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
431
- edgeCache?: EdgeCacheValue;
432
- /** CDN edge cache for rarely-changing data like ship-via options. Default: 8 (hours). */
433
- longEdgeCache?: EdgeCacheValue;
434
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
435
- redisTtl?: number;
436
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
437
- longRedisTtl?: number;
438
- }
439
- interface LogisticsActions {
440
- getFreightRates: (params: Record<string, unknown>) => Promise<ListResult>;
441
- getShipVia: (params?: Record<string, unknown>) => Promise<ListResult>;
442
- }
443
- /**
444
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
445
- *
446
- * Creates server-side logistics actions with selective Redis caching.
447
- *
448
- * Freight rate lookups are real-time and NOT cached.
449
- * Ship-via carrier options rarely change and ARE cached with long TTL.
450
- *
451
- * @example
452
- * ```ts
453
- * import { createLogisticsActions } from "@simpleapps-com/augur-server";
454
- * import { getAugurClient } from "./augur-client";
455
- *
456
- * export const logisticsActions = createLogisticsActions(getAugurClient(), {
457
- * cachePrefix: "ampro:",
458
- * });
459
- *
460
- * const rates = await logisticsActions.getFreightRates({ fromPostalCode: "90210" });
461
- * const carriers = await logisticsActions.getShipVia();
462
- * ```
463
- */
464
- declare function createLogisticsActions(api: LogisticsApiClient, config?: LogisticsActionsConfig): LogisticsActions;
465
-
466
- /** Derived from augur-api SDK — keeps types in sync automatically. */
467
- type NexusApiClient = Pick<AugurAPI, "nexus">;
468
- interface NexusActionsConfig {
469
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
470
- cachePrefix?: string;
471
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
472
- edgeCache?: EdgeCacheValue;
473
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
474
- redisTtl?: number;
475
- }
476
- interface NexusActions {
477
- createBinTransfer: (data: Record<string, unknown>) => Promise<unknown>;
478
- createReceiving: (data: Record<string, unknown>) => Promise<unknown>;
479
- createTransfer: (data: Record<string, unknown>) => Promise<unknown>;
480
- getPurchaseOrderReceipts: (params?: Record<string, unknown>) => Promise<ListResult>;
481
- getTransferReceipts: (params?: Record<string, unknown>) => Promise<ListResult>;
482
- getTransferShipping: (params?: Record<string, unknown>) => Promise<ListResult>;
483
- }
484
- /**
485
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
486
- *
487
- * Creates server-side nexus (warehouse management) actions with selective caching.
488
- *
489
- * Write operations (bin transfer, receiving, transfer) do NOT use caching.
490
- * Read/list operations (receipts, shipping) ARE cached with standard TTL.
491
- *
492
- * @example
493
- * ```ts
494
- * import { createNexusActions } from "@simpleapps-com/augur-server";
495
- * import { getAugurClient } from "./augur-client";
496
- *
497
- * export const nexusActions = createNexusActions(getAugurClient(), {
498
- * cachePrefix: "ampro:",
499
- * });
500
- *
501
- * const transfer = await nexusActions.createBinTransfer({ locationId: 5, transfers: [] });
502
- * const receipts = await nexusActions.getPurchaseOrderReceipts();
503
- * ```
504
- */
505
- declare function createNexusActions(api: NexusApiClient, config?: NexusActionsConfig): NexusActions;
506
-
507
- /** Derived from augur-api SDK — keeps types in sync automatically. */
508
- type VmiApiClient = Pick<AugurAPI, "vmi">;
509
- interface VmiActionsConfig {
510
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
511
- cachePrefix?: string;
512
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
513
- edgeCache?: EdgeCacheValue;
514
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
515
- redisTtl?: number;
516
- /** Redis TTL for short-lived data like availability. Default: 300 (5 min). */
517
- shortRedisTtl?: number;
518
- }
519
- interface VmiActions {
520
- getWarehouses: (params?: Record<string, unknown>) => Promise<ListResult>;
521
- getWarehouseAvailability: (warehouseUid: number, params?: Record<string, unknown>) => Promise<ListResult>;
522
- getDistributors: (params?: Record<string, unknown>) => Promise<ListResult>;
523
- getProducts: (params?: Record<string, unknown>) => Promise<ListResult>;
524
- getInventoryProfiles: (params?: Record<string, unknown>) => Promise<ListResult>;
525
- getRestockHeaders: (params?: Record<string, unknown>) => Promise<ListResult>;
526
- getSections: (params?: Record<string, unknown>) => Promise<ListResult>;
527
- }
528
- /**
529
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
530
- *
531
- * Creates server-side VMI (Vendor Managed Inventory) actions with Redis caching.
532
- *
533
- * All VMI read operations are cached. Warehouse availability uses a shorter TTL
534
- * because inventory levels change more frequently than configuration data.
535
- *
536
- * @example
537
- * ```ts
538
- * import { createVmiActions } from "@simpleapps-com/augur-server";
539
- * import { getAugurClient } from "./augur-client";
540
- *
541
- * export const vmiActions = createVmiActions(getAugurClient(), {
542
- * cachePrefix: "ampro:",
543
- * });
544
- *
545
- * const warehouses = await vmiActions.getWarehouses({ customerId: 12345 });
546
- * const availability = await vmiActions.getWarehouseAvailability(123);
547
- * const distributors = await vmiActions.getDistributors({ customerId: 12345 });
548
- * ```
549
- */
550
- declare function createVmiActions(api: VmiApiClient, config?: VmiActionsConfig): VmiActions;
551
-
552
- /** Derived from augur-api SDK — keeps types in sync automatically. */
553
- type P21CoreApiClient = Pick<AugurAPI, "p21Core">;
554
- interface P21CoreActionsConfig {
555
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
556
- cachePrefix?: string;
557
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
558
- edgeCache?: EdgeCacheValue;
559
- /** CDN edge cache for rarely-changing data. Default: 8 (hours). */
560
- longEdgeCache?: EdgeCacheValue;
561
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
562
- redisTtl?: number;
563
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
564
- longRedisTtl?: number;
565
- }
566
- interface P21CoreActions {
567
- getAddresses: (params?: Record<string, unknown>) => Promise<ListResult>;
568
- getCompanies: (params?: Record<string, unknown>) => Promise<ListResult>;
569
- getCompany: (companyId: number) => Promise<unknown | undefined>;
570
- getLocations: (params?: Record<string, unknown>) => Promise<ListResult>;
571
- getPaymentTypes: (params?: Record<string, unknown>) => Promise<ListResult>;
572
- getCashDrawers: (params?: Record<string, unknown>) => Promise<ListResult>;
573
- getCodeP21: (params?: Record<string, unknown>) => Promise<ListResult>;
574
- }
575
- /**
576
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
577
- *
578
- * Creates server-side P21 Core actions with Redis caching and edge cache support.
579
- *
580
- * Covers the P21 Core microservice endpoints: addresses, companies,
581
- * locations, payment types, cash drawers, and P21 codes.
582
- *
583
- * @example
584
- * ```ts
585
- * import { createP21CoreActions } from "@simpleapps-com/augur-server";
586
- * import { getAugurClient } from "./augur-client";
587
- *
588
- * export const p21CoreActions = createP21CoreActions(getAugurClient(), {
589
- * cachePrefix: "ampro:",
590
- * });
591
- *
592
- * const companies = await p21CoreActions.getCompanies();
593
- * const company = await p21CoreActions.getCompany(123);
594
- * ```
595
- */
596
- declare function createP21CoreActions(api: P21CoreApiClient, config?: P21CoreActionsConfig): P21CoreActions;
597
-
598
- /** Derived from augur-api SDK — keeps types in sync automatically. */
599
- type P21ApisApiClient = Pick<AugurAPI, "p21Apis">;
600
- interface P21ApisActionsConfig {
601
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
602
- cachePrefix?: string;
603
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
604
- edgeCache?: EdgeCacheValue;
605
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
606
- redisTtl?: number;
607
- }
608
- interface P21ApisActions {
609
- getCategories: (params?: Record<string, unknown>) => Promise<ListResult>;
610
- getCategoryDefaults: (categoryId: number) => Promise<unknown | undefined>;
611
- getCompanies: (params?: Record<string, unknown>) => Promise<ListResult>;
612
- getUsers: (params?: Record<string, unknown>) => Promise<ListResult>;
613
- getWebDisplayTypes: (params?: Record<string, unknown>) => Promise<ListResult>;
614
- getWebDisplayTypeDefaults: (id?: number) => Promise<unknown | undefined>;
615
- refreshContacts: (params?: Record<string, unknown>) => Promise<unknown | undefined>;
616
- refreshCustomers: (params?: Record<string, unknown>) => Promise<unknown | undefined>;
617
- }
618
- /**
619
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
620
- *
621
- * Creates server-side P21 APIs actions with Redis caching and edge cache support.
622
- *
623
- * Covers the P21 APIs microservice endpoints: transaction categories,
624
- * companies, users, web display types, and entity refresh operations.
625
- *
626
- * @example
627
- * ```ts
628
- * import { createP21ApisActions } from "@simpleapps-com/augur-server";
629
- * import { getAugurClient } from "./augur-client";
630
- *
631
- * export const p21ApisActions = createP21ApisActions(getAugurClient(), {
632
- * cachePrefix: "ampro:",
633
- * });
634
- *
635
- * const categories = await p21ApisActions.getCategories();
636
- * await p21ApisActions.refreshContacts();
637
- * ```
638
- */
639
- declare function createP21ApisActions(api: P21ApisApiClient, config?: P21ApisActionsConfig): P21ApisActions;
640
-
641
- /** Derived from augur-api SDK — keeps types in sync automatically. */
642
- type P21SismApiClient = Pick<AugurAPI, "p21Sism">;
643
- interface P21SismActionsConfig {
644
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
645
- cachePrefix?: string;
646
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
647
- edgeCache?: EdgeCacheValue;
648
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
649
- redisTtl?: number;
650
- }
651
- interface P21SismActions {
652
- getRecentImports: (params?: Record<string, unknown>) => Promise<ListResult>;
653
- getImport: (importId: string) => Promise<unknown | undefined>;
654
- getImportLines: (importId: number, params?: Record<string, unknown>) => Promise<ListResult>;
655
- getScheduledImports: (params?: Record<string, unknown>) => Promise<ListResult>;
656
- }
657
- /**
658
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
659
- *
660
- * Creates server-side P21 SISM actions with Redis caching and edge cache support.
661
- *
662
- * Covers the P21 SISM (System Integration & Storage Management) endpoints:
663
- * imports, import lines, and scheduled import masters.
664
- *
665
- * @example
666
- * ```ts
667
- * import { createP21SismActions } from "@simpleapps-com/augur-server";
668
- * import { getAugurClient } from "./augur-client";
669
- *
670
- * export const p21SismActions = createP21SismActions(getAugurClient(), {
671
- * cachePrefix: "ampro:",
672
- * });
673
- *
674
- * const recentImports = await p21SismActions.getRecentImports({ hours: 24 });
675
- * const importDetail = await p21SismActions.getImport("12345");
676
- * ```
677
- */
678
- declare function createP21SismActions(api: P21SismApiClient, config?: P21SismActionsConfig): P21SismActions;
679
-
680
- /** Derived from augur-api SDK — keeps types in sync automatically. */
681
- type AgrWorkApiClient = Pick<AugurAPI, "agrWork">;
682
- interface AgrWorkActionsConfig {
683
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
684
- cachePrefix?: string;
685
- }
686
- interface AgrWorkActions {
687
- healthCheck: () => Promise<string | undefined>;
688
- ping: () => Promise<string | undefined>;
689
- }
690
- /**
691
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
692
- *
693
- * Creates server-side AGR Work actions for health monitoring and connectivity.
694
- *
695
- * Covers the AGR Work microservice endpoints: healthCheck and ping.
696
- * These are real-time operations and do not use caching.
697
- *
698
- * @example
699
- * ```ts
700
- * import { createAgrWorkActions } from "@simpleapps-com/augur-server";
701
- * import { getAugurClient } from "./augur-client";
702
- *
703
- * export const agrWorkActions = createAgrWorkActions(getAugurClient());
704
- *
705
- * const health = await agrWorkActions.healthCheck();
706
- * const pong = await agrWorkActions.ping();
707
- * ```
708
- */
709
- declare function createAgrWorkActions(api: AgrWorkApiClient, _config?: AgrWorkActionsConfig): AgrWorkActions;
710
-
711
- /** Derived from augur-api SDK — keeps types in sync automatically. */
712
- type AgrInfoApiClient = Pick<AugurAPI, "agrInfo">;
713
- interface AgrInfoActionsConfig {
714
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
715
- cachePrefix?: string;
716
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
717
- edgeCache?: EdgeCacheValue;
718
- /** CDN edge cache for rarely-changing data. Default: 8 (hours). */
719
- longEdgeCache?: EdgeCacheValue;
720
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
721
- redisTtl?: number;
722
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
723
- longRedisTtl?: number;
724
- }
725
- interface AgrInfoActions {
726
- getContext: (params?: Record<string, unknown>) => Promise<ListResult>;
727
- getRubrics: (params?: Record<string, unknown>) => Promise<ListResult>;
728
- getMicroservices: (params?: Record<string, unknown>) => Promise<ListResult>;
729
- generateAkasha: (data?: Record<string, unknown>) => Promise<unknown | undefined>;
730
- generateJoomla: (data?: Record<string, unknown>) => Promise<unknown | undefined>;
731
- }
732
- /**
733
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
734
- *
735
- * Creates server-side AGR Info actions with Redis caching and edge cache support.
736
- *
737
- * Covers the AGR Info microservice endpoints: context, rubrics,
738
- * microservices, and AI generation (akasha/joomla).
739
- *
740
- * @example
741
- * ```ts
742
- * import { createAgrInfoActions } from "@simpleapps-com/augur-server";
743
- * import { getAugurClient } from "./augur-client";
744
- *
745
- * export const agrInfoActions = createAgrInfoActions(getAugurClient(), {
746
- * cachePrefix: "ampro:",
747
- * });
748
- *
749
- * const rubrics = await agrInfoActions.getRubrics();
750
- * const result = await agrInfoActions.generateAkasha({ prompt: "Hello" });
751
- * ```
752
- */
753
- declare function createAgrInfoActions(api: AgrInfoApiClient, config?: AgrInfoActionsConfig): AgrInfoActions;
754
-
755
- /** Derived from augur-api SDK — keeps types in sync automatically. */
756
- type Basecamp2ApiClient = Pick<AugurAPI, "basecamp2">;
757
- interface Basecamp2ActionsConfig {
758
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
759
- cachePrefix?: string;
760
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
761
- edgeCache?: EdgeCacheValue;
762
- /** CDN edge cache for rarely-changing data like people. Default: 8 (hours). */
763
- longEdgeCache?: EdgeCacheValue;
764
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
765
- redisTtl?: number;
766
- /** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
767
- longRedisTtl?: number;
768
- }
769
- interface Basecamp2Actions {
770
- getTodos: (params?: Record<string, unknown>) => Promise<ListResult>;
771
- getTodo: (todoId: number) => Promise<unknown>;
772
- getTodosSummary: (params?: Record<string, unknown>) => Promise<ListResult>;
773
- getComments: (params?: Record<string, unknown>) => Promise<ListResult>;
774
- getPeople: (params?: Record<string, unknown>) => Promise<ListResult>;
775
- getProjects: (params?: Record<string, unknown>) => Promise<ListResult>;
776
- getEvents: (params?: Record<string, unknown>) => Promise<ListResult>;
777
- getMetrics: (params?: Record<string, unknown>) => Promise<ListResult>;
778
- getTodolists: (params?: Record<string, unknown>) => Promise<ListResult>;
779
- }
780
- /**
781
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
782
- *
783
- * Creates server-side basecamp2 actions with Redis caching and edge cache support.
784
- *
785
- * Covers the Basecamp2 project management endpoints: todos, todo summaries,
786
- * comments, people, projects, events, metrics, and todolists.
787
- *
788
- * @example
789
- * ```ts
790
- * import { createBasecamp2Actions } from "@simpleapps-com/augur-server";
791
- * import { getAugurClient } from "./augur-client";
792
- *
793
- * export const basecamp2Actions = createBasecamp2Actions(getAugurClient(), {
794
- * cachePrefix: "ampro:",
795
- * });
796
- *
797
- * const todos = await basecamp2Actions.getTodos();
798
- * const people = await basecamp2Actions.getPeople();
799
- * ```
800
- */
801
- declare function createBasecamp2Actions(api: Basecamp2ApiClient, config?: Basecamp2ActionsConfig): Basecamp2Actions;
802
-
803
- /** Derived from augur-api SDK — keeps types in sync automatically. */
804
- type BrandFolderApiClient = Pick<AugurAPI, "brandFolder">;
805
- interface BrandFolderActionsConfig {
806
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
807
- cachePrefix?: string;
808
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
809
- edgeCache?: EdgeCacheValue;
810
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
811
- redisTtl?: number;
812
- }
813
- interface BrandFolderActions {
814
- getCategories: (params?: Record<string, unknown>) => Promise<ListResult>;
815
- getCategory: (categoryId: string) => Promise<unknown>;
816
- createFocus: (categoryId: string, data: Record<string, unknown>) => Promise<unknown | undefined>;
817
- }
818
- /**
819
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
820
- *
821
- * Creates server-side brand-folder actions with Redis caching and edge cache support.
822
- *
823
- * Covers the Brand Folder service endpoints: category listing, category detail,
824
- * and category focus creation.
825
- *
826
- * @example
827
- * ```ts
828
- * import { createBrandFolderActions } from "@simpleapps-com/augur-server";
829
- * import { getAugurClient } from "./augur-client";
830
- *
831
- * export const brandFolderActions = createBrandFolderActions(getAugurClient(), {
832
- * cachePrefix: "ampro:",
833
- * });
834
- *
835
- * const categories = await brandFolderActions.getCategories();
836
- * const category = await brandFolderActions.getCategory("cat-123");
837
- * const focus = await brandFolderActions.createFocus("cat-123", { focusLevel: "primary" });
838
- * ```
839
- */
840
- declare function createBrandFolderActions(api: BrandFolderApiClient, config?: BrandFolderActionsConfig): BrandFolderActions;
841
-
842
- /** Derived from augur-api SDK — keeps types in sync automatically. */
843
- type GregorovichApiClient = Pick<AugurAPI, "gregorovich">;
844
- interface GregorovichActionsConfig {
845
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
846
- cachePrefix?: string;
847
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
848
- edgeCache?: EdgeCacheValue;
849
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
850
- redisTtl?: number;
851
- }
852
- interface GregorovichActions {
853
- askChatGpt: (params: Record<string, unknown>) => Promise<unknown | undefined>;
854
- getDocuments: (params?: Record<string, unknown>) => Promise<ListResult>;
855
- createDocument: (data: Record<string, unknown>) => Promise<unknown | undefined>;
856
- generateOllama: (data: Record<string, unknown>) => Promise<unknown | undefined>;
857
- }
858
- /**
859
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
860
- *
861
- * Creates server-side gregorovich actions with Redis caching and edge cache support.
862
- *
863
- * Covers the Gregorovich AI service endpoints: ChatGPT ask, document listing,
864
- * document creation, and Ollama generation.
865
- *
866
- * @example
867
- * ```ts
868
- * import { createGregorovichActions } from "@simpleapps-com/augur-server";
869
- * import { getAugurClient } from "./augur-client";
870
- *
871
- * export const gregorovichActions = createGregorovichActions(getAugurClient(), {
872
- * cachePrefix: "ampro:",
873
- * });
874
- *
875
- * const answer = await gregorovichActions.askChatGpt({ question: "What is AI?" });
876
- * const docs = await gregorovichActions.getDocuments();
877
- * ```
878
- */
879
- declare function createGregorovichActions(api: GregorovichApiClient, config?: GregorovichActionsConfig): GregorovichActions;
880
-
881
- /** Derived from augur-api SDK — keeps types in sync automatically. */
882
- type SlackApiClient = Pick<AugurAPI, "slack">;
883
- interface SlackActionsConfig {
884
- /** Cache key prefix (e.g. "ampro:"). Default: "". */
885
- cachePrefix?: string;
886
- /** CDN edge cache value passed to SDK. Default: 1 (hour). */
887
- edgeCache?: EdgeCacheValue;
888
- /** Redis TTL in seconds. Default: 3600 (1 hour). */
889
- redisTtl?: number;
890
- }
891
- interface SlackActions {
892
- sendWebhook: (data: Record<string, unknown>) => Promise<unknown | undefined>;
893
- getWebhooks: (params?: Record<string, unknown>) => Promise<ListResult>;
894
- }
895
- /**
896
- * @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
897
- *
898
- * Creates server-side slack actions with Redis caching and edge cache support.
899
- *
900
- * Covers the Slack integration endpoints: webhook sending and webhook listing.
901
- *
902
- * @example
903
- * ```ts
904
- * import { createSlackActions } from "@simpleapps-com/augur-server";
905
- * import { getAugurClient } from "./augur-client";
906
- *
907
- * export const slackActions = createSlackActions(getAugurClient(), {
908
- * cachePrefix: "ampro:",
909
- * });
910
- *
911
- * const result = await slackActions.sendWebhook({ text: "Hello!" });
912
- * const webhooks = await slackActions.getWebhooks();
913
- * ```
914
- */
915
- declare function createSlackActions(api: SlackApiClient, config?: SlackActionsConfig): SlackActions;
916
-
917
- interface SiteActionsConfig {
918
- /**
919
- * Cache key prefix shared across all services.
920
- *
921
- * Defaults to `"${siteId}:"` extracted from the API client.
922
- * The site ID is the canonical cache namespace — most sites should
923
- * NOT set this and let it derive automatically.
924
- *
925
- * Only override when migrating from a legacy prefix (e.g. `"ampro:"`
926
- * instead of the site ID `"ampro-online"`).
927
- */
928
- cachePrefix?: string;
929
- /** Default edge cache TTL in seconds */
930
- edgeCache?: EdgeCacheValue;
931
- /** Default Redis TTL in seconds */
932
- redisTtl?: number;
933
- /** Long-lived edge cache TTL for rarely-changing data */
934
- longEdgeCache?: EdgeCacheValue;
935
- /** Long-lived Redis TTL for rarely-changing data */
936
- longRedisTtl?: number;
937
- /** Default contact ID for commerce operations. Falls back to process.env.DEFAULT_CONTACT_ID. */
938
- defaultContactId?: string | number;
939
- /** Default customer ID for pricing and commerce. Falls back to process.env.DEFAULT_CUSTOMER_ID. */
940
- defaultCustomerId?: string | number;
941
- /** Default company ID. Falls back to process.env.DEFAULT_COMPANY_ID. Not yet consumed by any factory. */
942
- defaultCompanyId?: string | number;
943
- /** UOM conversion function for commerce (e.g. "EA" → "EACH") */
944
- convertUnitOfMeasure?: (uom: string) => string;
945
- /** Pricing-specific overrides */
946
- pricing?: {
947
- taxRedisTtl?: number;
948
- };
949
- /** Items-specific overrides */
950
- items?: {
951
- sortChildren?: boolean;
952
- sortByPrefix?: string;
953
- };
954
- /** Search-specific overrides */
955
- search?: {
956
- defaultSourceFields?: string;
957
- };
958
- /** Payments-specific overrides */
959
- payments?: {
960
- mode?: string;
961
- };
962
- /** Shipping config — fromAddress is required for shipping to work */
963
- shipping?: {
964
- fromAddress: ShippingAddress;
965
- defaultServiceCodes?: string[];
966
- };
967
- /** VMI-specific overrides */
968
- vmi?: {
969
- shortRedisTtl?: number;
970
- };
971
- }
972
- interface SiteActions {
973
- pricing: PricingActions;
974
- items: ItemActions;
975
- commerce: CommerceActions;
976
- search: SearchActions;
977
- orders: OrderActions;
978
- shipping: ShippingActions;
979
- joomla: JoomlaActions;
980
- legacy: LegacyActions;
981
- customers: CustomersActions;
982
- smartyStreets: SmartyStreetsActions;
983
- p21Pim: P21PimActions;
984
- agrSite: AgrSiteActions;
985
- avalara: AvalaraActions;
986
- payments: PaymentsActions;
987
- ups: UpsActions;
988
- logistics: LogisticsActions;
989
- nexus: NexusActions;
990
- vmi: VmiActions;
991
- p21Core: P21CoreActions;
992
- p21Apis: P21ApisActions;
993
- p21Sism: P21SismActions;
994
- agrWork: AgrWorkActions;
995
- agrInfo: AgrInfoActions;
996
- basecamp2: Basecamp2Actions;
997
- brandFolder: BrandFolderActions;
998
- gregorovich: GregorovichActions;
999
- slack: SlackActions;
1000
- }
1001
- /**
1002
- * Creates a unified site actions object with all service factories.
1003
- *
1004
- * Shared config (cachePrefix, edgeCache, redisTtl, etc.) is passed to all
1005
- * services automatically. Per-service overrides are available for services
1006
- * with additional configuration.
1007
- *
1008
- * @example
1009
- * ```ts
1010
- * import { createSiteActions } from "@simpleapps-com/augur-server";
1011
- * import { getAugurClient } from "./augur-client";
1012
- *
1013
- * // defaultCustomerId/defaultContactId fall back to DEFAULT_CUSTOMER_ID/DEFAULT_CONTACT_ID
1014
- * // env vars when not provided — no need to set them if CDK injects them.
1015
- * export const actions = createSiteActions(getAugurClient(), {
1016
- * convertUnitOfMeasure: (uom) => uom === "EA" ? "EACH" : uom,
1017
- * items: { sortChildren: true },
1018
- * shipping: {
1019
- * fromAddress: { address1: "123 Main", city: "Provo", state: "UT", postalCode: "84606" },
1020
- * defaultServiceCodes: ["03"],
1021
- * },
1022
- * });
1023
- *
1024
- * // Usage:
1025
- * const price = await actions.pricing.getItemPrice("ITEM-1");
1026
- * const doc = await actions.items.getInvMastDoc("ITEM-1");
1027
- * const cart = await actions.commerce.cartHdrLookup({ userId: 123 });
1028
- * ```
1029
- */
1030
- declare function createSiteActions<TApi extends object>(api: TApi, config?: SiteActionsConfig): SiteActions;
1031
-
1032
- export { type PaymentsActionsConfig as $, type AgrInfoActions as A, type Basecamp2Actions as B, type CommerceActions as C, type LogisticsActions as D, type LogisticsActionsConfig as E, type LogisticsApiClient as F, type GregorovichActions as G, type NexusActionsConfig as H, type NexusApiClient as I, type OrderActionsConfig as J, type OrderApiClient as K, type LegacyActions as L, type P21ApisActionsConfig as M, type NexusActions as N, type OrderActions as O, type P21ApisActions as P, type P21ApisApiClient as Q, type P21CoreActions as R, type P21CoreActionsConfig as S, type P21CoreApiClient as T, type P21PimActions as U, type P21PimActionsConfig as V, type P21PimApiClient as W, type P21SismActions as X, type P21SismActionsConfig as Y, type P21SismApiClient as Z, type PaymentsActions as _, type AgrInfoActionsConfig as a, type PaymentsApiClient as a0, type PricingActions as a1, type PricingActionsConfig as a2, type PricingApiClient as a3, type SiteActions as a4, type SiteActionsConfig as a5, type SlackActions as a6, type SlackActionsConfig as a7, type SlackApiClient as a8, type UpsActions as a9, createUpsActions as aA, createVmiActions as aB, type UpsActionsConfig as aa, type UpsApiClient as ab, type VmiActions as ac, type VmiActionsConfig as ad, type VmiApiClient as ae, createAgrInfoActions as af, createAgrSiteActions as ag, createAgrWorkActions as ah, createAvalaraActions as ai, createBasecamp2Actions as aj, createBrandFolderActions as ak, createCommerceActions as al, createCustomersActions as am, createGregorovichActions as an, createLegacyActions as ao, createLogisticsActions as ap, createNexusActions as aq, createOrderActions as ar, createP21ApisActions as as, createP21CoreActions as at, createP21PimActions as au, createP21SismActions as av, createPaymentsActions as aw, createPricingActions as ax, createSiteActions as ay, createSlackActions as az, type AgrInfoApiClient as b, type AgrSiteActions as c, type AgrSiteActionsConfig as d, type AgrSiteApiClient as e, type AgrWorkActions as f, type AgrWorkActionsConfig as g, type AgrWorkApiClient as h, type AvalaraActions as i, type AvalaraActionsConfig as j, type AvalaraApiClient as k, type Basecamp2ActionsConfig as l, type Basecamp2ApiClient as m, type BrandFolderActions as n, type BrandFolderActionsConfig as o, type BrandFolderApiClient as p, type CommerceActionsConfig as q, type CommerceApiClient as r, type CustomerListResult as s, type CustomersActions as t, type CustomersActionsConfig as u, type CustomersApiClient as v, type GregorovichActionsConfig as w, type GregorovichApiClient as x, type LegacyActionsConfig as y, type LegacyApiClient as z };