@simpleapps-com/augur-server 1.0.14 → 1.0.16
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/dist/actions.d.ts +172 -0
- package/dist/actions.js +13 -24
- package/dist/actions.js.map +1 -1
- package/dist/{chunk-IQXQRE7L.js → chunk-5D5JCAKO.js} +9 -2
- package/dist/chunk-5D5JCAKO.js.map +1 -0
- package/dist/chunk-ZBS5CNBC.js +20 -0
- package/dist/chunk-ZBS5CNBC.js.map +1 -0
- package/dist/index.d.ts +5 -58
- package/dist/index.js +5 -16
- package/dist/index.js.map +1 -1
- package/dist/sdk-call-BgnoWAZK.d.ts +56 -0
- package/dist/{server-site-registry-DijpkF-_.d.ts → server-site-registry-BZvxwcGM.d.ts} +1 -1
- package/dist/{site-BBtab6v0.d.ts → site-BKPGMqQx.d.ts} +3 -269
- package/dist/site.d.ts +2 -1
- package/dist/site.js +1 -1
- package/dist/smarty-streets-BS4ifhxQ.d.ts +273 -0
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +2 -1
- package/dist/testing.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-IQXQRE7L.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -44,30 +44,19 @@ import {
|
|
|
44
44
|
isRedisConnected,
|
|
45
45
|
isStaging,
|
|
46
46
|
withServerCache
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-5D5JCAKO.js";
|
|
48
48
|
import {
|
|
49
49
|
batchFetch
|
|
50
50
|
} from "./chunk-XGRQ53P2.js";
|
|
51
|
+
import {
|
|
52
|
+
safeAction,
|
|
53
|
+
sdkCall
|
|
54
|
+
} from "./chunk-ZBS5CNBC.js";
|
|
51
55
|
import {
|
|
52
56
|
getSiteActions,
|
|
53
57
|
registerSiteActions
|
|
54
58
|
} from "./chunk-MQGUOFAZ.js";
|
|
55
59
|
|
|
56
|
-
// src/sdk-call.ts
|
|
57
|
-
async function sdkCall(method, ...args) {
|
|
58
|
-
return method(...args);
|
|
59
|
-
}
|
|
60
|
-
async function safeAction(fn, onError) {
|
|
61
|
-
try {
|
|
62
|
-
const data = await fn();
|
|
63
|
-
return { ok: true, data: data ?? true };
|
|
64
|
-
} catch (e) {
|
|
65
|
-
const error = e instanceof Error ? e : new Error(String(e));
|
|
66
|
-
if (onError) onError(error);
|
|
67
|
-
return { ok: false, error: error.message };
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
60
|
// src/pagination.ts
|
|
72
61
|
function paginateOffset(items, pageParam, limit, total) {
|
|
73
62
|
const hasMore = total !== void 0 ? (pageParam + 1) * limit < total : items.length === limit;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sdk-call.ts","../src/pagination.ts","../src/actions/wishlists.ts","../src/actions/favorites.ts"],"sourcesContent":["// Re-export EdgeCacheValue and ActionResult from augur-core (single source of truth)\nexport type { EdgeCacheValue, ActionResult } from \"@simpleapps-com/augur-core\";\n\n/**\n * Calls an Augur SDK method, forwarding all arguments with full type safety.\n *\n * With augur-api >= 0.9.6, SDK methods properly declare their `CacheParams`\n * option (including `edgeCache`), so this wrapper preserves both parameter\n * and return-type inference end-to-end.\n *\n * @example\n * ```ts\n * const result = await sdkCall(\n * augurServices.items.invMast.get,\n * invMastUid,\n * { edgeCache: 4 },\n * );\n * ```\n */\nexport async function sdkCall<TArgs extends unknown[], TResult>(\n method: (...args: TArgs) => Promise<TResult>,\n ...args: TArgs\n): Promise<TResult> {\n return method(...args);\n}\n\n/** Maps void-returning actions to `true` so `data` is never `undefined` on success. */\nexport type SafeData<T> = T extends void ? true : T;\n\n/** Result type for `safeAction` — void-returning actions get `data: true`. */\nexport type SafeActionResult<T> =\n | { ok: true; data: SafeData<T> }\n | { ok: false; error: string };\n\n/**\n * Wraps an async function call with error handling, returning a\n * `SafeActionResult<T>` instead of throwing.\n *\n * Use this to eliminate try/catch boilerplate in server actions.\n * Reads that go through React Query should NOT use this — let errors\n * propagate so React Query can handle retries and error state.\n *\n * When the wrapped function returns `void`, `data` is set to `true`\n * so that `result.data` is never `undefined` on a successful call.\n *\n * @param fn — The async function to execute\n * @param onError — Optional callback for logging/reporting\n *\n * @example\n * ```ts\n * const result = await safeAction(\n * () => actions.commerce.addToCart(cartId, items),\n * );\n * if (result.ok) {\n * // result.data is `true` for void actions, or the response data\n * } else {\n * // result.error is the error message\n * }\n * ```\n */\nexport async function safeAction<T>(\n fn: () => Promise<T>,\n onError?: (error: Error) => void,\n): Promise<SafeActionResult<T>> {\n try {\n const data = await fn();\n return { ok: true, data: (data ?? true) as SafeData<T> };\n } catch (e) {\n const error = e instanceof Error ? e : new Error(String(e));\n if (onError) onError(error);\n return { ok: false, error: error.message };\n }\n}\n","/**\n * Standardized paginated response shape.\n * Works with any factory method — compose with `paginateOffset()`.\n */\nexport interface PaginatedResult<T> {\n data: T[];\n total?: number;\n nextCursor?: number;\n hasMore: boolean;\n}\n\n/**\n * Wraps a list of items with offset-based pagination metadata.\n *\n * Use this to standardize pagination responses from any factory method.\n * Compatible with React Query's infinite query pattern (`getNextPageParam`).\n *\n * @param items - The items returned from the current page\n * @param pageParam - The current page number (0-based)\n * @param limit - The page size\n * @param total - Optional total count of items (from API response)\n *\n * @example\n * ```ts\n * const result = await actions.items.getCategoryItems(uid, {\n * ...filters, offset: page * 24, limit: 24,\n * });\n * return paginateOffset(result.items, page, 24, result.total);\n * // { data: [...], total: 150, nextCursor: 1, hasMore: true }\n * ```\n */\nexport function paginateOffset<T>(\n items: T[],\n pageParam: number,\n limit: number,\n total?: number,\n): PaginatedResult<T> {\n const hasMore =\n total !== undefined\n ? (pageParam + 1) * limit < total\n : items.length === limit;\n\n return {\n data: items,\n total,\n nextCursor: hasMore ? pageParam + 1 : undefined,\n hasMore,\n };\n}\n","import type { AugurAPI } from \"@simpleapps-com/augur-api\";\nimport type { EdgeCacheValue } from \"../sdk-call\";\nimport { withServerCache } from \"../cache/with-cache\";\n\n/** Derived from augur-api SDK — keeps types in sync automatically. */\nexport type WishlistsApiClient = Pick<AugurAPI, \"items\">;\n\nexport interface WishlistActionsConfig {\n /** Cache key prefix (e.g. \"ampro:\"). Default: \"\". */\n cachePrefix?: string;\n /** CDN edge cache value passed to SDK. Default: 1 (hour). */\n edgeCache?: EdgeCacheValue;\n /** Redis TTL in seconds. Default: 3600 (1 hour). */\n redisTtl?: number;\n}\n\nexport interface WishlistActions {\n getWishlists: (userId: number) => Promise<unknown[]>;\n createWishlist: (\n userId: number,\n data: { name: string; description?: string },\n ) => Promise<unknown>;\n getWishlistDetail: (\n userId: number,\n wishlistId: number,\n ) => Promise<unknown>;\n deleteWishlist: (userId: number, wishlistId: number) => Promise<void>;\n addWishlistItems: (\n userId: number,\n wishlistId: number,\n items: { invMastUid: number }[],\n ) => Promise<unknown>;\n removeWishlistItem: (\n userId: number,\n wishlistId: number,\n lineId: number,\n ) => Promise<void>;\n}\n\n/** @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version. */\nexport function createWishlistActions(\n api: WishlistsApiClient,\n config: WishlistActionsConfig = {},\n): WishlistActions {\n const { cachePrefix = \"\", edgeCache = 1, redisTtl = 3600 } = config;\n\n async function getWishlists(userId: number): Promise<unknown[]> {\n return withServerCache(\n cachePrefix,\n redisTtl,\n \"items.itemWishlist.list\",\n async () => {\n const response = await api.items.itemWishlist.list(userId, {\n edgeCache,\n });\n return response.data;\n },\n userId,\n );\n }\n\n async function createWishlist(\n userId: number,\n data: { name: string; description?: string },\n ): Promise<unknown> {\n const response = await api.items.itemWishlist.create(userId, data);\n return response.data;\n }\n\n async function getWishlistDetail(\n userId: number,\n wishlistId: number,\n ): Promise<unknown> {\n return withServerCache(\n cachePrefix,\n redisTtl,\n \"items.itemWishlist.hdr.get\",\n async () => {\n const response = await api.items.itemWishlist.hdr.get(\n userId,\n wishlistId,\n { edgeCache },\n );\n return response.data;\n },\n userId,\n wishlistId,\n );\n }\n\n async function deleteWishlist(\n userId: number,\n wishlistId: number,\n ): Promise<void> {\n await api.items.itemWishlist.hdr.delete(userId, wishlistId);\n }\n\n async function addWishlistItems(\n userId: number,\n wishlistId: number,\n items: { invMastUid: number }[],\n ): Promise<unknown> {\n const response = await api.items.itemWishlist.hdr.create(\n userId,\n wishlistId,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n items as any,\n );\n return response.data;\n }\n\n async function removeWishlistItem(\n userId: number,\n wishlistId: number,\n lineId: number,\n ): Promise<void> {\n await api.items.itemWishlist.hdr.line.delete(userId, wishlistId, lineId);\n }\n\n return {\n getWishlists,\n createWishlist,\n getWishlistDetail,\n deleteWishlist,\n addWishlistItems,\n removeWishlistItem,\n };\n}\n","import type { AugurAPI } from \"@simpleapps-com/augur-api\";\nimport type { EdgeCacheValue } from \"../sdk-call\";\nimport { withServerCache } from \"../cache/with-cache\";\n\n/** Derived from augur-api SDK — keeps types in sync automatically. */\nexport type FavoritesApiClient = Pick<AugurAPI, \"items\">;\n\nexport interface FavoritesActionsConfig {\n /** Cache key prefix (e.g. \"ampro:\"). Default: \"\". */\n cachePrefix?: string;\n /** CDN edge cache value passed to SDK. Default: 1 (hour). */\n edgeCache?: EdgeCacheValue;\n /** Redis TTL in seconds. Default: 3600 (1 hour). */\n redisTtl?: number;\n}\n\nexport interface FavoritesActions {\n getFavorites: (userId: number) => Promise<unknown[]>;\n addFavorite: (userId: number, invMastUid: number) => Promise<unknown>;\n removeFavorite: (userId: number, invMastUid: number) => Promise<void>;\n}\n\n/** @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version. */\nexport function createFavoritesActions(\n api: FavoritesApiClient,\n config: FavoritesActionsConfig = {},\n): FavoritesActions {\n const { cachePrefix = \"\", edgeCache = 1, redisTtl = 3600 } = config;\n\n async function getFavorites(userId: number): Promise<unknown[]> {\n return withServerCache(\n cachePrefix,\n redisTtl,\n \"items.itemFavorites.list\",\n async () => {\n const response = await api.items.itemFavorites.list(userId, {\n edgeCache,\n });\n return response.data;\n },\n userId,\n );\n }\n\n async function addFavorite(\n userId: number,\n invMastUid: number,\n ): Promise<unknown> {\n const response = await api.items.itemFavorites.create(userId, {\n invMastUid,\n });\n return response.data;\n }\n\n async function removeFavorite(\n userId: number,\n invMastUid: number,\n ): Promise<void> {\n await api.items.itemFavorites.delete(userId, invMastUid);\n }\n\n return { getFavorites, addFavorite, removeFavorite };\n}\n"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/pagination.ts","../src/actions/wishlists.ts","../src/actions/favorites.ts"],"sourcesContent":["/**\n * Standardized paginated response shape.\n * Works with any factory method — compose with `paginateOffset()`.\n */\nexport interface PaginatedResult<T> {\n data: T[];\n total?: number;\n nextCursor?: number;\n hasMore: boolean;\n}\n\n/**\n * Wraps a list of items with offset-based pagination metadata.\n *\n * Use this to standardize pagination responses from any factory method.\n * Compatible with React Query's infinite query pattern (`getNextPageParam`).\n *\n * @param items - The items returned from the current page\n * @param pageParam - The current page number (0-based)\n * @param limit - The page size\n * @param total - Optional total count of items (from API response)\n *\n * @example\n * ```ts\n * const result = await actions.items.getCategoryItems(uid, {\n * ...filters, offset: page * 24, limit: 24,\n * });\n * return paginateOffset(result.items, page, 24, result.total);\n * // { data: [...], total: 150, nextCursor: 1, hasMore: true }\n * ```\n */\nexport function paginateOffset<T>(\n items: T[],\n pageParam: number,\n limit: number,\n total?: number,\n): PaginatedResult<T> {\n const hasMore =\n total !== undefined\n ? (pageParam + 1) * limit < total\n : items.length === limit;\n\n return {\n data: items,\n total,\n nextCursor: hasMore ? pageParam + 1 : undefined,\n hasMore,\n };\n}\n","import type { AugurAPI } from \"@simpleapps-com/augur-api\";\nimport type { EdgeCacheValue } from \"../sdk-call\";\nimport { withServerCache } from \"../cache/with-cache\";\n\n/** Derived from augur-api SDK — keeps types in sync automatically. */\nexport type WishlistsApiClient = Pick<AugurAPI, \"items\">;\n\nexport interface WishlistActionsConfig {\n /** Cache key prefix (e.g. \"ampro:\"). Default: \"\". */\n cachePrefix?: string;\n /** CDN edge cache value passed to SDK. Default: 1 (hour). */\n edgeCache?: EdgeCacheValue;\n /** Redis TTL in seconds. Default: 3600 (1 hour). */\n redisTtl?: number;\n}\n\nexport interface WishlistActions {\n getWishlists: (userId: number) => Promise<unknown[]>;\n createWishlist: (\n userId: number,\n data: { name: string; description?: string },\n ) => Promise<unknown>;\n getWishlistDetail: (\n userId: number,\n wishlistId: number,\n ) => Promise<unknown>;\n deleteWishlist: (userId: number, wishlistId: number) => Promise<void>;\n addWishlistItems: (\n userId: number,\n wishlistId: number,\n items: { invMastUid: number }[],\n ) => Promise<unknown>;\n removeWishlistItem: (\n userId: number,\n wishlistId: number,\n lineId: number,\n ) => Promise<void>;\n}\n\n/** @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version. */\nexport function createWishlistActions(\n api: WishlistsApiClient,\n config: WishlistActionsConfig = {},\n): WishlistActions {\n const { cachePrefix = \"\", edgeCache = 1, redisTtl = 3600 } = config;\n\n async function getWishlists(userId: number): Promise<unknown[]> {\n return withServerCache(\n cachePrefix,\n redisTtl,\n \"items.itemWishlist.list\",\n async () => {\n const response = await api.items.itemWishlist.list(userId, {\n edgeCache,\n });\n return response.data;\n },\n userId,\n );\n }\n\n async function createWishlist(\n userId: number,\n data: { name: string; description?: string },\n ): Promise<unknown> {\n const response = await api.items.itemWishlist.create(userId, data);\n return response.data;\n }\n\n async function getWishlistDetail(\n userId: number,\n wishlistId: number,\n ): Promise<unknown> {\n return withServerCache(\n cachePrefix,\n redisTtl,\n \"items.itemWishlist.hdr.get\",\n async () => {\n const response = await api.items.itemWishlist.hdr.get(\n userId,\n wishlistId,\n { edgeCache },\n );\n return response.data;\n },\n userId,\n wishlistId,\n );\n }\n\n async function deleteWishlist(\n userId: number,\n wishlistId: number,\n ): Promise<void> {\n await api.items.itemWishlist.hdr.delete(userId, wishlistId);\n }\n\n async function addWishlistItems(\n userId: number,\n wishlistId: number,\n items: { invMastUid: number }[],\n ): Promise<unknown> {\n const response = await api.items.itemWishlist.hdr.create(\n userId,\n wishlistId,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n items as any,\n );\n return response.data;\n }\n\n async function removeWishlistItem(\n userId: number,\n wishlistId: number,\n lineId: number,\n ): Promise<void> {\n await api.items.itemWishlist.hdr.line.delete(userId, wishlistId, lineId);\n }\n\n return {\n getWishlists,\n createWishlist,\n getWishlistDetail,\n deleteWishlist,\n addWishlistItems,\n removeWishlistItem,\n };\n}\n","import type { AugurAPI } from \"@simpleapps-com/augur-api\";\nimport type { EdgeCacheValue } from \"../sdk-call\";\nimport { withServerCache } from \"../cache/with-cache\";\n\n/** Derived from augur-api SDK — keeps types in sync automatically. */\nexport type FavoritesApiClient = Pick<AugurAPI, \"items\">;\n\nexport interface FavoritesActionsConfig {\n /** Cache key prefix (e.g. \"ampro:\"). Default: \"\". */\n cachePrefix?: string;\n /** CDN edge cache value passed to SDK. Default: 1 (hour). */\n edgeCache?: EdgeCacheValue;\n /** Redis TTL in seconds. Default: 3600 (1 hour). */\n redisTtl?: number;\n}\n\nexport interface FavoritesActions {\n getFavorites: (userId: number) => Promise<unknown[]>;\n addFavorite: (userId: number, invMastUid: number) => Promise<unknown>;\n removeFavorite: (userId: number, invMastUid: number) => Promise<void>;\n}\n\n/** @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version. */\nexport function createFavoritesActions(\n api: FavoritesApiClient,\n config: FavoritesActionsConfig = {},\n): FavoritesActions {\n const { cachePrefix = \"\", edgeCache = 1, redisTtl = 3600 } = config;\n\n async function getFavorites(userId: number): Promise<unknown[]> {\n return withServerCache(\n cachePrefix,\n redisTtl,\n \"items.itemFavorites.list\",\n async () => {\n const response = await api.items.itemFavorites.list(userId, {\n edgeCache,\n });\n return response.data;\n },\n userId,\n );\n }\n\n async function addFavorite(\n userId: number,\n invMastUid: number,\n ): Promise<unknown> {\n const response = await api.items.itemFavorites.create(userId, {\n invMastUid,\n });\n return response.data;\n }\n\n async function removeFavorite(\n userId: number,\n invMastUid: number,\n ): Promise<void> {\n await api.items.itemFavorites.delete(userId, invMastUid);\n }\n\n return { getFavorites, addFavorite, removeFavorite };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BO,SAAS,eACd,OACA,WACA,OACA,OACoB;AACpB,QAAM,UACJ,UAAU,UACL,YAAY,KAAK,QAAQ,QAC1B,MAAM,WAAW;AAEvB,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA,YAAY,UAAU,YAAY,IAAI;AAAA,IACtC;AAAA,EACF;AACF;;;ACRO,SAAS,sBACd,KACA,SAAgC,CAAC,GAChB;AACjB,QAAM,EAAE,cAAc,IAAI,YAAY,GAAG,WAAW,KAAK,IAAI;AAE7D,iBAAe,aAAa,QAAoC;AAC9D,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY;AACV,cAAM,WAAW,MAAM,IAAI,MAAM,aAAa,KAAK,QAAQ;AAAA,UACzD;AAAA,QACF,CAAC;AACD,eAAO,SAAS;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,iBAAe,eACb,QACA,MACkB;AAClB,UAAM,WAAW,MAAM,IAAI,MAAM,aAAa,OAAO,QAAQ,IAAI;AACjE,WAAO,SAAS;AAAA,EAClB;AAEA,iBAAe,kBACb,QACA,YACkB;AAClB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY;AACV,cAAM,WAAW,MAAM,IAAI,MAAM,aAAa,IAAI;AAAA,UAChD;AAAA,UACA;AAAA,UACA,EAAE,UAAU;AAAA,QACd;AACA,eAAO,SAAS;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,iBAAe,eACb,QACA,YACe;AACf,UAAM,IAAI,MAAM,aAAa,IAAI,OAAO,QAAQ,UAAU;AAAA,EAC5D;AAEA,iBAAe,iBACb,QACA,YACA,OACkB;AAClB,UAAM,WAAW,MAAM,IAAI,MAAM,aAAa,IAAI;AAAA,MAChD;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,IACF;AACA,WAAO,SAAS;AAAA,EAClB;AAEA,iBAAe,mBACb,QACA,YACA,QACe;AACf,UAAM,IAAI,MAAM,aAAa,IAAI,KAAK,OAAO,QAAQ,YAAY,MAAM;AAAA,EACzE;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;ACxGO,SAAS,uBACd,KACA,SAAiC,CAAC,GAChB;AAClB,QAAM,EAAE,cAAc,IAAI,YAAY,GAAG,WAAW,KAAK,IAAI;AAE7D,iBAAe,aAAa,QAAoC;AAC9D,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY;AACV,cAAM,WAAW,MAAM,IAAI,MAAM,cAAc,KAAK,QAAQ;AAAA,UAC1D;AAAA,QACF,CAAC;AACD,eAAO,SAAS;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,iBAAe,YACb,QACA,YACkB;AAClB,UAAM,WAAW,MAAM,IAAI,MAAM,cAAc,OAAO,QAAQ;AAAA,MAC5D;AAAA,IACF,CAAC;AACD,WAAO,SAAS;AAAA,EAClB;AAEA,iBAAe,eACb,QACA,YACe;AACf,UAAM,IAAI,MAAM,cAAc,OAAO,QAAQ,UAAU;AAAA,EACzD;AAEA,SAAO,EAAE,cAAc,aAAa,eAAe;AACrD;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calls an Augur SDK method, forwarding all arguments with full type safety.
|
|
3
|
+
*
|
|
4
|
+
* With augur-api >= 0.9.6, SDK methods properly declare their `CacheParams`
|
|
5
|
+
* option (including `edgeCache`), so this wrapper preserves both parameter
|
|
6
|
+
* and return-type inference end-to-end.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const result = await sdkCall(
|
|
11
|
+
* augurServices.items.invMast.get,
|
|
12
|
+
* invMastUid,
|
|
13
|
+
* { edgeCache: 4 },
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare function sdkCall<TArgs extends unknown[], TResult>(method: (...args: TArgs) => Promise<TResult>, ...args: TArgs): Promise<TResult>;
|
|
18
|
+
/** Maps void-returning actions to `true` so `data` is never `undefined` on success. */
|
|
19
|
+
type SafeData<T> = T extends void ? true : T;
|
|
20
|
+
/** Result type for `safeAction` — void-returning actions get `data: true`. */
|
|
21
|
+
type SafeActionResult<T> = {
|
|
22
|
+
ok: true;
|
|
23
|
+
data: SafeData<T>;
|
|
24
|
+
} | {
|
|
25
|
+
ok: false;
|
|
26
|
+
error: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Wraps an async function call with error handling, returning a
|
|
30
|
+
* `SafeActionResult<T>` instead of throwing.
|
|
31
|
+
*
|
|
32
|
+
* Use this to eliminate try/catch boilerplate in server actions.
|
|
33
|
+
* Reads that go through React Query should NOT use this — let errors
|
|
34
|
+
* propagate so React Query can handle retries and error state.
|
|
35
|
+
*
|
|
36
|
+
* When the wrapped function returns `void`, `data` is set to `true`
|
|
37
|
+
* so that `result.data` is never `undefined` on a successful call.
|
|
38
|
+
*
|
|
39
|
+
* @param fn — The async function to execute
|
|
40
|
+
* @param onError — Optional callback for logging/reporting
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const result = await safeAction(
|
|
45
|
+
* () => actions.commerce.addToCart(cartId, items),
|
|
46
|
+
* );
|
|
47
|
+
* if (result.ok) {
|
|
48
|
+
* // result.data is `true` for void actions, or the response data
|
|
49
|
+
* } else {
|
|
50
|
+
* // result.error is the error message
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare function safeAction<T>(fn: () => Promise<T>, onError?: (error: Error) => void): Promise<SafeActionResult<T>>;
|
|
55
|
+
|
|
56
|
+
export { type SafeActionResult as S, type SafeData as a, sdkCall as b, safeAction as s };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EdgeCacheValue } from '@simpleapps-com/augur-core';
|
|
2
2
|
import { AugurAPI } from '@simpleapps-com/augur-api';
|
|
3
|
-
import { TPriceData, TTaxItem, TTax, TCategory, TAttribute, TInvMast, TInvMastDoc, TStockData, TItemAccessory, TCartLookUp, TCartLine,
|
|
3
|
+
import { TPriceData, TTaxItem, TTax, TCategory, TAttribute, TInvMast, TInvMastDoc, TStockData, TItemAccessory, TCartLookUp, TCartLine, TWebDesc } from '@simpleapps-com/augur-utils';
|
|
4
|
+
import { S as SearchActions, i as ShippingActions, J as JoomlaActions, a as CustomersActions, m as SmartyStreetsActions, k as ShippingAddress } from './smarty-streets-BS4ifhxQ.js';
|
|
4
5
|
|
|
5
6
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
6
7
|
type PricingApiClient = Pick<AugurAPI, "pricing">;
|
|
@@ -208,178 +209,6 @@ interface OrderActions {
|
|
|
208
209
|
*/
|
|
209
210
|
declare function createOrderActions(api: OrderApiClient, config?: OrderActionsConfig): OrderActions;
|
|
210
211
|
|
|
211
|
-
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
212
|
-
type SearchApiClient = Pick<AugurAPI, "opensearch">;
|
|
213
|
-
interface SearchActionsConfig {
|
|
214
|
-
/** Cache key prefix (e.g. "ampro:"). Default: "". */
|
|
215
|
-
cachePrefix?: string;
|
|
216
|
-
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
217
|
-
edgeCache?: EdgeCacheValue;
|
|
218
|
-
/** Redis TTL for search lookups in seconds. Default: 3600 (1 hour). */
|
|
219
|
-
redisTtl?: number;
|
|
220
|
-
/** Default source fields for item search. Default: "display_desc". */
|
|
221
|
-
defaultSourceFields?: string;
|
|
222
|
-
}
|
|
223
|
-
/** Paginated response for infinite scroll. */
|
|
224
|
-
interface SearchPage {
|
|
225
|
-
data: TProductItem[];
|
|
226
|
-
total: number;
|
|
227
|
-
nextCursor?: number;
|
|
228
|
-
}
|
|
229
|
-
interface SearchActions {
|
|
230
|
-
getSearchAttributes: (q: string) => Promise<TAttribute[]>;
|
|
231
|
-
getSearchSuggestions: (q: string, limit?: number, offset?: number) => Promise<{
|
|
232
|
-
data: unknown[];
|
|
233
|
-
total: number;
|
|
234
|
-
totalResults: number;
|
|
235
|
-
}>;
|
|
236
|
-
itemSearch: (filters: {
|
|
237
|
-
q: string;
|
|
238
|
-
limit: number;
|
|
239
|
-
offset: number;
|
|
240
|
-
sortBy?: string;
|
|
241
|
-
filters?: [string, string][];
|
|
242
|
-
}, itemCategoryUid?: number | string) => Promise<{
|
|
243
|
-
items: TProductItem[];
|
|
244
|
-
totalResults: number;
|
|
245
|
-
}>;
|
|
246
|
-
itemSearchInfinite: (filters: {
|
|
247
|
-
q: string;
|
|
248
|
-
limit: number;
|
|
249
|
-
sortBy?: string;
|
|
250
|
-
filters?: [string, string][];
|
|
251
|
-
}, itemCategoryUid?: number | string, pageParam?: number) => Promise<SearchPage>;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
255
|
-
*
|
|
256
|
-
* Creates server-side search actions with Redis caching and edge cache support.
|
|
257
|
-
*
|
|
258
|
-
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
259
|
-
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
260
|
-
*
|
|
261
|
-
* @example
|
|
262
|
-
* ```ts
|
|
263
|
-
* // lib/search-actions.ts
|
|
264
|
-
* import { createSearchActions } from "@simpleapps-com/augur-server";
|
|
265
|
-
* import { getAugurClient } from "./augur-client";
|
|
266
|
-
*
|
|
267
|
-
* export const searchActions = createSearchActions(getAugurClient(), {
|
|
268
|
-
* cachePrefix: "ampro:",
|
|
269
|
-
* });
|
|
270
|
-
*
|
|
271
|
-
* // In a server component:
|
|
272
|
-
* const attrs = await searchActions.getSearchAttributes("widget");
|
|
273
|
-
* const results = await searchActions.itemSearch({ q: "widget", limit: 20, offset: 0 });
|
|
274
|
-
* ```
|
|
275
|
-
*/
|
|
276
|
-
declare function createSearchActions(api: SearchApiClient, config?: SearchActionsConfig): SearchActions;
|
|
277
|
-
|
|
278
|
-
interface ShippingAddress {
|
|
279
|
-
address1: string;
|
|
280
|
-
city: string;
|
|
281
|
-
state: string;
|
|
282
|
-
postalCode: string;
|
|
283
|
-
country?: string;
|
|
284
|
-
}
|
|
285
|
-
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
286
|
-
type ShippingApiClient = Pick<AugurAPI, "ups">;
|
|
287
|
-
interface ShippingActionsConfig {
|
|
288
|
-
/** Warehouse/origin address for rate calculations. */
|
|
289
|
-
fromAddress: ShippingAddress;
|
|
290
|
-
/** UPS service codes to filter results. Default: undefined (return all). */
|
|
291
|
-
defaultServiceCodes?: string[];
|
|
292
|
-
/** Cache key prefix (e.g. "ampro:"). Default: "". */
|
|
293
|
-
cachePrefix?: string;
|
|
294
|
-
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
295
|
-
edgeCache?: EdgeCacheValue;
|
|
296
|
-
/** Redis TTL for shipping rate lookups in seconds. Default: 3600 (1 hour). */
|
|
297
|
-
redisTtl?: number;
|
|
298
|
-
}
|
|
299
|
-
interface ShippingActions {
|
|
300
|
-
getShippingRates: (toAddress: ShippingAddress, weight: number, serviceCodes?: string[]) => Promise<unknown>;
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
304
|
-
*
|
|
305
|
-
* Creates server-side shipping actions with Redis caching and edge cache support.
|
|
306
|
-
*
|
|
307
|
-
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
308
|
-
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
309
|
-
*
|
|
310
|
-
* @example
|
|
311
|
-
* ```ts
|
|
312
|
-
* // lib/shipping-actions.ts
|
|
313
|
-
* import { createShippingActions } from "@simpleapps-com/augur-server";
|
|
314
|
-
* import { getAugurClient } from "./augur-client";
|
|
315
|
-
*
|
|
316
|
-
* export const shippingActions = createShippingActions(getAugurClient(), {
|
|
317
|
-
* fromAddress: {
|
|
318
|
-
* address1: "123 Warehouse Ln",
|
|
319
|
-
* city: "Chicago",
|
|
320
|
-
* state: "IL",
|
|
321
|
-
* postalCode: "60601",
|
|
322
|
-
* },
|
|
323
|
-
* });
|
|
324
|
-
*
|
|
325
|
-
* // In a server component:
|
|
326
|
-
* const rates = await shippingActions.getShippingRates(
|
|
327
|
-
* { address1: "456 Main St", city: "Denver", state: "CO", postalCode: "80202" },
|
|
328
|
-
* 5.0,
|
|
329
|
-
* );
|
|
330
|
-
* ```
|
|
331
|
-
*/
|
|
332
|
-
declare function createShippingActions(api: ShippingApiClient, config: ShippingActionsConfig): ShippingActions;
|
|
333
|
-
|
|
334
|
-
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
335
|
-
type JoomlaApiClient = Pick<AugurAPI, "joomla">;
|
|
336
|
-
interface JoomlaActionsConfig {
|
|
337
|
-
/** Cache key prefix (e.g. "ampro:"). Default: "". */
|
|
338
|
-
cachePrefix?: string;
|
|
339
|
-
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
340
|
-
edgeCache?: EdgeCacheValue;
|
|
341
|
-
/** Redis TTL for Joomla lookups in seconds. Default: 3600 (1 hour). */
|
|
342
|
-
redisTtl?: number;
|
|
343
|
-
}
|
|
344
|
-
interface NormalizedUserProfile {
|
|
345
|
-
id: string;
|
|
346
|
-
name: string;
|
|
347
|
-
email: string;
|
|
348
|
-
customerId: string;
|
|
349
|
-
permissions: string[];
|
|
350
|
-
}
|
|
351
|
-
interface JoomlaActions {
|
|
352
|
-
getJoomlaContent: (articleId: number) => Promise<unknown>;
|
|
353
|
-
getJoomlaContentList: (params?: Record<string, unknown>) => Promise<unknown[]>;
|
|
354
|
-
getJoomlaMenu: (params?: Record<string, unknown>) => Promise<unknown[]>;
|
|
355
|
-
getJoomlaMenuDoc: (menuId: number | string) => Promise<unknown>;
|
|
356
|
-
getUserProfile: (userId: number | string) => Promise<NormalizedUserProfile>;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
360
|
-
*
|
|
361
|
-
* Creates server-side Joomla content actions with Redis caching and edge cache support.
|
|
362
|
-
*
|
|
363
|
-
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
364
|
-
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
* ```ts
|
|
368
|
-
* // lib/joomla-actions.ts
|
|
369
|
-
* import { createJoomlaActions } from "@simpleapps-com/augur-server";
|
|
370
|
-
* import { getAugurClient } from "./augur-client";
|
|
371
|
-
*
|
|
372
|
-
* export const joomlaActions = createJoomlaActions(getAugurClient(), {
|
|
373
|
-
* cachePrefix: "ampro:",
|
|
374
|
-
* });
|
|
375
|
-
*
|
|
376
|
-
* // In a server component:
|
|
377
|
-
* const article = await joomlaActions.getJoomlaContent(42);
|
|
378
|
-
* const articles = await joomlaActions.getJoomlaContentList({ catid: 5 });
|
|
379
|
-
* ```
|
|
380
|
-
*/
|
|
381
|
-
declare function createJoomlaActions(api: JoomlaApiClient, config?: JoomlaActionsConfig): JoomlaActions;
|
|
382
|
-
|
|
383
212
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
384
213
|
type LegacyApiClient = Pick<AugurAPI, "legacy">;
|
|
385
214
|
interface LegacyActionsConfig {
|
|
@@ -425,101 +254,6 @@ interface LegacyActions {
|
|
|
425
254
|
*/
|
|
426
255
|
declare function createLegacyActions(api: LegacyApiClient, config?: LegacyActionsConfig): LegacyActions;
|
|
427
256
|
|
|
428
|
-
interface CustomerListResult {
|
|
429
|
-
data: unknown[];
|
|
430
|
-
total: number;
|
|
431
|
-
}
|
|
432
|
-
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
433
|
-
type CustomersApiClient = Pick<AugurAPI, "customers">;
|
|
434
|
-
interface CustomersActionsConfig {
|
|
435
|
-
/** Cache key prefix (e.g. "ampro:"). Default: "". */
|
|
436
|
-
cachePrefix?: string;
|
|
437
|
-
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
438
|
-
edgeCache?: EdgeCacheValue;
|
|
439
|
-
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
440
|
-
redisTtl?: number;
|
|
441
|
-
}
|
|
442
|
-
interface CustomersActions {
|
|
443
|
-
getCustomer: (customerId: number) => Promise<unknown>;
|
|
444
|
-
customerLookup: (params: Record<string, unknown>) => Promise<unknown[]>;
|
|
445
|
-
getCustomerDoc: (customerId: number) => Promise<unknown>;
|
|
446
|
-
getCustomerOrders: (customerId: number, params?: Record<string, unknown>) => Promise<CustomerListResult>;
|
|
447
|
-
getCustomerOrderDetail: (customerId: number, orderId: number) => Promise<unknown>;
|
|
448
|
-
getCustomerInvoices: (customerId: number, params?: Record<string, unknown>) => Promise<CustomerListResult>;
|
|
449
|
-
getCustomerInvoiceDetail: (customerId: number, invoiceNo: number) => Promise<unknown>;
|
|
450
|
-
getCustomerQuotes: (customerId: number, params?: Record<string, unknown>) => Promise<CustomerListResult>;
|
|
451
|
-
getCustomerQuoteDetail: (customerId: number, quoteNo: number) => Promise<unknown>;
|
|
452
|
-
getContacts: (params?: Record<string, unknown>) => Promise<unknown[]>;
|
|
453
|
-
getShipToAddresses: (customerId: number) => Promise<unknown[]>;
|
|
454
|
-
}
|
|
455
|
-
/**
|
|
456
|
-
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
457
|
-
*
|
|
458
|
-
* Creates server-side customer actions with Redis caching and edge cache support.
|
|
459
|
-
*
|
|
460
|
-
* Covers the customers microservice endpoints used by ecommerce sites:
|
|
461
|
-
* customer get, lookup, doc, orders, contacts, and ship-to addresses.
|
|
462
|
-
*
|
|
463
|
-
* @example
|
|
464
|
-
* ```ts
|
|
465
|
-
* import { createCustomersActions } from "@simpleapps-com/augur-server";
|
|
466
|
-
* import { getAugurClient } from "./augur-client";
|
|
467
|
-
*
|
|
468
|
-
* export const customersActions = createCustomersActions(getAugurClient(), {
|
|
469
|
-
* cachePrefix: "ampro:",
|
|
470
|
-
* });
|
|
471
|
-
*
|
|
472
|
-
* const customer = await customersActions.getCustomer(123);
|
|
473
|
-
* const orders = await customersActions.getCustomerOrders(123);
|
|
474
|
-
* ```
|
|
475
|
-
*/
|
|
476
|
-
declare function createCustomersActions(api: CustomersApiClient, config?: CustomersActionsConfig): CustomersActions;
|
|
477
|
-
|
|
478
|
-
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
479
|
-
type SmartyStreetsApiClient = Pick<AugurAPI, "smartyStreets">;
|
|
480
|
-
interface SmartyStreetsActionsConfig {
|
|
481
|
-
/** Cache key prefix (e.g. "ampro:"). Default: "". */
|
|
482
|
-
cachePrefix?: string;
|
|
483
|
-
}
|
|
484
|
-
/** Standardized response from address validation. */
|
|
485
|
-
interface AddressValidationResult {
|
|
486
|
-
data: TSmartyStreets | undefined;
|
|
487
|
-
status: "success" | "not_found" | "error";
|
|
488
|
-
error?: {
|
|
489
|
-
message: string;
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
interface SmartyStreetsActions {
|
|
493
|
-
validateAddress: (params: Record<string, unknown>) => Promise<AddressValidationResult>;
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
497
|
-
*
|
|
498
|
-
* Creates server-side SmartyStreets actions for address validation.
|
|
499
|
-
*
|
|
500
|
-
* Note: Address validation is a real-time operation and does NOT use caching.
|
|
501
|
-
* Each call hits the SmartyStreets API directly to ensure up-to-date results.
|
|
502
|
-
*
|
|
503
|
-
* @example
|
|
504
|
-
* ```ts
|
|
505
|
-
* import { createSmartyStreetsActions } from "@simpleapps-com/augur-server";
|
|
506
|
-
* import { getAugurClient } from "./augur-client";
|
|
507
|
-
*
|
|
508
|
-
* export const smartyStreetsActions = createSmartyStreetsActions(getAugurClient());
|
|
509
|
-
*
|
|
510
|
-
* const result = await smartyStreetsActions.validateAddress({
|
|
511
|
-
* address1: "123 Main St",
|
|
512
|
-
* city: "Provo",
|
|
513
|
-
* state: "UT",
|
|
514
|
-
* postalCode: "84606",
|
|
515
|
-
* });
|
|
516
|
-
* if (result.status === "success") {
|
|
517
|
-
* console.log(result.data); // TSmartyStreets
|
|
518
|
-
* }
|
|
519
|
-
* ```
|
|
520
|
-
*/
|
|
521
|
-
declare function createSmartyStreetsActions(api: SmartyStreetsApiClient, config?: SmartyStreetsActionsConfig): SmartyStreetsActions;
|
|
522
|
-
|
|
523
257
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
524
258
|
type P21PimApiClient = Pick<AugurAPI, "p21Pim">;
|
|
525
259
|
interface P21PimActionsConfig {
|
|
@@ -1304,4 +1038,4 @@ interface SiteActions {
|
|
|
1304
1038
|
*/
|
|
1305
1039
|
declare function createSiteActions<TApi extends object>(api: TApi, config?: SiteActionsConfig): SiteActions;
|
|
1306
1040
|
|
|
1307
|
-
export { type
|
|
1041
|
+
export { type PaymentsApiClient as $, type AgrInfoActions as A, type Basecamp2Actions as B, type CommerceActions as C, type LogisticsApiClient as D, type NexusActionsConfig as E, type NexusApiClient as F, type GregorovichActions as G, type OrderActionsConfig as H, type ItemActions as I, type OrderApiClient as J, type P21ApisActionsConfig as K, type LegacyActions as L, type P21ApisApiClient as M, type NexusActions as N, type OrderActions as O, type P21ApisActions as P, type P21CoreActions as Q, type P21CoreActionsConfig as R, type P21CoreApiClient as S, type P21PimActions as T, type P21PimActionsConfig as U, type P21PimApiClient as V, type P21SismActions as W, type P21SismActionsConfig as X, type P21SismApiClient as Y, type PaymentsActions as Z, type PaymentsActionsConfig as _, type AgrInfoActionsConfig as a, type PricingActions as a0, type PricingActionsConfig as a1, type PricingApiClient as a2, type SiteActions as a3, type SiteActionsConfig as a4, type SlackActions as a5, type SlackActionsConfig as a6, type SlackApiClient as a7, type UpsActions as a8, type UpsActionsConfig as a9, createVmiActions as aA, type UpsApiClient as aa, type VmiActions as ab, type VmiActionsConfig as ac, type VmiApiClient as ad, createAgrInfoActions as ae, createAgrSiteActions as af, createAgrWorkActions as ag, createAvalaraActions as ah, createBasecamp2Actions as ai, createBrandFolderActions as aj, createCommerceActions as ak, createGregorovichActions as al, createItemActions as am, createLegacyActions as an, createLogisticsActions as ao, createNexusActions as ap, createOrderActions as aq, createP21ApisActions as ar, createP21CoreActions as as, createP21PimActions as at, createP21SismActions as au, createPaymentsActions as av, createPricingActions as aw, createSiteActions as ax, createSlackActions as ay, createUpsActions as az, type AgrInfoApiClient as b, type AgrSiteActions as c, type AgrSiteActionsConfig as d, type AgrSiteApiClient as e, type AgrWorkActions as f, type AgrWorkActionsConfig as g, type AgrWorkApiClient as h, type AvalaraActions as i, type AvalaraActionsConfig as j, type AvalaraApiClient as k, type Basecamp2ActionsConfig as l, type Basecamp2ApiClient as m, type BrandFolderActions as n, type BrandFolderActionsConfig as o, type BrandFolderApiClient as p, type CommerceActionsConfig as q, type CommerceApiClient as r, type GregorovichActionsConfig as s, type GregorovichApiClient as t, type ItemActionsConfig as u, type ItemsApiClient as v, type LegacyActionsConfig as w, type LegacyApiClient as x, type LogisticsActions as y, type LogisticsActionsConfig as z };
|
package/dist/site.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a3 as SiteActions, a4 as SiteActionsConfig } from './site-BKPGMqQx.js';
|
|
2
2
|
import { AugurAuthCallbacks } from './auth.js';
|
|
3
3
|
import { NextAuthConfig } from 'next-auth';
|
|
4
4
|
import '@simpleapps-com/augur-core';
|
|
5
5
|
import '@simpleapps-com/augur-api';
|
|
6
6
|
import '@simpleapps-com/augur-utils';
|
|
7
|
+
import './smarty-streets-BS4ifhxQ.js';
|
|
7
8
|
|
|
8
9
|
/** Auth options forwarded to NextAuth when creating a server site. */
|
|
9
10
|
interface ServerSiteAuthConfig {
|