@simpleapps-com/augur-server 2.2.9 → 2.2.11
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 +40 -33
- package/README.md +366 -0
- package/dist/hooks.d.ts +2 -1
- package/dist/hooks.js.map +1 -1
- package/llms.txt +127 -124
- package/package.json +5 -5
package/EXPORTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @simpleapps-com/augur-server exports
|
|
2
2
|
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.10
|
|
4
4
|
|
|
5
5
|
> Auto-generated from built type declarations. Do not edit manually.
|
|
6
6
|
> Regenerate with: `pnpm run generate-exports`
|
|
@@ -18,39 +18,10 @@ Version: 2.0.21
|
|
|
18
18
|
| `batchFetch` | function | Fetches data for multiple params in parallel, returning a Record keyed by |
|
|
19
19
|
| `cacheGet` | function | Read a cached value by key. |
|
|
20
20
|
| `cacheSet` | function | Write a value to cache with a TTL. Fire-and-forget semantics: no-ops |
|
|
21
|
-
| `createAgrInfoActions` | value | |
|
|
22
|
-
| `createAgrSiteActions` | value | |
|
|
23
|
-
| `createAgrWorkActions` | value | |
|
|
24
|
-
| `createAvalaraActions` | value | |
|
|
25
|
-
| `createBasecamp2Actions` | value | |
|
|
26
|
-
| `createBrandFolderActions` | value | |
|
|
27
|
-
| `createCommerceActions` | value | |
|
|
28
|
-
| `createCustomersActions` | value | |
|
|
29
|
-
| `createFavoritesActions` | function | |
|
|
30
|
-
| `createGregorovichActions` | value | |
|
|
31
|
-
| `createItemActions` | value | |
|
|
32
|
-
| `createJoomlaActions` | function | |
|
|
33
|
-
| `createLegacyActions` | value | |
|
|
34
|
-
| `createLogisticsActions` | value | |
|
|
35
|
-
| `createNexusActions` | value | |
|
|
36
|
-
| `createOrderActions` | value | |
|
|
37
|
-
| `createP21ApisActions` | value | |
|
|
38
|
-
| `createP21CoreActions` | value | |
|
|
39
|
-
| `createP21PimActions` | value | |
|
|
40
|
-
| `createP21SismActions` | value | |
|
|
41
|
-
| `createPaymentsActions` | value | |
|
|
42
|
-
| `createPricingActions` | value | |
|
|
43
21
|
| `createQueryOptions` | value | |
|
|
44
|
-
| `createSearchActions` | value | |
|
|
45
22
|
| `createServerQueryClient` | function | Creates a server-side query client optimised for prefetching. |
|
|
46
|
-
| `
|
|
47
|
-
| `createSiteActions` | value | |
|
|
48
|
-
| `createSlackActions` | value | |
|
|
49
|
-
| `createSmartyStreetsActions` | value | |
|
|
23
|
+
| `createSiteActions` | function | |
|
|
50
24
|
| `createSuspenseQueryOptions` | value | |
|
|
51
|
-
| `createUpsActions` | value | |
|
|
52
|
-
| `createVmiActions` | value | |
|
|
53
|
-
| `createWishlistActions` | function | |
|
|
54
25
|
| `env` | const | Resolved environment: `"development"`, `"staging"`, or `"production"`. |
|
|
55
26
|
| `getCircuitState` | function | Returns the current circuit breaker state. |
|
|
56
27
|
| `getServerQueryClient` | const | Returns a per-request singleton QueryClient for React Server Components. |
|
|
@@ -59,7 +30,7 @@ Version: 2.0.21
|
|
|
59
30
|
| `isProduction` | const | `true` when running on the production deployment. |
|
|
60
31
|
| `isRedisConnected` | function | Whether the Redis client is connected and ready to accept commands. |
|
|
61
32
|
| `isStaging` | const | `true` when running on the staging/dev deployment. |
|
|
62
|
-
| `paginateOffset` |
|
|
33
|
+
| `paginateOffset` | function | |
|
|
63
34
|
| `registerSiteActions` | function | |
|
|
64
35
|
| `safeAction` | function | Wraps an async function call with error handling, returning a |
|
|
65
36
|
| `sdkCall` | function | Calls an Augur SDK method, forwarding all arguments with full type safety. |
|
|
@@ -70,7 +41,7 @@ Version: 2.0.21
|
|
|
70
41
|
|
|
71
42
|
### Types
|
|
72
43
|
|
|
73
|
-
`
|
|
44
|
+
`PaginatedResult`, `SiteActions`, `SiteActionsConfig`
|
|
74
45
|
|
|
75
46
|
```ts
|
|
76
47
|
import { ActionResult, EdgeCacheValue, QueryOptionsConfig } from "@simpleapps-com/augur-server";
|
|
@@ -155,7 +126,9 @@ import { createServerSite } from "@simpleapps-com/augur-server/site";
|
|
|
155
126
|
| `ListResult` | value | |
|
|
156
127
|
| `SafeActionResult` | value | |
|
|
157
128
|
| `accountQuery` | function | |
|
|
129
|
+
| `addFavorite` | function | |
|
|
158
130
|
| `addToCart` | function | |
|
|
131
|
+
| `addWishlistItems` | function | |
|
|
159
132
|
| `askChatGpt` | function | |
|
|
160
133
|
| `batchGetInvMastDocs` | function | |
|
|
161
134
|
| `batchGetItemPrices` | function | |
|
|
@@ -170,8 +143,10 @@ import { createServerSite } from "@simpleapps-com/augur-server/site";
|
|
|
170
143
|
| `createFocus` | function | |
|
|
171
144
|
| `createReceiving` | function | |
|
|
172
145
|
| `createTransfer` | function | |
|
|
146
|
+
| `createWishlist` | function | |
|
|
173
147
|
| `customerLookup` | function | |
|
|
174
148
|
| `deleteCartItems` | function | |
|
|
149
|
+
| `deleteWishlist` | function | |
|
|
175
150
|
| `generateAkasha` | function | |
|
|
176
151
|
| `generateJoomla` | function | |
|
|
177
152
|
| `generateOllama` | function | |
|
|
@@ -202,6 +177,7 @@ import { createServerSite } from "@simpleapps-com/augur-server/site";
|
|
|
202
177
|
| `getDistributors` | function | |
|
|
203
178
|
| `getDocuments` | function | |
|
|
204
179
|
| `getEvents` | function | |
|
|
180
|
+
| `getFavorites` | function | |
|
|
205
181
|
| `getFreightRates` | function | |
|
|
206
182
|
| `getImport` | function | |
|
|
207
183
|
| `getImportLines` | function | |
|
|
@@ -264,14 +240,19 @@ import { createServerSite } from "@simpleapps-com/augur-server/site";
|
|
|
264
240
|
| `getWebDisplayTypeDefaults` | function | |
|
|
265
241
|
| `getWebDisplayTypes` | function | |
|
|
266
242
|
| `getWebhooks` | function | |
|
|
243
|
+
| `getWishlistDetail` | function | |
|
|
244
|
+
| `getWishlists` | function | |
|
|
267
245
|
| `healthCheck` | function | |
|
|
268
246
|
| `itemCategoryLookup` | function | |
|
|
269
247
|
| `itemSearch` | function | |
|
|
270
248
|
| `itemSearchInfinite` | function | |
|
|
271
249
|
| `listInvMastExt` | function | |
|
|
272
250
|
| `ping` | function | |
|
|
251
|
+
| `queryAction` | value | |
|
|
273
252
|
| `refreshContacts` | function | |
|
|
274
253
|
| `refreshCustomers` | function | |
|
|
254
|
+
| `removeFavorite` | function | |
|
|
255
|
+
| `removeWishlistItem` | function | |
|
|
275
256
|
| `sendWebhook` | function | |
|
|
276
257
|
| `transactionSetup` | function | |
|
|
277
258
|
| `updateCartLines` | function | |
|
|
@@ -283,4 +264,30 @@ import { createServerSite } from "@simpleapps-com/augur-server/site";
|
|
|
283
264
|
import { ApiResult, ListResult, SafeActionResult } from "@simpleapps-com/augur-server/actions";
|
|
284
265
|
```
|
|
285
266
|
|
|
267
|
+
## `@simpleapps-com/augur-server/hooks`
|
|
268
|
+
|
|
269
|
+
### Values
|
|
270
|
+
|
|
271
|
+
| Export | Kind | Description |
|
|
272
|
+
|--------|------|-------------|
|
|
273
|
+
| `QueryActionFn` | value | |
|
|
274
|
+
| `createServerQueryProxy` | function | Creates a client-side proxy that mirrors the SDK namespace and routes |
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
import { QueryActionFn, createServerQueryProxy } from "@simpleapps-com/augur-server/hooks";
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## `@simpleapps-com/augur-server/query-action`
|
|
281
|
+
|
|
282
|
+
### Values
|
|
283
|
+
|
|
284
|
+
| Export | Kind | Description |
|
|
285
|
+
|--------|------|-------------|
|
|
286
|
+
| `queryAction` | function | Generic server action that routes any SDK method call through the raw |
|
|
287
|
+
| `unwrapBaseResponse` | function | Unwrap SDK BaseResponse if the result matches the standard shape. |
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
import { queryAction, unwrapBaseResponse } from "@simpleapps-com/augur-server/query-action";
|
|
291
|
+
```
|
|
292
|
+
|
|
286
293
|
## `@simpleapps-com/augur-server/next-auth`
|
package/README.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# @simpleapps-com/augur-server
|
|
2
|
+
|
|
3
|
+
> Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)
|
|
4
|
+
|
|
5
|
+
> Auto-generated. Do not edit manually. Regenerate with: `pnpm run generate-exports`
|
|
6
|
+
|
|
7
|
+
Part of the **@simpleapps-com/augur-\*** platform. All packages use fixed versioning (same version number).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @simpleapps-com/augur-server
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Peer Dependencies
|
|
16
|
+
|
|
17
|
+
`@simpleapps-com/augur-api`, `@tanstack/react-query`, `ioredis`, `next`, `next-auth`, `react`
|
|
18
|
+
|
|
19
|
+
## Entry Points
|
|
20
|
+
|
|
21
|
+
| Import | Description |
|
|
22
|
+
|--------|-------------|
|
|
23
|
+
| `@simpleapps-com/augur-server` | 27 exports, 3 types |
|
|
24
|
+
| `@simpleapps-com/augur-server/auth` | 1 exports, 6 types |
|
|
25
|
+
| `@simpleapps-com/augur-server/query` | 2 exports, 1 types |
|
|
26
|
+
| `@simpleapps-com/augur-server/testing` | 5 exports, 3 types |
|
|
27
|
+
| `@simpleapps-com/augur-server/site` | 1 exports, 3 types |
|
|
28
|
+
| `@simpleapps-com/augur-server/actions` | 137 exports, 0 types |
|
|
29
|
+
| `@simpleapps-com/augur-server/hooks` | 2 exports, 0 types |
|
|
30
|
+
| `@simpleapps-com/augur-server/query-action` | 2 exports, 0 types |
|
|
31
|
+
| `@simpleapps-com/augur-server/next-auth` | 0 exports, 0 types |
|
|
32
|
+
|
|
33
|
+
## Exports
|
|
34
|
+
|
|
35
|
+
### Auth & Context
|
|
36
|
+
|
|
37
|
+
| Export | Kind | Description |
|
|
38
|
+
|--------|------|-------------|
|
|
39
|
+
| `QueryOptionsConfig` | value | |
|
|
40
|
+
| `createQueryOptions` | value | |
|
|
41
|
+
| `createSiteActions` | function | |
|
|
42
|
+
| `createSuspenseQueryOptions` | value | |
|
|
43
|
+
| `getSiteActions` | function | |
|
|
44
|
+
| `registerSiteActions` | function | |
|
|
45
|
+
| `createAuthConfig` | function | |
|
|
46
|
+
| `createQueryOptions` | const | Creates useQuery options with consistent key generation. |
|
|
47
|
+
| `createSuspenseQueryOptions` | const | Creates useSuspenseQuery options with consistent key generation. |
|
|
48
|
+
| `clearSiteActions` | function | |
|
|
49
|
+
| `createMockSiteActions` | function | Creates a fully-mocked SiteActions object for testing. |
|
|
50
|
+
| `createServerSite` | function | Create a server-side site instance that bundles the SDK client, server |
|
|
51
|
+
|
|
52
|
+
### Cart
|
|
53
|
+
|
|
54
|
+
| Export | Kind | Description |
|
|
55
|
+
|--------|------|-------------|
|
|
56
|
+
| `addToCart` | function | |
|
|
57
|
+
| `cartHdrLookup` | function | |
|
|
58
|
+
| `deleteCartItems` | function | |
|
|
59
|
+
| `getCartAlsoBought` | function | |
|
|
60
|
+
| `getCartLines` | function | |
|
|
61
|
+
| `updateCartLines` | function | |
|
|
62
|
+
|
|
63
|
+
### Items & Categories
|
|
64
|
+
|
|
65
|
+
| Export | Kind | Description |
|
|
66
|
+
|--------|------|-------------|
|
|
67
|
+
| `isProduction` | const | `true` when running on the production deployment. |
|
|
68
|
+
| `addWishlistItems` | function | |
|
|
69
|
+
| `batchGetInvMastDocs` | function | |
|
|
70
|
+
| `getAlsoBoughtItems` | function | |
|
|
71
|
+
| `getCategory` | function | |
|
|
72
|
+
| `getCategoryDefaults` | function | |
|
|
73
|
+
| `getCategoryItems` | function | |
|
|
74
|
+
| `getCategoryItemsInfinite` | function | |
|
|
75
|
+
| `getInvMast` | function | |
|
|
76
|
+
| `getInvMastDoc` | function | |
|
|
77
|
+
| `getInvMastExt` | function | |
|
|
78
|
+
| `getItemAccessories` | function | |
|
|
79
|
+
| `getItemAttributes` | function | |
|
|
80
|
+
| `getItemCategory` | function | |
|
|
81
|
+
| `getItemFaqs` | function | |
|
|
82
|
+
| `getItemSubstitutes` | function | |
|
|
83
|
+
| `getItemTags` | function | |
|
|
84
|
+
| `getItemWebDesc` | function | |
|
|
85
|
+
| `getProducts` | function | |
|
|
86
|
+
| `getSimilarItems` | function | |
|
|
87
|
+
| `itemCategoryLookup` | function | |
|
|
88
|
+
| `listInvMastExt` | function | |
|
|
89
|
+
| `removeWishlistItem` | function | |
|
|
90
|
+
|
|
91
|
+
### Orders
|
|
92
|
+
|
|
93
|
+
| Export | Kind | Description |
|
|
94
|
+
|--------|------|-------------|
|
|
95
|
+
| `getCustomerOrderDetail` | function | |
|
|
96
|
+
| `getCustomerOrders` | function | |
|
|
97
|
+
| `getOrderDoc` | function | |
|
|
98
|
+
| `getPurchaseOrderReceipts` | function | |
|
|
99
|
+
|
|
100
|
+
### Payment & Checkout
|
|
101
|
+
|
|
102
|
+
| Export | Kind | Description |
|
|
103
|
+
|--------|------|-------------|
|
|
104
|
+
| `billingUpdate` | function | |
|
|
105
|
+
| `checkoutOrder` | function | |
|
|
106
|
+
| `getPaymentTypes` | function | |
|
|
107
|
+
| `getSurcharge` | function | |
|
|
108
|
+
| `transactionSetup` | function | |
|
|
109
|
+
| `validatePayment` | function | |
|
|
110
|
+
|
|
111
|
+
### Pricing
|
|
112
|
+
|
|
113
|
+
| Export | Kind | Description |
|
|
114
|
+
|--------|------|-------------|
|
|
115
|
+
| `batchGetItemPrices` | function | |
|
|
116
|
+
| `getItemPrice` | function | |
|
|
117
|
+
|
|
118
|
+
### Search
|
|
119
|
+
|
|
120
|
+
| Export | Kind | Description |
|
|
121
|
+
|--------|------|-------------|
|
|
122
|
+
| `getSearchAttributes` | function | |
|
|
123
|
+
| `getSearchSuggestions` | function | |
|
|
124
|
+
| `itemSearch` | function | |
|
|
125
|
+
| `itemSearchInfinite` | function | |
|
|
126
|
+
|
|
127
|
+
### Shipping & Address
|
|
128
|
+
|
|
129
|
+
| Export | Kind | Description |
|
|
130
|
+
|--------|------|-------------|
|
|
131
|
+
| `getAddresses` | function | |
|
|
132
|
+
| `getShipToAddresses` | function | |
|
|
133
|
+
| `getShipVia` | function | |
|
|
134
|
+
| `getShippingRates` | function | |
|
|
135
|
+
| `getTransferShipping` | function | |
|
|
136
|
+
| `validateAddress` | function | |
|
|
137
|
+
|
|
138
|
+
### Stock
|
|
139
|
+
|
|
140
|
+
| Export | Kind | Description |
|
|
141
|
+
|--------|------|-------------|
|
|
142
|
+
| `batchGetStockData` | function | |
|
|
143
|
+
| `getRestockHeaders` | function | |
|
|
144
|
+
| `getStock` | function | |
|
|
145
|
+
| `getStockCompanySummary` | function | |
|
|
146
|
+
|
|
147
|
+
### Transforms
|
|
148
|
+
|
|
149
|
+
| Export | Kind | Description |
|
|
150
|
+
|--------|------|-------------|
|
|
151
|
+
| `paginateOffset` | function | |
|
|
152
|
+
|
|
153
|
+
### Utilities
|
|
154
|
+
|
|
155
|
+
| Export | Kind | Description |
|
|
156
|
+
|--------|------|-------------|
|
|
157
|
+
| `unwrap` | value | |
|
|
158
|
+
| `unwrapOr` | value | |
|
|
159
|
+
| `unwrapBaseResponse` | function | Unwrap SDK BaseResponse if the result matches the standard shape. |
|
|
160
|
+
|
|
161
|
+
### Other
|
|
162
|
+
|
|
163
|
+
| Export | Kind | Description |
|
|
164
|
+
|--------|------|-------------|
|
|
165
|
+
| `ActionResult` | value | |
|
|
166
|
+
| `EdgeCacheValue` | value | |
|
|
167
|
+
| `SafeActionResult` | value | |
|
|
168
|
+
| `batchFetch` | function | Fetches data for multiple params in parallel, returning a Record keyed by |
|
|
169
|
+
| `cacheGet` | function | Read a cached value by key. |
|
|
170
|
+
| `cacheSet` | function | Write a value to cache with a TTL. Fire-and-forget semantics: no-ops |
|
|
171
|
+
| `createServerQueryClient` | function | Creates a server-side query client optimised for prefetching. |
|
|
172
|
+
| `env` | const | Resolved environment: `"development"`, `"staging"`, or `"production"`. |
|
|
173
|
+
| `getCircuitState` | function | Returns the current circuit breaker state. |
|
|
174
|
+
| `getServerQueryClient` | const | Returns a per-request singleton QueryClient for React Server Components. |
|
|
175
|
+
| `isDev` | const | `true` when running locally (localhost / NODE_ENV=development). |
|
|
176
|
+
| `isRedisConnected` | function | Whether the Redis client is connected and ready to accept commands. |
|
|
177
|
+
| `isStaging` | const | `true` when running on the staging/dev deployment. |
|
|
178
|
+
| `safeAction` | function | Wraps an async function call with error handling, returning a |
|
|
179
|
+
| `sdkCall` | function | Calls an Augur SDK method, forwarding all arguments with full type safety. |
|
|
180
|
+
| `verifyRecaptcha` | function | Server-side Google reCAPTCHA v3 verification. |
|
|
181
|
+
| `withServerCache` | function | Server-side cache wrapper using augur-server's Redis client. |
|
|
182
|
+
| `DeepMockClient` | value | |
|
|
183
|
+
| `MockClientResult` | value | |
|
|
184
|
+
| `createMockClient` | value | |
|
|
185
|
+
| `ApiResult` | value | |
|
|
186
|
+
| `ListResult` | value | |
|
|
187
|
+
| `SafeActionResult` | value | |
|
|
188
|
+
| `accountQuery` | function | |
|
|
189
|
+
| `addFavorite` | function | |
|
|
190
|
+
| `askChatGpt` | function | |
|
|
191
|
+
| `calculateTax` | function | |
|
|
192
|
+
| `cardInfo` | function | |
|
|
193
|
+
| `createBinTransfer` | function | |
|
|
194
|
+
| `createDocument` | function | |
|
|
195
|
+
| `createFocus` | function | |
|
|
196
|
+
| `createReceiving` | function | |
|
|
197
|
+
| `createTransfer` | function | |
|
|
198
|
+
| `createWishlist` | function | |
|
|
199
|
+
| `customerLookup` | function | |
|
|
200
|
+
| `deleteWishlist` | function | |
|
|
201
|
+
| `generateAkasha` | function | |
|
|
202
|
+
| `generateJoomla` | function | |
|
|
203
|
+
| `generateOllama` | function | |
|
|
204
|
+
| `getBrandFolderCategories` | function | |
|
|
205
|
+
| `getCashDrawers` | function | |
|
|
206
|
+
| `getCodeP21` | function | |
|
|
207
|
+
| `getComments` | function | |
|
|
208
|
+
| `getCompanies` | function | |
|
|
209
|
+
| `getCompany` | function | |
|
|
210
|
+
| `getContacts` | function | |
|
|
211
|
+
| `getContext` | function | |
|
|
212
|
+
| `getCustomer` | function | |
|
|
213
|
+
| `getCustomerDoc` | function | |
|
|
214
|
+
| `getCustomerInvoiceDetail` | function | |
|
|
215
|
+
| `getCustomerInvoices` | function | |
|
|
216
|
+
| `getCustomerQuoteDetail` | function | |
|
|
217
|
+
| `getCustomerQuotes` | function | |
|
|
218
|
+
| `getDistributors` | function | |
|
|
219
|
+
| `getDocuments` | function | |
|
|
220
|
+
| `getEvents` | function | |
|
|
221
|
+
| `getFavorites` | function | |
|
|
222
|
+
| `getFreightRates` | function | |
|
|
223
|
+
| `getImport` | function | |
|
|
224
|
+
| `getImportLines` | function | |
|
|
225
|
+
| `getInventoryProfiles` | function | |
|
|
226
|
+
| `getJoomlaContent` | function | |
|
|
227
|
+
| `getJoomlaContentList` | function | |
|
|
228
|
+
| `getJoomlaMenu` | function | |
|
|
229
|
+
| `getJoomlaMenuDoc` | function | |
|
|
230
|
+
| `getLocations` | function | |
|
|
231
|
+
| `getMetaFiles` | function | |
|
|
232
|
+
| `getMetrics` | function | |
|
|
233
|
+
| `getMicroservices` | function | |
|
|
234
|
+
| `getP21Categories` | function | |
|
|
235
|
+
| `getP21Companies` | function | |
|
|
236
|
+
| `getPeople` | function | |
|
|
237
|
+
| `getProjects` | function | |
|
|
238
|
+
| `getRates` | function | |
|
|
239
|
+
| `getRecentImports` | function | |
|
|
240
|
+
| `getRubrics` | function | |
|
|
241
|
+
| `getScheduledImports` | function | |
|
|
242
|
+
| `getSections` | function | |
|
|
243
|
+
| `getSettings` | function | |
|
|
244
|
+
| `getStates` | function | |
|
|
245
|
+
| `getTaxEstimate` | function | |
|
|
246
|
+
| `getTodo` | function | |
|
|
247
|
+
| `getTodolists` | function | |
|
|
248
|
+
| `getTodos` | function | |
|
|
249
|
+
| `getTodosSummary` | function | |
|
|
250
|
+
| `getTransferReceipts` | function | |
|
|
251
|
+
| `getUserProfile` | function | |
|
|
252
|
+
| `getUsers` | function | |
|
|
253
|
+
| `getWarehouseAvailability` | function | |
|
|
254
|
+
| `getWarehouses` | function | |
|
|
255
|
+
| `getWebDisplayTypeDefaults` | function | |
|
|
256
|
+
| `getWebDisplayTypes` | function | |
|
|
257
|
+
| `getWebhooks` | function | |
|
|
258
|
+
| `getWishlistDetail` | function | |
|
|
259
|
+
| `getWishlists` | function | |
|
|
260
|
+
| `healthCheck` | function | |
|
|
261
|
+
| `ping` | function | |
|
|
262
|
+
| `queryAction` | value | |
|
|
263
|
+
| `refreshContacts` | function | |
|
|
264
|
+
| `refreshCustomers` | function | |
|
|
265
|
+
| `removeFavorite` | function | |
|
|
266
|
+
| `sendWebhook` | function | |
|
|
267
|
+
| `verifyPassword` | function | |
|
|
268
|
+
| `QueryActionFn` | value | |
|
|
269
|
+
| `createServerQueryProxy` | function | Creates a client-side proxy that mirrors the SDK namespace and routes |
|
|
270
|
+
| `queryAction` | function | Generic server action that routes any SDK method call through the raw |
|
|
271
|
+
|
|
272
|
+
## Examples
|
|
273
|
+
|
|
274
|
+
### safeAction
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
const result = await safeAction(
|
|
278
|
+
() => actions.commerce.addToCart(cartId, items),
|
|
279
|
+
);
|
|
280
|
+
if (result.ok) {
|
|
281
|
+
// result.data is the response data (undefined for void actions)
|
|
282
|
+
} else {
|
|
283
|
+
// result.error is the error message
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### sdkCall
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
const result = await sdkCall(
|
|
291
|
+
augurServices.items.invMast.get,
|
|
292
|
+
invMastUid,
|
|
293
|
+
{ edgeCache: 4 },
|
|
294
|
+
);
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### createMockSiteActions
|
|
298
|
+
|
|
299
|
+
```ts
|
|
300
|
+
import { createMockSiteActions } from "@simpleapps-com/augur-server/testing";
|
|
301
|
+
|
|
302
|
+
const { actions, mocks } = createMockSiteActions();
|
|
303
|
+
|
|
304
|
+
// Setup return values
|
|
305
|
+
mocks.pricing.getItemPrice.mockResolvedValue({ price: 9.99 });
|
|
306
|
+
|
|
307
|
+
// Pass actions to your component/server action
|
|
308
|
+
const price = await actions.pricing.getItemPrice("ITEM-1");
|
|
309
|
+
|
|
310
|
+
// Assert calls
|
|
311
|
+
expect(mocks.pricing.getItemPrice.mock.calls[0]).toEqual(["ITEM-1"]);
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### createServerSite
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { AugurApi } from "@simpleapps-com/augur-api";
|
|
318
|
+
import { createServerSite } from "@simpleapps-com/augur-server";
|
|
319
|
+
|
|
320
|
+
const api = new AugurApi({ baseUrl: process.env.AUGUR_API_URL! });
|
|
321
|
+
export const site = createServerSite(api, {
|
|
322
|
+
defaultCustomerId: "12345",
|
|
323
|
+
auth: { secret: process.env.AUTH_SECRET },
|
|
324
|
+
});
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### createServerQueryProxy
|
|
328
|
+
|
|
329
|
+
```tsx
|
|
330
|
+
import { createServerQueryProxy } from "@simpleapps-com/augur-server/hooks";
|
|
331
|
+
|
|
332
|
+
const q = createServerQueryProxy();
|
|
333
|
+
|
|
334
|
+
// Reads — any SDK method, routed through server actions
|
|
335
|
+
const { data: item } = useQuery(q.items.invMast.doc.get(42));
|
|
336
|
+
const { data: price } = useQuery(q.pricing.priceEngine.get({ itemId, customerId }));
|
|
337
|
+
|
|
338
|
+
// Infinite queries — spread and add infinite-specific options
|
|
339
|
+
const { data, fetchNextPage } = useInfiniteQuery({
|
|
340
|
+
...q.items.itemCategory.categoryItems.get(uid, filters),
|
|
341
|
+
getNextPageParam: (lastPage) => lastPage.nextCursor,
|
|
342
|
+
initialPageParam: 0,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// Mutations — write methods return mutation options
|
|
346
|
+
const addToCart = useMutation(q.commerce.cartLine.add.create());
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## Types
|
|
350
|
+
|
|
351
|
+
`PaginatedResult`, `SiteActions`, `SiteActionsConfig`, `AugurAuthCallbacks`, `AugurAuthClient`, `AugurJWT`, `AugurSession`, `AugurUser`, `CreateAuthConfigOptions`, `QueryOptionsConfig`, `MockFn`, `MockSiteActions`, `MockSiteActionsResult`, `ServerSite`, `ServerSiteAuthConfig`, `ServerSiteConfig`
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
## Related Packages
|
|
355
|
+
|
|
356
|
+
All packages use fixed versioning -- same version number across the platform.
|
|
357
|
+
|
|
358
|
+
| Package | Description |
|
|
359
|
+
|---------|-------------|
|
|
360
|
+
| `@simpleapps-com/augur-config` | Shared tooling configuration presets for Augur ecommerce sites |
|
|
361
|
+
| `@simpleapps-com/augur-core` | Universal foundation for Augur packages — proxy infrastructure, cache keys, method classification, shared types |
|
|
362
|
+
| `@simpleapps-com/augur-hooks` | Cross-platform React Query hooks and Zustand stores for Augur ecommerce sites |
|
|
363
|
+
| `@simpleapps-com/augur-mobile` | React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push) |
|
|
364
|
+
| `@simpleapps-com/augur-tailwind` | Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites |
|
|
365
|
+
| `@simpleapps-com/augur-utils` | Shared types, cache configuration, and utility functions for Augur ecommerce sites |
|
|
366
|
+
| `@simpleapps-com/augur-web` | Shared React UI components for Augur ecommerce sites (Radix + Tailwind) |
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QueryActionFn, OptionsProxyConfig, DeepQueryOptions } from '@simpleapps-com/augur-core';
|
|
2
2
|
export { QueryActionFn } from '@simpleapps-com/augur-core';
|
|
3
|
+
import { AugurAPI } from '@simpleapps-com/augur-api';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Creates a client-side proxy that mirrors the SDK namespace and routes
|
|
@@ -29,6 +30,6 @@ export { QueryActionFn } from '@simpleapps-com/augur-core';
|
|
|
29
30
|
* const addToCart = useMutation(q.commerce.cartLine.add.create());
|
|
30
31
|
* ```
|
|
31
32
|
*/
|
|
32
|
-
declare function createServerQueryProxy<TApi extends object =
|
|
33
|
+
declare function createServerQueryProxy<TApi extends object = AugurAPI>(queryActionOrConfig?: QueryActionFn | OptionsProxyConfig, config?: OptionsProxyConfig): DeepQueryOptions<TApi>;
|
|
33
34
|
|
|
34
35
|
export { createServerQueryProxy };
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks.ts"],"sourcesContent":["// \"use client\" banner is injected by tsup at build time.\n// Client-side proxy that generates React Query options backed by server actions.\n//\n// IMPORTANT: This file MUST NOT import from server-actions.ts or any module\n// that transitively depends on ioredis/withServerCache/action factories.\n// The queryAction import comes from query-action.ts which only depends on\n// site-actions-store.ts (a lightweight globalThis getter with zero deps).\n\nimport { createQueryActionProxy } from \"@simpleapps-com/augur-core\";\nimport type {\n DeepQueryOptions,\n OptionsProxyConfig,\n QueryActionFn,\n} from \"@simpleapps-com/augur-core\";\nimport { registerQueryAction } from \"@simpleapps-com/augur-hooks\";\nimport { queryAction as defaultQueryAction } from \"./query-action\";\n\n// Auto-register queryAction so augur-hooks provider and hooks can detect it.\n// This runs as a side effect when any site imports from augur-server/hooks.\nregisterQueryAction(defaultQueryAction);\n\n// Re-export for consumers who need the type\nexport type { QueryActionFn };\n\n/**\n * Creates a client-side proxy that mirrors the SDK namespace and routes\n * every method call through a server action function.\n *\n * The `queryAction` parameter is optional. If omitted, it uses the built-in\n * server action from `@simpleapps-com/augur-server/query-action`.\n *\n * @example\n * ```tsx\n * import { createServerQueryProxy } from \"@simpleapps-com/augur-server/hooks\";\n *\n * const q = createServerQueryProxy();\n *\n * // Reads — any SDK method, routed through server actions\n * const { data: item } = useQuery(q.items.invMast.doc.get(42));\n * const { data: price } = useQuery(q.pricing.priceEngine.get({ itemId, customerId }));\n *\n * // Infinite queries — spread and add infinite-specific options\n * const { data, fetchNextPage } = useInfiniteQuery({\n * ...q.items.itemCategory.categoryItems.get(uid, filters),\n * getNextPageParam: (lastPage) => lastPage.nextCursor,\n * initialPageParam: 0,\n * });\n *\n * // Mutations — write methods return mutation options\n * const addToCart = useMutation(q.commerce.cartLine.add.create());\n * ```\n */\nexport function createServerQueryProxy<TApi extends object =
|
|
1
|
+
{"version":3,"sources":["../src/hooks.ts"],"sourcesContent":["// \"use client\" banner is injected by tsup at build time.\n// Client-side proxy that generates React Query options backed by server actions.\n//\n// IMPORTANT: This file MUST NOT import from server-actions.ts or any module\n// that transitively depends on ioredis/withServerCache/action factories.\n// The queryAction import comes from query-action.ts which only depends on\n// site-actions-store.ts (a lightweight globalThis getter with zero deps).\n\nimport { createQueryActionProxy } from \"@simpleapps-com/augur-core\";\nimport type {\n DeepQueryOptions,\n OptionsProxyConfig,\n QueryActionFn,\n} from \"@simpleapps-com/augur-core\";\nimport type { AugurAPI } from \"@simpleapps-com/augur-api\";\nimport { registerQueryAction } from \"@simpleapps-com/augur-hooks\";\nimport { queryAction as defaultQueryAction } from \"./query-action\";\n\n// Auto-register queryAction so augur-hooks provider and hooks can detect it.\n// This runs as a side effect when any site imports from augur-server/hooks.\nregisterQueryAction(defaultQueryAction);\n\n// Re-export for consumers who need the type\nexport type { QueryActionFn };\n\n/**\n * Creates a client-side proxy that mirrors the SDK namespace and routes\n * every method call through a server action function.\n *\n * The `queryAction` parameter is optional. If omitted, it uses the built-in\n * server action from `@simpleapps-com/augur-server/query-action`.\n *\n * @example\n * ```tsx\n * import { createServerQueryProxy } from \"@simpleapps-com/augur-server/hooks\";\n *\n * const q = createServerQueryProxy();\n *\n * // Reads — any SDK method, routed through server actions\n * const { data: item } = useQuery(q.items.invMast.doc.get(42));\n * const { data: price } = useQuery(q.pricing.priceEngine.get({ itemId, customerId }));\n *\n * // Infinite queries — spread and add infinite-specific options\n * const { data, fetchNextPage } = useInfiniteQuery({\n * ...q.items.itemCategory.categoryItems.get(uid, filters),\n * getNextPageParam: (lastPage) => lastPage.nextCursor,\n * initialPageParam: 0,\n * });\n *\n * // Mutations — write methods return mutation options\n * const addToCart = useMutation(q.commerce.cartLine.add.create());\n * ```\n */\nexport function createServerQueryProxy<TApi extends object = AugurAPI>(\n queryActionOrConfig?: QueryActionFn | OptionsProxyConfig,\n config?: OptionsProxyConfig,\n): DeepQueryOptions<TApi> {\n const queryAction =\n typeof queryActionOrConfig === \"function\" ? queryActionOrConfig : defaultQueryAction;\n const resolvedConfig = typeof queryActionOrConfig === \"function\" ? config : queryActionOrConfig;\n\n return createQueryActionProxy<TApi>(queryAction, resolvedConfig);\n}\n"],"mappings":";;;;;;;AAQA,SAAS,8BAA8B;AAOvC,SAAS,2BAA2B;AAKpC,oBAAoB,WAAkB;AAiC/B,SAAS,uBACd,qBACA,QACwB;AACxB,QAAMA,eACJ,OAAO,wBAAwB,aAAa,sBAAsB;AACpE,QAAM,iBAAiB,OAAO,wBAAwB,aAAa,SAAS;AAE5E,SAAO,uBAA6BA,cAAa,cAAc;AACjE;","names":["queryAction"]}
|
package/llms.txt
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
|
+
# Augur Platform Packages
|
|
2
|
+
|
|
3
|
+
This package is part of the @simpleapps-com/augur-* platform.
|
|
4
|
+
All packages use fixed versioning (same version number).
|
|
5
|
+
The proxy pattern (createServerQueryProxy) is the primary data fetching API.
|
|
6
|
+
Pure transform utilities bridge user-facing types to SDK params without breaking proxy type safety.
|
|
7
|
+
|
|
8
|
+
## Sibling packages
|
|
9
|
+
|
|
10
|
+
- @simpleapps-com/augur-config - Shared tooling configuration presets for Augur ecommerce sites
|
|
11
|
+
- @simpleapps-com/augur-core - Universal foundation for Augur packages — proxy infrastructure, cache keys, method classification, shared types
|
|
12
|
+
- @simpleapps-com/augur-hooks - Cross-platform React Query hooks and Zustand stores for Augur ecommerce sites
|
|
13
|
+
- @simpleapps-com/augur-mobile - React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push)
|
|
14
|
+
- @simpleapps-com/augur-server (this package) - Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)
|
|
15
|
+
- @simpleapps-com/augur-tailwind - Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites
|
|
16
|
+
- @simpleapps-com/augur-utils - Shared types, cache configuration, and utility functions for Augur ecommerce sites
|
|
17
|
+
- @simpleapps-com/augur-web - Shared React UI components for Augur ecommerce sites (Radix + Tailwind)
|
|
18
|
+
|
|
19
|
+
Each package ships its own llms.txt with exports and usage patterns.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
1
23
|
# @simpleapps-com/augur-server
|
|
2
24
|
|
|
3
25
|
> Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)
|
|
4
26
|
|
|
5
|
-
Version: 2.
|
|
27
|
+
Version: 2.2.10
|
|
6
28
|
|
|
7
29
|
## @simpleapps-com/augur-server
|
|
8
30
|
|
|
@@ -13,39 +35,10 @@ Version: 2.0.21
|
|
|
13
35
|
- function: batchFetch - Fetches data for multiple params in parallel, returning a Record keyed by
|
|
14
36
|
- function: cacheGet - Read a cached value by key.
|
|
15
37
|
- function: cacheSet - Write a value to cache with a TTL. Fire-and-forget semantics: no-ops
|
|
16
|
-
- value: createAgrInfoActions
|
|
17
|
-
- value: createAgrSiteActions
|
|
18
|
-
- value: createAgrWorkActions
|
|
19
|
-
- value: createAvalaraActions
|
|
20
|
-
- value: createBasecamp2Actions
|
|
21
|
-
- value: createBrandFolderActions
|
|
22
|
-
- value: createCommerceActions
|
|
23
|
-
- value: createCustomersActions
|
|
24
|
-
- function: createFavoritesActions
|
|
25
|
-
- value: createGregorovichActions
|
|
26
|
-
- value: createItemActions
|
|
27
|
-
- function: createJoomlaActions
|
|
28
|
-
- value: createLegacyActions
|
|
29
|
-
- value: createLogisticsActions
|
|
30
|
-
- value: createNexusActions
|
|
31
|
-
- value: createOrderActions
|
|
32
|
-
- value: createP21ApisActions
|
|
33
|
-
- value: createP21CoreActions
|
|
34
|
-
- value: createP21PimActions
|
|
35
|
-
- value: createP21SismActions
|
|
36
|
-
- value: createPaymentsActions
|
|
37
|
-
- value: createPricingActions
|
|
38
38
|
- value: createQueryOptions
|
|
39
|
-
- value: createSearchActions
|
|
40
39
|
- function: createServerQueryClient - Creates a server-side query client optimised for prefetching.
|
|
41
|
-
-
|
|
42
|
-
- value: createSiteActions
|
|
43
|
-
- value: createSlackActions
|
|
44
|
-
- value: createSmartyStreetsActions
|
|
40
|
+
- function: createSiteActions
|
|
45
41
|
- value: createSuspenseQueryOptions
|
|
46
|
-
- value: createUpsActions
|
|
47
|
-
- value: createVmiActions
|
|
48
|
-
- function: createWishlistActions
|
|
49
42
|
- const: env - Resolved environment: `"development"`, `"staging"`, or `"production"`.
|
|
50
43
|
- function: getCircuitState - Returns the current circuit breaker state.
|
|
51
44
|
- const: getServerQueryClient - Returns a per-request singleton QueryClient for React Server Components.
|
|
@@ -54,7 +47,7 @@ Version: 2.0.21
|
|
|
54
47
|
- const: isProduction - `true` when running on the production deployment.
|
|
55
48
|
- function: isRedisConnected - Whether the Redis client is connected and ready to accept commands.
|
|
56
49
|
- const: isStaging - `true` when running on the staging/dev deployment.
|
|
57
|
-
-
|
|
50
|
+
- function: paginateOffset
|
|
58
51
|
- function: registerSiteActions
|
|
59
52
|
- function: safeAction - Wraps an async function call with error handling, returning a
|
|
60
53
|
- function: sdkCall - Calls an Augur SDK method, forwarding all arguments with full type safety.
|
|
@@ -62,101 +55,33 @@ Version: 2.0.21
|
|
|
62
55
|
- value: unwrapOr
|
|
63
56
|
- function: verifyRecaptcha - Server-side Google reCAPTCHA v3 verification.
|
|
64
57
|
- function: withServerCache - Server-side cache wrapper using augur-server's Redis client.
|
|
65
|
-
- type: AddressValidationResult
|
|
66
|
-
- type: AgrInfoActions
|
|
67
|
-
- type: AgrInfoActionsConfig
|
|
68
|
-
- type: AgrInfoApiClient
|
|
69
|
-
- type: AgrSiteActions
|
|
70
|
-
- type: AgrSiteActionsConfig
|
|
71
|
-
- type: AgrSiteApiClient
|
|
72
|
-
- type: AgrWorkActions
|
|
73
|
-
- type: AgrWorkActionsConfig
|
|
74
|
-
- type: AgrWorkApiClient
|
|
75
|
-
- type: AvalaraActions
|
|
76
|
-
- type: AvalaraActionsConfig
|
|
77
|
-
- type: AvalaraApiClient
|
|
78
|
-
- type: Basecamp2Actions
|
|
79
|
-
- type: Basecamp2ActionsConfig
|
|
80
|
-
- type: Basecamp2ApiClient
|
|
81
|
-
- type: BrandFolderActions
|
|
82
|
-
- type: BrandFolderActionsConfig
|
|
83
|
-
- type: BrandFolderApiClient
|
|
84
|
-
- type: CommerceActions
|
|
85
|
-
- type: CommerceActionsConfig
|
|
86
|
-
- type: CommerceApiClient
|
|
87
|
-
- type: CustomerListResult
|
|
88
|
-
- type: CustomersActions
|
|
89
|
-
- type: CustomersActionsConfig
|
|
90
|
-
- type: CustomersApiClient
|
|
91
|
-
- type: FavoritesActions
|
|
92
|
-
- type: FavoritesActionsConfig
|
|
93
|
-
- type: FavoritesApiClient
|
|
94
|
-
- type: GetItemCategoryOptions
|
|
95
|
-
- type: GregorovichActions
|
|
96
|
-
- type: GregorovichActionsConfig
|
|
97
|
-
- type: GregorovichApiClient
|
|
98
|
-
- type: ItemActions
|
|
99
|
-
- type: ItemActionsConfig
|
|
100
|
-
- type: ItemsApiClient
|
|
101
|
-
- type: JoomlaActions
|
|
102
|
-
- type: JoomlaActionsConfig
|
|
103
|
-
- type: JoomlaApiClient
|
|
104
|
-
- type: LegacyActions
|
|
105
|
-
- type: LegacyActionsConfig
|
|
106
|
-
- type: LegacyApiClient
|
|
107
|
-
- type: LogisticsActions
|
|
108
|
-
- type: LogisticsActionsConfig
|
|
109
|
-
- type: LogisticsApiClient
|
|
110
|
-
- type: NexusActions
|
|
111
|
-
- type: NexusActionsConfig
|
|
112
|
-
- type: NexusApiClient
|
|
113
|
-
- type: NormalizedUserProfile
|
|
114
|
-
- type: OrderActions
|
|
115
|
-
- type: OrderActionsConfig
|
|
116
|
-
- type: OrderApiClient
|
|
117
|
-
- type: P21ApisActions
|
|
118
|
-
- type: P21ApisActionsConfig
|
|
119
|
-
- type: P21ApisApiClient
|
|
120
|
-
- type: P21CoreActions
|
|
121
|
-
- type: P21CoreActionsConfig
|
|
122
|
-
- type: P21CoreApiClient
|
|
123
|
-
- type: P21PimActions
|
|
124
|
-
- type: P21PimActionsConfig
|
|
125
|
-
- type: P21PimApiClient
|
|
126
|
-
- type: P21SismActions
|
|
127
|
-
- type: P21SismActionsConfig
|
|
128
|
-
- type: P21SismApiClient
|
|
129
58
|
- type: PaginatedResult
|
|
130
|
-
- type: PaymentsActions
|
|
131
|
-
- type: PaymentsApiClient
|
|
132
|
-
- type: PricingActions
|
|
133
|
-
- type: PricingActionsConfig
|
|
134
|
-
- type: PricingApiClient
|
|
135
|
-
- type: SearchActions
|
|
136
|
-
- type: SearchActionsConfig
|
|
137
|
-
- type: SearchApiClient
|
|
138
|
-
- type: SearchPage
|
|
139
|
-
- type: ShippingActions
|
|
140
|
-
- type: ShippingActionsConfig
|
|
141
|
-
- type: ShippingAddress
|
|
142
|
-
- type: ShippingApiClient
|
|
143
59
|
- type: SiteActions
|
|
144
60
|
- type: SiteActionsConfig
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
61
|
+
|
|
62
|
+
### Examples
|
|
63
|
+
|
|
64
|
+
safeAction:
|
|
65
|
+
```ts
|
|
66
|
+
const result = await safeAction(
|
|
67
|
+
() => actions.commerce.addToCart(cartId, items),
|
|
68
|
+
);
|
|
69
|
+
if (result.ok) {
|
|
70
|
+
// result.data is the response data (undefined for void actions)
|
|
71
|
+
} else {
|
|
72
|
+
// result.error is the error message
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
sdkCall:
|
|
77
|
+
```ts
|
|
78
|
+
const result = await sdkCall(
|
|
79
|
+
augurServices.items.invMast.get,
|
|
80
|
+
invMastUid,
|
|
81
|
+
{ edgeCache: 4 },
|
|
82
|
+
);
|
|
83
|
+
```
|
|
84
|
+
|
|
160
85
|
|
|
161
86
|
## @simpleapps-com/augur-server/auth
|
|
162
87
|
|
|
@@ -185,6 +110,25 @@ Version: 2.0.21
|
|
|
185
110
|
- type: MockSiteActions
|
|
186
111
|
- type: MockSiteActionsResult
|
|
187
112
|
|
|
113
|
+
### Examples
|
|
114
|
+
|
|
115
|
+
createMockSiteActions:
|
|
116
|
+
```ts
|
|
117
|
+
import { createMockSiteActions } from "@simpleapps-com/augur-server/testing";
|
|
118
|
+
|
|
119
|
+
const { actions, mocks } = createMockSiteActions();
|
|
120
|
+
|
|
121
|
+
// Setup return values
|
|
122
|
+
mocks.pricing.getItemPrice.mockResolvedValue({ price: 9.99 });
|
|
123
|
+
|
|
124
|
+
// Pass actions to your component/server action
|
|
125
|
+
const price = await actions.pricing.getItemPrice("ITEM-1");
|
|
126
|
+
|
|
127
|
+
// Assert calls
|
|
128
|
+
expect(mocks.pricing.getItemPrice.mock.calls[0]).toEqual(["ITEM-1"]);
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
|
|
188
132
|
## @simpleapps-com/augur-server/site
|
|
189
133
|
|
|
190
134
|
- function: createServerSite - Create a server-side site instance that bundles the SDK client, server
|
|
@@ -192,13 +136,30 @@ Version: 2.0.21
|
|
|
192
136
|
- type: ServerSiteAuthConfig
|
|
193
137
|
- type: ServerSiteConfig
|
|
194
138
|
|
|
139
|
+
### Examples
|
|
140
|
+
|
|
141
|
+
createServerSite:
|
|
142
|
+
```ts
|
|
143
|
+
import { AugurApi } from "@simpleapps-com/augur-api";
|
|
144
|
+
import { createServerSite } from "@simpleapps-com/augur-server";
|
|
145
|
+
|
|
146
|
+
const api = new AugurApi({ baseUrl: process.env.AUGUR_API_URL! });
|
|
147
|
+
export const site = createServerSite(api, {
|
|
148
|
+
defaultCustomerId: "12345",
|
|
149
|
+
auth: { secret: process.env.AUTH_SECRET },
|
|
150
|
+
});
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
|
|
195
154
|
## @simpleapps-com/augur-server/actions
|
|
196
155
|
|
|
197
156
|
- value: ApiResult
|
|
198
157
|
- value: ListResult
|
|
199
158
|
- value: SafeActionResult
|
|
200
159
|
- function: accountQuery
|
|
160
|
+
- function: addFavorite
|
|
201
161
|
- function: addToCart
|
|
162
|
+
- function: addWishlistItems
|
|
202
163
|
- function: askChatGpt
|
|
203
164
|
- function: batchGetInvMastDocs
|
|
204
165
|
- function: batchGetItemPrices
|
|
@@ -213,8 +174,10 @@ Version: 2.0.21
|
|
|
213
174
|
- function: createFocus
|
|
214
175
|
- function: createReceiving
|
|
215
176
|
- function: createTransfer
|
|
177
|
+
- function: createWishlist
|
|
216
178
|
- function: customerLookup
|
|
217
179
|
- function: deleteCartItems
|
|
180
|
+
- function: deleteWishlist
|
|
218
181
|
- function: generateAkasha
|
|
219
182
|
- function: generateJoomla
|
|
220
183
|
- function: generateOllama
|
|
@@ -245,6 +208,7 @@ Version: 2.0.21
|
|
|
245
208
|
- function: getDistributors
|
|
246
209
|
- function: getDocuments
|
|
247
210
|
- function: getEvents
|
|
211
|
+
- function: getFavorites
|
|
248
212
|
- function: getFreightRates
|
|
249
213
|
- function: getImport
|
|
250
214
|
- function: getImportLines
|
|
@@ -307,14 +271,19 @@ Version: 2.0.21
|
|
|
307
271
|
- function: getWebDisplayTypeDefaults
|
|
308
272
|
- function: getWebDisplayTypes
|
|
309
273
|
- function: getWebhooks
|
|
274
|
+
- function: getWishlistDetail
|
|
275
|
+
- function: getWishlists
|
|
310
276
|
- function: healthCheck
|
|
311
277
|
- function: itemCategoryLookup
|
|
312
278
|
- function: itemSearch
|
|
313
279
|
- function: itemSearchInfinite
|
|
314
280
|
- function: listInvMastExt
|
|
315
281
|
- function: ping
|
|
282
|
+
- value: queryAction
|
|
316
283
|
- function: refreshContacts
|
|
317
284
|
- function: refreshCustomers
|
|
285
|
+
- function: removeFavorite
|
|
286
|
+
- function: removeWishlistItem
|
|
318
287
|
- function: sendWebhook
|
|
319
288
|
- function: transactionSetup
|
|
320
289
|
- function: updateCartLines
|
|
@@ -322,5 +291,39 @@ Version: 2.0.21
|
|
|
322
291
|
- function: validatePayment
|
|
323
292
|
- function: verifyPassword
|
|
324
293
|
|
|
294
|
+
## @simpleapps-com/augur-server/hooks
|
|
295
|
+
|
|
296
|
+
- value: QueryActionFn
|
|
297
|
+
- function: createServerQueryProxy - Creates a client-side proxy that mirrors the SDK namespace and routes
|
|
298
|
+
|
|
299
|
+
### Examples
|
|
300
|
+
|
|
301
|
+
createServerQueryProxy:
|
|
302
|
+
```tsx
|
|
303
|
+
import { createServerQueryProxy } from "@simpleapps-com/augur-server/hooks";
|
|
304
|
+
|
|
305
|
+
const q = createServerQueryProxy();
|
|
306
|
+
|
|
307
|
+
// Reads — any SDK method, routed through server actions
|
|
308
|
+
const { data: item } = useQuery(q.items.invMast.doc.get(42));
|
|
309
|
+
const { data: price } = useQuery(q.pricing.priceEngine.get({ itemId, customerId }));
|
|
310
|
+
|
|
311
|
+
// Infinite queries — spread and add infinite-specific options
|
|
312
|
+
const { data, fetchNextPage } = useInfiniteQuery({
|
|
313
|
+
...q.items.itemCategory.categoryItems.get(uid, filters),
|
|
314
|
+
getNextPageParam: (lastPage) => lastPage.nextCursor,
|
|
315
|
+
initialPageParam: 0,
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
// Mutations — write methods return mutation options
|
|
319
|
+
const addToCart = useMutation(q.commerce.cartLine.add.create());
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
## @simpleapps-com/augur-server/query-action
|
|
324
|
+
|
|
325
|
+
- function: queryAction - Generic server action that routes any SDK method call through the raw
|
|
326
|
+
- function: unwrapBaseResponse - Unwrap SDK BaseResponse if the result matches the standard shape.
|
|
327
|
+
|
|
325
328
|
## @simpleapps-com/augur-server/next-auth
|
|
326
329
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpleapps-com/augur-server",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.11",
|
|
4
4
|
"description": "Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"llms.txt"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@simpleapps-com/augur-core": "2.2.
|
|
58
|
-
"@simpleapps-com/augur-hooks": "2.2.
|
|
59
|
-
"@simpleapps-com/augur-utils": "2.2.
|
|
57
|
+
"@simpleapps-com/augur-core": "2.2.11",
|
|
58
|
+
"@simpleapps-com/augur-hooks": "2.2.11",
|
|
59
|
+
"@simpleapps-com/augur-utils": "2.2.11"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@simpleapps-com/augur-api": "^2026.3.5",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"tsup": "^8.5.0",
|
|
85
85
|
"vitest": "^3.2.0",
|
|
86
86
|
"@augur-packages/tsconfig": "0.0.0",
|
|
87
|
-
"@simpleapps-com/augur-hooks": "2.2.
|
|
87
|
+
"@simpleapps-com/augur-hooks": "2.2.11"
|
|
88
88
|
},
|
|
89
89
|
"scripts": {
|
|
90
90
|
"build": "tsup",
|