@simpleapps-com/augur-server 2.4.0 → 2026.11.2
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/EXPORTS.md +30 -73
- package/README.md +29 -198
- package/dist/actions/agr-info.d.ts +44 -0
- package/dist/actions/agr-info.d.ts.map +1 -0
- package/dist/actions/agr-site.d.ts +38 -0
- package/dist/actions/agr-site.d.ts.map +1 -0
- package/dist/actions/agr-work.d.ts +29 -0
- package/dist/actions/agr-work.d.ts.map +1 -0
- package/dist/actions/avalara.d.ts +38 -0
- package/dist/actions/avalara.d.ts.map +1 -0
- package/dist/actions/basecamp2.d.ts +48 -0
- package/dist/actions/basecamp2.d.ts.map +1 -0
- package/dist/actions/brand-folder.d.ts +39 -0
- package/dist/actions/brand-folder.d.ts.map +1 -0
- package/dist/actions/commerce.d.ts +58 -0
- package/dist/actions/commerce.d.ts.map +1 -0
- package/dist/actions/customers.d.ts +45 -0
- package/dist/actions/customers.d.ts.map +1 -0
- package/dist/actions/favorites.d.ts +21 -0
- package/dist/actions/favorites.d.ts.map +1 -0
- package/dist/actions/gregorovich.d.ts +35 -0
- package/dist/actions/gregorovich.d.ts.map +1 -0
- package/dist/actions/items.d.ts +81 -0
- package/dist/actions/items.d.ts.map +1 -0
- package/dist/actions/joomla.d.ts +60 -0
- package/dist/actions/joomla.d.ts.map +1 -0
- package/dist/actions/legacy.d.ts +46 -0
- package/dist/actions/legacy.d.ts.map +1 -0
- package/dist/actions/logistics.d.ts +41 -0
- package/dist/actions/logistics.d.ts.map +1 -0
- package/dist/actions/orders.d.ts +37 -0
- package/dist/actions/orders.d.ts.map +1 -0
- package/dist/actions/p21-apis.d.ts +34 -0
- package/dist/actions/p21-apis.d.ts.map +1 -0
- package/dist/actions/p21-core.d.ts +47 -0
- package/dist/actions/p21-core.d.ts.map +1 -0
- package/dist/actions/p21-pim.d.ts +37 -0
- package/dist/actions/p21-pim.d.ts.map +1 -0
- package/dist/actions/p21-sism.d.ts +38 -0
- package/dist/actions/p21-sism.d.ts.map +1 -0
- package/dist/actions/payments.d.ts +39 -0
- package/dist/actions/payments.d.ts.map +1 -0
- package/dist/actions/pricing.d.ts +46 -0
- package/dist/actions/pricing.d.ts.map +1 -0
- package/dist/actions/search.d.ts +62 -0
- package/dist/actions/search.d.ts.map +1 -0
- package/dist/actions/shipping.d.ts +57 -0
- package/dist/actions/shipping.d.ts.map +1 -0
- package/dist/actions/site.d.ts +142 -0
- package/dist/actions/site.d.ts.map +1 -0
- package/dist/actions/smarty-streets.d.ts +45 -0
- package/dist/actions/smarty-streets.d.ts.map +1 -0
- package/dist/actions/vmi.d.ts +45 -0
- package/dist/actions/vmi.d.ts.map +1 -0
- package/dist/actions/wishlists.d.ts +29 -0
- package/dist/actions/wishlists.d.ts.map +1 -0
- package/dist/api-handler.d.ts +25 -0
- package/dist/api-handler.d.ts.map +1 -0
- package/dist/api.d.ts +2 -26
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +19 -14
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts +10 -12
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +2 -2
- package/dist/cache/redis-client.d.ts +18 -0
- package/dist/cache/redis-client.d.ts.map +1 -0
- package/dist/cache/with-cache.d.ts +17 -0
- package/dist/cache/with-cache.d.ts.map +1 -0
- package/dist/{chunk-PIYHMA6F.js → chunk-6CSVIBHQ.js} +15 -18
- package/dist/chunk-6CSVIBHQ.js.map +1 -0
- package/dist/{chunk-ALTIINP6.js → chunk-A4IVBK6P.js} +30 -6
- package/dist/chunk-A4IVBK6P.js.map +1 -0
- package/dist/{chunk-KHFEDL47.js → chunk-INVDQQ7T.js} +18 -12
- package/dist/chunk-INVDQQ7T.js.map +1 -0
- package/dist/{chunk-26WZBC4F.js → chunk-LX7SJJOU.js} +275 -667
- package/dist/chunk-LX7SJJOU.js.map +1 -0
- package/dist/chunk-OBWQSGB6.js +205 -0
- package/dist/chunk-OBWQSGB6.js.map +1 -0
- package/dist/{chunk-2NL4QKJN.js → chunk-UVGG74FO.js} +31 -30
- package/dist/chunk-UVGG74FO.js.map +1 -0
- package/dist/duration.d.ts +16 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/environment.d.ts +10 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/hooks.d.ts +8 -10
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +3 -3
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +16 -125
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/pagination.d.ts +32 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/query-action.d.ts +15 -117
- package/dist/query-action.d.ts.map +1 -0
- package/dist/query-action.js +3 -3
- package/dist/query-options-helper.d.ts +34 -0
- package/dist/query-options-helper.d.ts.map +1 -0
- package/dist/query.js +1 -2
- package/dist/recaptcha.d.ts +6 -0
- package/dist/recaptcha.d.ts.map +1 -0
- package/dist/rules.d.ts +230 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/scoped-client-key.d.ts +9 -0
- package/dist/scoped-client-key.d.ts.map +1 -0
- package/dist/sdk-call.d.ts +66 -0
- package/dist/sdk-call.d.ts.map +1 -0
- package/dist/sdk-client-store.d.ts +250 -0
- package/dist/sdk-client-store.d.ts.map +1 -0
- package/dist/server-actions.d.ts +2 -0
- package/dist/server-actions.d.ts.map +1 -0
- package/dist/server-query-client.d.ts +19 -0
- package/dist/server-query-client.d.ts.map +1 -0
- package/dist/{server-site-registry-CdBfczOj.d.ts → server-site-registry.d.ts} +7 -9
- package/dist/server-site-registry.d.ts.map +1 -0
- package/dist/{site.d.ts → server-site.d.ts} +11 -16
- package/dist/server-site.d.ts.map +1 -0
- package/dist/site-actions-store.d.ts +27 -0
- package/dist/site-actions-store.d.ts.map +1 -0
- package/dist/site.js +15 -14
- package/dist/site.js.map +1 -1
- package/dist/testing.d.ts +9 -12
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +7 -27
- package/dist/testing.js.map +1 -1
- package/dist/utils/batch-fetch.d.ts +7 -0
- package/dist/utils/batch-fetch.d.ts.map +1 -0
- package/llms.txt +72 -51
- package/package.json +30 -20
- package/dist/actions.d.ts +0 -2
- package/dist/chunk-26WZBC4F.js.map +0 -1
- package/dist/chunk-2NL4QKJN.js.map +0 -1
- package/dist/chunk-ALTIINP6.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-KHFEDL47.js.map +0 -1
- package/dist/chunk-PIYHMA6F.js.map +0 -1
- package/dist/query.d.ts +0 -35
- package/dist/site-BjSFqufX.d.ts +0 -469
package/dist/site-BjSFqufX.d.ts
DELETED
|
@@ -1,469 +0,0 @@
|
|
|
1
|
-
import { ListResult, EdgeCacheValue } from '@simpleapps-com/augur-core';
|
|
2
|
-
import { TPriceData, TTaxItem, TTax, TCategory, TCategoryItemsResult, TItemsFilters, TProductItem, TAttribute, TInvMast, TInvMastDoc, TStock, TItemAccessory, TCartLookUp, TCartLine, TRelatedProduct, TCheckoutResult, TSearchSuggestionsResponse, TShippingMethod, TJoomlaContent, TMenu, MenuItem, TPasswordVerification, TWebDesc, CustomerDocument, TSmartyStreets, TTransactionSetup, TAccountQuery, TSurcharge, TCardInfo, TBillingUpdate, TPaymentValidation } from '@simpleapps-com/augur-utils';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Standardized paginated response shape.
|
|
6
|
-
* Works with any factory method — compose with `paginateOffset()`.
|
|
7
|
-
*/
|
|
8
|
-
interface PaginatedResult<T> {
|
|
9
|
-
data: T[];
|
|
10
|
-
total: number;
|
|
11
|
-
nextCursor?: number;
|
|
12
|
-
hasMore: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Wraps a list of items with offset-based pagination metadata.
|
|
16
|
-
*
|
|
17
|
-
* Use this to standardize pagination responses from any factory method.
|
|
18
|
-
* Compatible with React Query's infinite query pattern (`getNextPageParam`).
|
|
19
|
-
*
|
|
20
|
-
* @param items - The items returned from the current page
|
|
21
|
-
* @param pageParam - The current page number (0-based)
|
|
22
|
-
* @param limit - The page size
|
|
23
|
-
* @param total - Optional total count of items (from API response)
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* const result = await actions.items.getCategoryItems(uid, {
|
|
28
|
-
* ...filters, offset: page * 24, limit: 24,
|
|
29
|
-
* });
|
|
30
|
-
* return paginateOffset(result.items, page, 24, result.total);
|
|
31
|
-
* // { data: [...], total: 150, nextCursor: 1, hasMore: true }
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
declare function paginateOffset<T>(items: T[], pageParam: number, limit: number, total?: number): PaginatedResult<T>;
|
|
35
|
-
|
|
36
|
-
interface PricingActions {
|
|
37
|
-
getItemPrice: (itemId: string, customerId?: string | number, quantity?: number) => Promise<TPriceData>;
|
|
38
|
-
batchGetItemPrices: (itemIds: string[], customerId?: string | number, quantity?: number) => Promise<Record<string, TPriceData>>;
|
|
39
|
-
getTaxEstimate: (customerId?: string | number, postalCode?: string, items?: TTaxItem[]) => Promise<TTax>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** Typed options for getItemCategory. */
|
|
43
|
-
interface GetItemCategoryOptions {
|
|
44
|
-
childrenFilter?: string;
|
|
45
|
-
childrenLimit?: number;
|
|
46
|
-
childrenOffset?: number;
|
|
47
|
-
classId5List?: string;
|
|
48
|
-
filters?: Record<string, string>;
|
|
49
|
-
orderBy?: string;
|
|
50
|
-
path?: string;
|
|
51
|
-
productCollection?: string;
|
|
52
|
-
rootItemCategoryId?: string;
|
|
53
|
-
}
|
|
54
|
-
interface ItemActions {
|
|
55
|
-
itemCategoryLookup: (path: string) => Promise<unknown>;
|
|
56
|
-
getItemCategory: (uid: number, options?: GetItemCategoryOptions) => Promise<TCategory>;
|
|
57
|
-
getCategoryItems: {
|
|
58
|
-
(uid: number, filters: Record<string, unknown>): Promise<TCategoryItemsResult>;
|
|
59
|
-
(uid: number, itemsFilters: TItemsFilters): Promise<TCategoryItemsResult>;
|
|
60
|
-
};
|
|
61
|
-
getCategoryItemsInfinite: (uid: number, itemsFilters?: TItemsFilters, pageParam?: number) => Promise<PaginatedResult<TProductItem>>;
|
|
62
|
-
getItemAttributes: (categoryUid: number) => Promise<{
|
|
63
|
-
attributes: TAttribute[];
|
|
64
|
-
}>;
|
|
65
|
-
getInvMast: (uid: number) => Promise<TInvMast>;
|
|
66
|
-
getInvMastDoc: {
|
|
67
|
-
(params: {
|
|
68
|
-
invMastUid?: number;
|
|
69
|
-
itemId?: string;
|
|
70
|
-
includePricing?: "Y" | "N";
|
|
71
|
-
}): Promise<TInvMastDoc>;
|
|
72
|
-
(invMastUid: number, itemId?: string, includePricing?: "Y" | "N"): Promise<TInvMastDoc>;
|
|
73
|
-
};
|
|
74
|
-
getStock: (invMastUid: number) => Promise<TStock>;
|
|
75
|
-
getStockCompanySummary: (invMastUid: number) => Promise<Record<string, number>>;
|
|
76
|
-
getItemFaqs: (invMastUid: number) => Promise<ListResult>;
|
|
77
|
-
getItemSubstitutes: (invMastUid: number) => Promise<ListResult>;
|
|
78
|
-
getItemAccessories: (invMastUid: number) => Promise<ListResult<TItemAccessory>>;
|
|
79
|
-
getSimilarItems: (invMastUid: number) => Promise<ListResult>;
|
|
80
|
-
batchGetInvMastDocs: (params: {
|
|
81
|
-
invMastUid?: number;
|
|
82
|
-
itemId?: string;
|
|
83
|
-
}[]) => Promise<Record<string, TInvMastDoc>>;
|
|
84
|
-
batchGetStockData: (invMastUids: number[]) => Promise<Record<number, TStock>>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interface CommerceActions {
|
|
88
|
-
cartHdrLookup: (params: {
|
|
89
|
-
userId?: string | number;
|
|
90
|
-
cartToken?: string;
|
|
91
|
-
contactId?: string | number;
|
|
92
|
-
customerId?: string | number;
|
|
93
|
-
}) => Promise<TCartLookUp>;
|
|
94
|
-
getCartLines: (cartHdrUid: number) => Promise<ListResult<TCartLine>>;
|
|
95
|
-
addToCart: (cartHdrUid: number, items: {
|
|
96
|
-
itemId?: string;
|
|
97
|
-
invMastUid?: number;
|
|
98
|
-
quantity: number;
|
|
99
|
-
unitOfMeasure: string;
|
|
100
|
-
}[]) => Promise<unknown>;
|
|
101
|
-
updateCartLines: (cartHdrUid: number, lines: {
|
|
102
|
-
lineNo: number;
|
|
103
|
-
quantity: number;
|
|
104
|
-
unitOfMeasure: string;
|
|
105
|
-
}[]) => Promise<unknown>;
|
|
106
|
-
deleteCartItems: (cartHdrUid: number) => Promise<void>;
|
|
107
|
-
getCartAlsoBought: (cartHdrUid: number) => Promise<ListResult<TRelatedProduct>>;
|
|
108
|
-
checkoutOrder: (cartHdrUid: number, data: Record<string, unknown>) => Promise<TCheckoutResult>;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/** Paginated response for infinite scroll. */
|
|
112
|
-
interface SearchPage {
|
|
113
|
-
data: TProductItem[];
|
|
114
|
-
total: number;
|
|
115
|
-
nextCursor?: number;
|
|
116
|
-
}
|
|
117
|
-
interface SearchActions {
|
|
118
|
-
getSearchAttributes: (q: string) => Promise<{
|
|
119
|
-
attributes: TAttribute[];
|
|
120
|
-
}>;
|
|
121
|
-
getSearchSuggestions: (q: string, limit?: number, offset?: number) => Promise<TSearchSuggestionsResponse>;
|
|
122
|
-
itemSearch: (filters: {
|
|
123
|
-
q: string;
|
|
124
|
-
limit: number;
|
|
125
|
-
offset: number;
|
|
126
|
-
sortBy?: string;
|
|
127
|
-
filters?: [string, string][];
|
|
128
|
-
}, itemCategoryUid?: number | string) => Promise<{
|
|
129
|
-
items: TProductItem[];
|
|
130
|
-
totalResults: number;
|
|
131
|
-
}>;
|
|
132
|
-
itemSearchInfinite: (filters: {
|
|
133
|
-
q: string;
|
|
134
|
-
limit: number;
|
|
135
|
-
sortBy?: string;
|
|
136
|
-
filters?: [string, string][];
|
|
137
|
-
}, itemCategoryUid?: number | string, pageParam?: number) => Promise<SearchPage>;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
interface OrderActions {
|
|
141
|
-
getOrderDoc: (orderNo: string, postalCode: string) => Promise<unknown>;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
interface ShippingAddress {
|
|
145
|
-
address1: string;
|
|
146
|
-
city: string;
|
|
147
|
-
state: string;
|
|
148
|
-
postalCode: string;
|
|
149
|
-
country?: string;
|
|
150
|
-
}
|
|
151
|
-
interface ShippingActions {
|
|
152
|
-
getShippingRates: (toAddress: ShippingAddress, weight: number, serviceCodes?: string[]) => Promise<ListResult<TShippingMethod>>;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
interface NormalizedUserProfile {
|
|
156
|
-
id: string;
|
|
157
|
-
name: string;
|
|
158
|
-
email: string;
|
|
159
|
-
customerId: string;
|
|
160
|
-
permissions: string[];
|
|
161
|
-
}
|
|
162
|
-
interface JoomlaActions {
|
|
163
|
-
getJoomlaContent: {
|
|
164
|
-
(articleId: number): Promise<TJoomlaContent>;
|
|
165
|
-
(articleId: number | string, options: {
|
|
166
|
-
alias: string;
|
|
167
|
-
catId?: number;
|
|
168
|
-
}): Promise<TJoomlaContent>;
|
|
169
|
-
};
|
|
170
|
-
getJoomlaContentList: (params?: Record<string, unknown>) => Promise<ListResult<TJoomlaContent>>;
|
|
171
|
-
getJoomlaMenu: {
|
|
172
|
-
(params?: Record<string, unknown>): Promise<ListResult<TMenu>>;
|
|
173
|
-
(parentId: number, menuType: string): Promise<ListResult<TMenu>>;
|
|
174
|
-
};
|
|
175
|
-
getJoomlaMenuDoc: (menuId: number | string) => Promise<MenuItem>;
|
|
176
|
-
getUserProfile: (userId: number | string) => Promise<NormalizedUserProfile>;
|
|
177
|
-
verifyPassword: (username: string, password: string) => Promise<TPasswordVerification>;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
interface LegacyActions {
|
|
181
|
-
getItemWebDesc: (invMastUid: number) => Promise<TWebDesc | undefined>;
|
|
182
|
-
getAlsoBoughtItems: (invMastUid: number) => Promise<ListResult<TRelatedProduct>>;
|
|
183
|
-
getItemTags: (invMastUid: number) => Promise<ListResult>;
|
|
184
|
-
getStates: (params?: {
|
|
185
|
-
twoLetterCode?: string;
|
|
186
|
-
}) => Promise<ListResult>;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
interface CustomersActions {
|
|
190
|
-
getCustomer: (customerId: number) => Promise<CustomerDocument>;
|
|
191
|
-
customerLookup: (params: Record<string, unknown>) => Promise<ListResult<CustomerDocument>>;
|
|
192
|
-
getCustomerDoc: (customerId: number) => Promise<CustomerDocument>;
|
|
193
|
-
getCustomerOrders: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
|
|
194
|
-
getCustomerOrderDetail: (customerId: number, orderId: number) => Promise<unknown>;
|
|
195
|
-
getCustomerInvoices: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
|
|
196
|
-
getCustomerInvoiceDetail: (customerId: number, invoiceNo: number) => Promise<unknown>;
|
|
197
|
-
getCustomerQuotes: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
|
|
198
|
-
getCustomerQuoteDetail: (customerId: number, quoteNo: number) => Promise<unknown>;
|
|
199
|
-
getContacts: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
200
|
-
getShipToAddresses: (customerId: number) => Promise<ListResult>;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/** Standardized response from address validation. */
|
|
204
|
-
interface AddressValidationResult {
|
|
205
|
-
data: TSmartyStreets | undefined;
|
|
206
|
-
status: "success" | "not_found" | "error";
|
|
207
|
-
error?: {
|
|
208
|
-
message: string;
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
interface SmartyStreetsActions {
|
|
212
|
-
validateAddress: (params: Record<string, unknown>) => Promise<AddressValidationResult>;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
interface P21PimActions {
|
|
216
|
-
getInvMastExt: (invMastUid: number) => Promise<unknown>;
|
|
217
|
-
listInvMastExt: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
interface AgrSiteActions {
|
|
221
|
-
getSettings: (serviceName?: string) => Promise<ListResult>;
|
|
222
|
-
getMetaFiles: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
interface AvalaraActions {
|
|
226
|
-
calculateTax: (data: Record<string, unknown>) => Promise<unknown>;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
interface PaymentsActions {
|
|
230
|
-
transactionSetup: (params: Record<string, unknown>) => Promise<TTransactionSetup | undefined>;
|
|
231
|
-
accountQuery: (params: Record<string, unknown>) => Promise<TAccountQuery | undefined>;
|
|
232
|
-
getSurcharge: (params: Record<string, unknown>) => Promise<TSurcharge | undefined>;
|
|
233
|
-
cardInfo: (params: Record<string, unknown>) => Promise<TCardInfo | undefined>;
|
|
234
|
-
billingUpdate: (params: Record<string, unknown>) => Promise<TBillingUpdate | undefined>;
|
|
235
|
-
validatePayment: (params: Record<string, unknown>) => Promise<TPaymentValidation | undefined>;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
interface LogisticsActions {
|
|
239
|
-
getFreightRates: (params: Record<string, unknown>) => Promise<ListResult>;
|
|
240
|
-
getShipVia: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
interface NexusActions {
|
|
244
|
-
createBinTransfer: (data: Record<string, unknown>) => Promise<unknown>;
|
|
245
|
-
createReceiving: (data: Record<string, unknown>) => Promise<unknown>;
|
|
246
|
-
createTransfer: (data: Record<string, unknown>) => Promise<unknown>;
|
|
247
|
-
getPurchaseOrderReceipts: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
248
|
-
getTransferReceipts: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
249
|
-
getTransferShipping: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
interface VmiActions {
|
|
253
|
-
getWarehouses: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
254
|
-
getWarehouseAvailability: (warehouseUid: number, params?: Record<string, unknown>) => Promise<ListResult>;
|
|
255
|
-
getDistributors: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
256
|
-
getProducts: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
257
|
-
getInventoryProfiles: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
258
|
-
getRestockHeaders: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
259
|
-
getSections: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
interface P21CoreActions {
|
|
263
|
-
getAddresses: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
264
|
-
getCompanies: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
265
|
-
getCompany: (companyId: number) => Promise<unknown | undefined>;
|
|
266
|
-
getLocations: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
267
|
-
getPaymentTypes: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
268
|
-
getCashDrawers: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
269
|
-
getCodeP21: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
interface P21ApisActions {
|
|
273
|
-
getCategories: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
274
|
-
getCategoryDefaults: (categoryId: number) => Promise<unknown | undefined>;
|
|
275
|
-
getCompanies: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
276
|
-
getUsers: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
277
|
-
getWebDisplayTypes: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
278
|
-
getWebDisplayTypeDefaults: (id?: number) => Promise<unknown | undefined>;
|
|
279
|
-
refreshContacts: (params?: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
280
|
-
refreshCustomers: (params?: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
interface P21SismActions {
|
|
284
|
-
getRecentImports: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
285
|
-
getImport: (importId: string) => Promise<unknown | undefined>;
|
|
286
|
-
getImportLines: (importId: number, params?: Record<string, unknown>) => Promise<ListResult>;
|
|
287
|
-
getScheduledImports: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
interface AgrWorkActions {
|
|
291
|
-
healthCheck: () => Promise<string | undefined>;
|
|
292
|
-
ping: () => Promise<string | undefined>;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
interface AgrInfoActions {
|
|
296
|
-
getContext: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
297
|
-
getRubrics: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
298
|
-
getMicroservices: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
299
|
-
generateAkasha: (data?: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
300
|
-
generateJoomla: (data?: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
interface Basecamp2Actions {
|
|
304
|
-
getTodos: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
305
|
-
getTodo: (todoId: number) => Promise<unknown>;
|
|
306
|
-
getTodosSummary: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
307
|
-
getComments: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
308
|
-
getPeople: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
309
|
-
getProjects: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
310
|
-
getEvents: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
311
|
-
getMetrics: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
312
|
-
getTodolists: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
interface BrandFolderActions {
|
|
316
|
-
getCategories: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
317
|
-
getCategory: (categoryId: string) => Promise<unknown>;
|
|
318
|
-
createFocus: (categoryId: string, data: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
interface GregorovichActions {
|
|
322
|
-
askChatGpt: (params: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
323
|
-
getDocuments: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
324
|
-
createDocument: (data: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
325
|
-
generateOllama: (data: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
interface SlackActions {
|
|
329
|
-
sendWebhook: (data: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
330
|
-
getWebhooks: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
interface FavoritesActions {
|
|
334
|
-
getFavorites: (userId: number) => Promise<ListResult>;
|
|
335
|
-
addFavorite: (userId: number, invMastUid: number) => Promise<unknown>;
|
|
336
|
-
removeFavorite: (userId: number, invMastUid: number) => Promise<void>;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
interface WishlistActions {
|
|
340
|
-
getWishlists: (userId: number) => Promise<ListResult>;
|
|
341
|
-
createWishlist: (userId: number, data: {
|
|
342
|
-
name: string;
|
|
343
|
-
description?: string;
|
|
344
|
-
}) => Promise<unknown>;
|
|
345
|
-
getWishlistDetail: (userId: number, wishlistId: number) => Promise<unknown>;
|
|
346
|
-
deleteWishlist: (userId: number, wishlistId: number) => Promise<void>;
|
|
347
|
-
addWishlistItems: (userId: number, wishlistId: number, items: {
|
|
348
|
-
invMastUid: number;
|
|
349
|
-
}[]) => Promise<unknown>;
|
|
350
|
-
removeWishlistItem: (userId: number, wishlistId: number, lineId: number) => Promise<void>;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
interface SiteActionsConfig {
|
|
354
|
-
/**
|
|
355
|
-
* Cache key prefix shared across all services.
|
|
356
|
-
*
|
|
357
|
-
* Defaults to `"${siteId}:"` extracted from the API client.
|
|
358
|
-
* The site ID is the canonical cache namespace — most sites should
|
|
359
|
-
* NOT set this and let it derive automatically.
|
|
360
|
-
*
|
|
361
|
-
* Only override when migrating from a legacy prefix (e.g. `"ampro:"`
|
|
362
|
-
* instead of the site ID `"ampro-online"`).
|
|
363
|
-
*/
|
|
364
|
-
cachePrefix?: string;
|
|
365
|
-
/** Default edge cache TTL in seconds */
|
|
366
|
-
edgeCache?: EdgeCacheValue;
|
|
367
|
-
/** Default Redis TTL in seconds */
|
|
368
|
-
redisTtl?: number;
|
|
369
|
-
/** Long-lived edge cache TTL for rarely-changing data */
|
|
370
|
-
longEdgeCache?: EdgeCacheValue;
|
|
371
|
-
/** Long-lived Redis TTL for rarely-changing data */
|
|
372
|
-
longRedisTtl?: number;
|
|
373
|
-
/** Default contact ID for commerce operations. Falls back to process.env.DEFAULT_CONTACT_ID. */
|
|
374
|
-
defaultContactId?: string | number;
|
|
375
|
-
/** Default customer ID for pricing and commerce. Falls back to process.env.DEFAULT_CUSTOMER_ID. */
|
|
376
|
-
defaultCustomerId?: string | number;
|
|
377
|
-
/** Default company ID. Falls back to process.env.DEFAULT_COMPANY_ID. Not yet consumed by any factory. */
|
|
378
|
-
defaultCompanyId?: string | number;
|
|
379
|
-
/** UOM conversion function for commerce (e.g. "EA" → "EACH") */
|
|
380
|
-
convertUnitOfMeasure?: (uom: string) => string;
|
|
381
|
-
/** Pricing-specific overrides */
|
|
382
|
-
pricing?: {
|
|
383
|
-
taxRedisTtl?: number;
|
|
384
|
-
};
|
|
385
|
-
/** Items-specific overrides */
|
|
386
|
-
items?: {
|
|
387
|
-
sortChildren?: boolean;
|
|
388
|
-
sortByPrefix?: string;
|
|
389
|
-
};
|
|
390
|
-
/** Search-specific overrides */
|
|
391
|
-
search?: {
|
|
392
|
-
defaultSourceFields?: string;
|
|
393
|
-
};
|
|
394
|
-
/** Payments-specific overrides */
|
|
395
|
-
payments?: {
|
|
396
|
-
mode?: string;
|
|
397
|
-
};
|
|
398
|
-
/** Shipping config — fromAddress is required for shipping to work */
|
|
399
|
-
shipping?: {
|
|
400
|
-
fromAddress: ShippingAddress;
|
|
401
|
-
defaultServiceCodes?: string[];
|
|
402
|
-
};
|
|
403
|
-
/** VMI-specific overrides */
|
|
404
|
-
vmi?: {
|
|
405
|
-
shortRedisTtl?: number;
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
interface SiteActions {
|
|
409
|
-
pricing: PricingActions;
|
|
410
|
-
items: ItemActions;
|
|
411
|
-
commerce: CommerceActions;
|
|
412
|
-
search: SearchActions;
|
|
413
|
-
orders: OrderActions;
|
|
414
|
-
shipping: ShippingActions;
|
|
415
|
-
joomla: JoomlaActions;
|
|
416
|
-
legacy: LegacyActions;
|
|
417
|
-
customers: CustomersActions;
|
|
418
|
-
smartyStreets: SmartyStreetsActions;
|
|
419
|
-
p21Pim: P21PimActions;
|
|
420
|
-
agrSite: AgrSiteActions;
|
|
421
|
-
avalara: AvalaraActions;
|
|
422
|
-
payments: PaymentsActions;
|
|
423
|
-
logistics: LogisticsActions;
|
|
424
|
-
nexus: NexusActions;
|
|
425
|
-
vmi: VmiActions;
|
|
426
|
-
p21Core: P21CoreActions;
|
|
427
|
-
p21Apis: P21ApisActions;
|
|
428
|
-
p21Sism: P21SismActions;
|
|
429
|
-
agrWork: AgrWorkActions;
|
|
430
|
-
agrInfo: AgrInfoActions;
|
|
431
|
-
basecamp2: Basecamp2Actions;
|
|
432
|
-
brandFolder: BrandFolderActions;
|
|
433
|
-
gregorovich: GregorovichActions;
|
|
434
|
-
slack: SlackActions;
|
|
435
|
-
favorites: FavoritesActions;
|
|
436
|
-
wishlists: WishlistActions;
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Creates a unified site actions object with all service factories.
|
|
440
|
-
*
|
|
441
|
-
* Shared config (cachePrefix, edgeCache, redisTtl, etc.) is passed to all
|
|
442
|
-
* services automatically. Per-service overrides are available for services
|
|
443
|
-
* with additional configuration.
|
|
444
|
-
*
|
|
445
|
-
* @example
|
|
446
|
-
* ```ts
|
|
447
|
-
* import { createSiteActions } from "@simpleapps-com/augur-server";
|
|
448
|
-
* import { getAugurClient } from "./augur-client";
|
|
449
|
-
*
|
|
450
|
-
* // defaultCustomerId/defaultContactId fall back to DEFAULT_CUSTOMER_ID/DEFAULT_CONTACT_ID
|
|
451
|
-
* // env vars when not provided — no need to set them if CDK injects them.
|
|
452
|
-
* export const actions = createSiteActions(getAugurClient(), {
|
|
453
|
-
* convertUnitOfMeasure: (uom) => uom === "EA" ? "EACH" : uom,
|
|
454
|
-
* items: { sortChildren: true },
|
|
455
|
-
* shipping: {
|
|
456
|
-
* fromAddress: { address1: "123 Main", city: "Provo", state: "UT", postalCode: "84606" },
|
|
457
|
-
* defaultServiceCodes: ["03"],
|
|
458
|
-
* },
|
|
459
|
-
* });
|
|
460
|
-
*
|
|
461
|
-
* // Usage:
|
|
462
|
-
* const price = await actions.pricing.getItemPrice("ITEM-1");
|
|
463
|
-
* const doc = await actions.items.getInvMastDoc("ITEM-1");
|
|
464
|
-
* const cart = await actions.commerce.cartHdrLookup({ userId: 123 });
|
|
465
|
-
* ```
|
|
466
|
-
*/
|
|
467
|
-
declare function createSiteActions<TApi extends object>(api: TApi, config?: SiteActionsConfig): SiteActions;
|
|
468
|
-
|
|
469
|
-
export { type PaginatedResult as P, type SiteActions as S, type SiteActionsConfig as a, createSiteActions as c, paginateOffset as p };
|