@simpleapps-com/augur-server 2.2.28 → 2.3.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @simpleapps-com/augur-server exports
2
2
 
3
- Version: 2.2.10
3
+ Version: 2.2.29
4
4
 
5
5
  > Auto-generated from built type declarations. Do not edit manually.
6
6
  > Regenerate with: `pnpm run generate-exports`
@@ -53,7 +53,7 @@ import { ActionResult, EdgeCacheValue, QueryOptionsConfig } from "@simpleapps-co
53
53
 
54
54
  | Export | Kind | Description |
55
55
  |--------|------|-------------|
56
- | `createAuthConfig` | function | |
56
+ | `createAuthConfig` | function | Creates a NextAuth configuration with Joomla credential provider, session callbacks, and automatic cart initialization. |
57
57
 
58
58
  ### Types
59
59
 
@@ -125,140 +125,6 @@ import { createServerSite } from "@simpleapps-com/augur-server/site";
125
125
  | `ApiResult` | value | |
126
126
  | `ListResult` | value | |
127
127
  | `SafeActionResult` | value | |
128
- | `accountQuery` | function | |
129
- | `addFavorite` | function | |
130
- | `addToCart` | function | |
131
- | `addWishlistItems` | function | |
132
- | `askChatGpt` | function | |
133
- | `batchGetInvMastDocs` | function | |
134
- | `batchGetItemPrices` | function | |
135
- | `batchGetStockData` | function | |
136
- | `billingUpdate` | function | |
137
- | `calculateTax` | function | |
138
- | `cardInfo` | function | |
139
- | `cartHdrLookup` | function | |
140
- | `checkoutOrder` | function | |
141
- | `createBinTransfer` | function | |
142
- | `createDocument` | function | |
143
- | `createFocus` | function | |
144
- | `createReceiving` | function | |
145
- | `createTransfer` | function | |
146
- | `createWishlist` | function | |
147
- | `customerLookup` | function | |
148
- | `deleteCartItems` | function | |
149
- | `deleteWishlist` | function | |
150
- | `generateAkasha` | function | |
151
- | `generateJoomla` | function | |
152
- | `generateOllama` | function | |
153
- | `getAddresses` | function | |
154
- | `getAlsoBoughtItems` | function | |
155
- | `getBrandFolderCategories` | function | |
156
- | `getCartAlsoBought` | function | |
157
- | `getCartLines` | function | |
158
- | `getCashDrawers` | function | |
159
- | `getCategory` | function | |
160
- | `getCategoryDefaults` | function | |
161
- | `getCategoryItems` | function | |
162
- | `getCategoryItemsInfinite` | function | |
163
- | `getCodeP21` | function | |
164
- | `getComments` | function | |
165
- | `getCompanies` | function | |
166
- | `getCompany` | function | |
167
- | `getContacts` | function | |
168
- | `getContext` | function | |
169
- | `getCustomer` | function | |
170
- | `getCustomerDoc` | function | |
171
- | `getCustomerInvoiceDetail` | function | |
172
- | `getCustomerInvoices` | function | |
173
- | `getCustomerOrderDetail` | function | |
174
- | `getCustomerOrders` | function | |
175
- | `getCustomerQuoteDetail` | function | |
176
- | `getCustomerQuotes` | function | |
177
- | `getDistributors` | function | |
178
- | `getDocuments` | function | |
179
- | `getEvents` | function | |
180
- | `getFavorites` | function | |
181
- | `getFreightRates` | function | |
182
- | `getImport` | function | |
183
- | `getImportLines` | function | |
184
- | `getInvMast` | function | |
185
- | `getInvMastDoc` | function | |
186
- | `getInvMastExt` | function | |
187
- | `getInventoryProfiles` | function | |
188
- | `getItemAccessories` | function | |
189
- | `getItemAttributes` | function | |
190
- | `getItemCategory` | function | |
191
- | `getItemFaqs` | function | |
192
- | `getItemPrice` | function | |
193
- | `getItemSubstitutes` | function | |
194
- | `getItemTags` | function | |
195
- | `getItemWebDesc` | function | |
196
- | `getJoomlaContent` | function | |
197
- | `getJoomlaContentList` | function | |
198
- | `getJoomlaMenu` | function | |
199
- | `getJoomlaMenuDoc` | function | |
200
- | `getLocations` | function | |
201
- | `getMetaFiles` | function | |
202
- | `getMetrics` | function | |
203
- | `getMicroservices` | function | |
204
- | `getOrderDoc` | function | |
205
- | `getP21Categories` | function | |
206
- | `getP21Companies` | function | |
207
- | `getPaymentTypes` | function | |
208
- | `getPeople` | function | |
209
- | `getProducts` | function | |
210
- | `getProjects` | function | |
211
- | `getPurchaseOrderReceipts` | function | |
212
- | `getRates` | function | |
213
- | `getRecentImports` | function | |
214
- | `getRestockHeaders` | function | |
215
- | `getRubrics` | function | |
216
- | `getScheduledImports` | function | |
217
- | `getSearchAttributes` | function | |
218
- | `getSearchSuggestions` | function | |
219
- | `getSections` | function | |
220
- | `getSettings` | function | |
221
- | `getShipToAddresses` | function | |
222
- | `getShipVia` | function | |
223
- | `getShippingRates` | function | |
224
- | `getSimilarItems` | function | |
225
- | `getStates` | function | |
226
- | `getStock` | function | |
227
- | `getStockCompanySummary` | function | |
228
- | `getSurcharge` | function | |
229
- | `getTaxEstimate` | function | |
230
- | `getTodo` | function | |
231
- | `getTodolists` | function | |
232
- | `getTodos` | function | |
233
- | `getTodosSummary` | function | |
234
- | `getTransferReceipts` | function | |
235
- | `getTransferShipping` | function | |
236
- | `getUserProfile` | function | |
237
- | `getUsers` | function | |
238
- | `getWarehouseAvailability` | function | |
239
- | `getWarehouses` | function | |
240
- | `getWebDisplayTypeDefaults` | function | |
241
- | `getWebDisplayTypes` | function | |
242
- | `getWebhooks` | function | |
243
- | `getWishlistDetail` | function | |
244
- | `getWishlists` | function | |
245
- | `healthCheck` | function | |
246
- | `itemCategoryLookup` | function | |
247
- | `itemSearch` | function | |
248
- | `itemSearchInfinite` | function | |
249
- | `listInvMastExt` | function | |
250
- | `ping` | function | |
251
- | `queryAction` | value | |
252
- | `refreshContacts` | function | |
253
- | `refreshCustomers` | function | |
254
- | `removeFavorite` | function | |
255
- | `removeWishlistItem` | function | |
256
- | `sendWebhook` | function | |
257
- | `transactionSetup` | function | |
258
- | `updateCartLines` | function | |
259
- | `validateAddress` | function | |
260
- | `validatePayment` | function | |
261
- | `verifyPassword` | function | |
262
128
 
263
129
  ```ts
264
130
  import { ApiResult, ListResult, SafeActionResult } from "@simpleapps-com/augur-server/actions";
@@ -283,11 +149,26 @@ import { QueryActionFn, createServerQueryProxy } from "@simpleapps-com/augur-ser
283
149
 
284
150
  | Export | Kind | Description |
285
151
  |--------|------|-------------|
152
+ | `getSessionCredentials` | function | Resolve session credentials from the Auth.js JWT cookie. |
286
153
  | `queryAction` | function | Generic server action that routes any SDK method call through the raw |
154
+ | `resetSessionImports` | function | Reset lazy-loaded imports. Used in tests only. @internal |
155
+ | `resolveMethod` | function | Resolve a dot-separated method path on an object, returning the leaf function. |
287
156
  | `unwrapBaseResponse` | function | Unwrap SDK BaseResponse if the result matches the standard shape. |
288
157
 
289
158
  ```ts
290
- import { queryAction, unwrapBaseResponse } from "@simpleapps-com/augur-server/query-action";
159
+ import { getSessionCredentials, queryAction, resetSessionImports } from "@simpleapps-com/augur-server/query-action";
160
+ ```
161
+
162
+ ## `@simpleapps-com/augur-server/api`
163
+
164
+ ### Values
165
+
166
+ | Export | Kind | Description |
167
+ |--------|------|-------------|
168
+ | `createAugurApiHandler` | function | Creates a Next.js Route Handler that routes method calls through queryAction. |
169
+
170
+ ```ts
171
+ import { createAugurApiHandler } from "@simpleapps-com/augur-server/api";
291
172
  ```
292
173
 
293
174
  ## `@simpleapps-com/augur-server/next-auth`
package/README.md CHANGED
@@ -25,9 +25,10 @@ pnpm add @simpleapps-com/augur-server
25
25
  | `@simpleapps-com/augur-server/query` | 2 exports, 1 types |
26
26
  | `@simpleapps-com/augur-server/testing` | 5 exports, 3 types |
27
27
  | `@simpleapps-com/augur-server/site` | 1 exports, 3 types |
28
- | `@simpleapps-com/augur-server/actions` | 137 exports, 0 types |
28
+ | `@simpleapps-com/augur-server/actions` | 3 exports, 0 types |
29
29
  | `@simpleapps-com/augur-server/hooks` | 2 exports, 0 types |
30
- | `@simpleapps-com/augur-server/query-action` | 2 exports, 0 types |
30
+ | `@simpleapps-com/augur-server/query-action` | 5 exports, 0 types |
31
+ | `@simpleapps-com/augur-server/api` | 1 exports, 0 types |
31
32
  | `@simpleapps-com/augur-server/next-auth` | 0 exports, 0 types |
32
33
 
33
34
  ## Exports
@@ -42,107 +43,20 @@ pnpm add @simpleapps-com/augur-server
42
43
  | `createSuspenseQueryOptions` | value | |
43
44
  | `getSiteActions` | function | |
44
45
  | `registerSiteActions` | function | |
45
- | `createAuthConfig` | function | |
46
+ | `createAuthConfig` | function | Creates a NextAuth configuration with Joomla credential provider, session callbacks, and automatic cart initialization. |
46
47
  | `createQueryOptions` | const | Creates useQuery options with consistent key generation. |
47
48
  | `createSuspenseQueryOptions` | const | Creates useSuspenseQuery options with consistent key generation. |
48
49
  | `clearSiteActions` | function | |
49
50
  | `createMockSiteActions` | function | Creates a fully-mocked SiteActions object for testing. |
50
51
  | `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 | |
52
+ | `getSessionCredentials` | function | Resolve session credentials from the Auth.js JWT cookie. |
53
+ | `resetSessionImports` | function | Reset lazy-loaded imports. Used in tests only. @internal |
62
54
 
63
55
  ### Items & Categories
64
56
 
65
57
  | Export | Kind | Description |
66
58
  |--------|------|-------------|
67
59
  | `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
60
 
147
61
  ### Transforms
148
62
 
@@ -185,89 +99,11 @@ pnpm add @simpleapps-com/augur-server
185
99
  | `ApiResult` | value | |
186
100
  | `ListResult` | value | |
187
101
  | `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
102
  | `QueryActionFn` | value | |
269
103
  | `createServerQueryProxy` | function | Creates a client-side proxy that mirrors the SDK namespace and routes |
270
104
  | `queryAction` | function | Generic server action that routes any SDK method call through the raw |
105
+ | `resolveMethod` | function | Resolve a dot-separated method path on an object, returning the leaf function. |
106
+ | `createAugurApiHandler` | function | Creates a Next.js Route Handler that routes method calls through queryAction. |
271
107
 
272
108
  ## Examples
273
109
 
@@ -346,6 +182,16 @@ const { data, fetchNextPage } = useInfiniteQuery({
346
182
  const addToCart = useMutation(q.commerce.cartLine.add.create());
347
183
  ```
348
184
 
185
+ ### createAugurApiHandler
186
+
187
+ ```ts
188
+ // app/api/augur/route.ts
189
+ import { createAugurApiHandler } from "@simpleapps-com/augur-server/api";
190
+
191
+ const handler = createAugurApiHandler();
192
+ export const POST = handler;
193
+ ```
194
+
349
195
  ## Types
350
196
 
351
197
  `PaginatedResult`, `SiteActions`, `SiteActionsConfig`, `AugurAuthCallbacks`, `AugurAuthClient`, `AugurJWT`, `AugurSession`, `AugurUser`, `CreateAuthConfigOptions`, `QueryOptionsConfig`, `MockFn`, `MockSiteActions`, `MockSiteActionsResult`, `ServerSite`, `ServerSiteAuthConfig`, `ServerSiteConfig`