@simpleapps-com/augur-server 1.0.18 → 1.0.19
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 +3 -3
- package/dist/actions.js.map +1 -1
- package/dist/{chunk-5D5JCAKO.js → chunk-6D3JVRXB.js} +8 -7
- package/dist/chunk-6D3JVRXB.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{server-site-registry-BZvxwcGM.d.ts → server-site-registry--cWuKRVq.d.ts} +1 -1
- package/dist/{site-BKPGMqQx.d.ts → site-BIi93EZe.d.ts} +4 -70
- package/dist/site.d.ts +2 -2
- package/dist/site.js +1 -1
- package/dist/{smarty-streets-BS4ifhxQ.d.ts → smarty-streets-BM7oah88.d.ts} +80 -2
- package/dist/testing.d.ts +3 -3
- package/package.json +5 -5
- package/dist/chunk-5D5JCAKO.js.map +0 -1
|
@@ -1,7 +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,
|
|
4
|
-
import { S as SearchActions,
|
|
3
|
+
import { TPriceData, TTaxItem, TTax, TCartLookUp, TCartLine, TWebDesc } from '@simpleapps-com/augur-utils';
|
|
4
|
+
import { I as ItemActions, S as SearchActions, k as ShippingActions, J as JoomlaActions, a as CustomersActions, o as SmartyStreetsActions, m as ShippingAddress } from './smarty-streets-BM7oah88.js';
|
|
5
5
|
|
|
6
6
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
7
7
|
type PricingApiClient = Pick<AugurAPI, "pricing">;
|
|
@@ -20,7 +20,7 @@ interface PricingActionsConfig {
|
|
|
20
20
|
interface PricingActions {
|
|
21
21
|
getItemPrice: (itemId: string, customerId?: string | number, quantity?: number) => Promise<TPriceData>;
|
|
22
22
|
batchGetItemPrices: (itemIds: string[], customerId?: string | number, quantity?: number) => Promise<Record<string, TPriceData>>;
|
|
23
|
-
getTaxEstimate: (customerId
|
|
23
|
+
getTaxEstimate: (customerId?: string | number, postalCode?: string, items?: TTaxItem[]) => Promise<TTax>;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
@@ -48,72 +48,6 @@ interface PricingActions {
|
|
|
48
48
|
*/
|
|
49
49
|
declare function createPricingActions(api: PricingApiClient, config?: PricingActionsConfig): PricingActions;
|
|
50
50
|
|
|
51
|
-
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
52
|
-
type ItemsApiClient = Pick<AugurAPI, "items">;
|
|
53
|
-
interface ItemActionsConfig {
|
|
54
|
-
/** Cache key prefix (e.g. "ampro:"). Default: "". */
|
|
55
|
-
cachePrefix?: string;
|
|
56
|
-
/** CDN edge cache value for most calls. Default: 1 (hour). */
|
|
57
|
-
edgeCache?: EdgeCacheValue;
|
|
58
|
-
/** CDN edge cache for rarely-changing data like FAQs. Default: 8 (hours). */
|
|
59
|
-
longEdgeCache?: EdgeCacheValue;
|
|
60
|
-
/** Redis TTL for most calls in seconds. Default: 3600 (1 hour). */
|
|
61
|
-
redisTtl?: number;
|
|
62
|
-
/** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
|
|
63
|
-
longRedisTtl?: number;
|
|
64
|
-
/** Sort category children by sequenceNo. Default: true. */
|
|
65
|
-
sortChildren?: boolean;
|
|
66
|
-
/** Prefix prepended to sortBy filter values (e.g. "item_category_sequence_no_min|"). */
|
|
67
|
-
sortByPrefix?: string;
|
|
68
|
-
}
|
|
69
|
-
interface ItemActions {
|
|
70
|
-
itemCategoryLookup: (path: string) => Promise<unknown>;
|
|
71
|
-
getItemCategory: (uid: number, options?: Record<string, unknown>) => Promise<TCategory>;
|
|
72
|
-
getCategoryItems: (uid: number, filters: Record<string, unknown>) => Promise<unknown>;
|
|
73
|
-
getItemAttributes: (categoryUid: number) => Promise<TAttribute[]>;
|
|
74
|
-
getInvMast: (uid: number) => Promise<TInvMast>;
|
|
75
|
-
getInvMastDoc: (params: {
|
|
76
|
-
invMastUid?: number;
|
|
77
|
-
itemId?: string;
|
|
78
|
-
includePricing?: "Y" | "N";
|
|
79
|
-
}) => Promise<TInvMastDoc>;
|
|
80
|
-
getStock: (invMastUid: number) => Promise<TStockData[]>;
|
|
81
|
-
getStockCompanySummary: (invMastUid: number) => Promise<Record<string, number>>;
|
|
82
|
-
getItemFaqs: (invMastUid: number) => Promise<unknown[]>;
|
|
83
|
-
getItemSubstitutes: (invMastUid: number) => Promise<unknown[]>;
|
|
84
|
-
getItemAccessories: (invMastUid: number) => Promise<TItemAccessory[]>;
|
|
85
|
-
getSimilarItems: (invMastUid: number) => Promise<unknown[]>;
|
|
86
|
-
batchGetInvMastDocs: (params: {
|
|
87
|
-
invMastUid?: number;
|
|
88
|
-
itemId?: string;
|
|
89
|
-
}[]) => Promise<Record<string, TInvMastDoc>>;
|
|
90
|
-
batchGetStockData: (invMastUids: number[]) => Promise<Record<number, TStockData[]>>;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
94
|
-
*
|
|
95
|
-
* Creates server-side item actions with Redis caching and edge cache support.
|
|
96
|
-
*
|
|
97
|
-
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
98
|
-
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* ```ts
|
|
102
|
-
* // lib/item-actions.ts
|
|
103
|
-
* import { createItemActions } from "@simpleapps-com/augur-server";
|
|
104
|
-
* import { getAugurClient } from "./augur-client";
|
|
105
|
-
*
|
|
106
|
-
* export const itemActions = createItemActions(getAugurClient(), {
|
|
107
|
-
* cachePrefix: "ampro:",
|
|
108
|
-
* });
|
|
109
|
-
*
|
|
110
|
-
* // In a server component:
|
|
111
|
-
* const category = await itemActions.getItemCategory(123);
|
|
112
|
-
* const doc = await itemActions.getInvMastDoc({ itemId: "ITEM-1" });
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
declare function createItemActions(api: ItemsApiClient, config?: ItemActionsConfig): ItemActions;
|
|
116
|
-
|
|
117
51
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
118
52
|
type CommerceApiClient = Pick<AugurAPI, "commerce">;
|
|
119
53
|
interface CommerceActionsConfig {
|
|
@@ -1038,4 +972,4 @@ interface SiteActions {
|
|
|
1038
972
|
*/
|
|
1039
973
|
declare function createSiteActions<TApi extends object>(api: TApi, config?: SiteActionsConfig): SiteActions;
|
|
1040
974
|
|
|
1041
|
-
export { type
|
|
975
|
+
export { type PricingApiClient as $, type AgrInfoActions as A, type Basecamp2Actions as B, type CommerceActions as C, type NexusApiClient as D, type OrderActionsConfig as E, type OrderApiClient as F, type GregorovichActions as G, type P21ApisActionsConfig as H, type P21ApisApiClient as I, type P21CoreActions as J, type P21CoreActionsConfig as K, type LegacyActions as L, type P21CoreApiClient as M, type NexusActions as N, type OrderActions as O, type P21ApisActions as P, type P21PimActions as Q, type P21PimActionsConfig as R, type P21PimApiClient as S, type P21SismActions as T, type P21SismActionsConfig as U, type P21SismApiClient as V, type PaymentsActions as W, type PaymentsActionsConfig as X, type PaymentsApiClient as Y, type PricingActions as Z, type PricingActionsConfig as _, type AgrInfoActionsConfig as a, type SiteActions as a0, type SiteActionsConfig as a1, type SlackActions as a2, type SlackActionsConfig as a3, type SlackApiClient as a4, type UpsActions as a5, type UpsActionsConfig as a6, type UpsApiClient as a7, type VmiActions as a8, type VmiActionsConfig as a9, type VmiApiClient as aa, createAgrInfoActions as ab, createAgrSiteActions as ac, createAgrWorkActions as ad, createAvalaraActions as ae, createBasecamp2Actions as af, createBrandFolderActions as ag, createCommerceActions as ah, createGregorovichActions as ai, createLegacyActions as aj, createLogisticsActions as ak, createNexusActions as al, createOrderActions as am, createP21ApisActions as an, createP21CoreActions as ao, createP21PimActions as ap, createP21SismActions as aq, createPaymentsActions as ar, createPricingActions as as, createSiteActions as at, createSlackActions as au, createUpsActions as av, createVmiActions as aw, 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 LegacyActionsConfig as u, type LegacyApiClient as v, type LogisticsActions as w, type LogisticsActionsConfig as x, type LogisticsApiClient as y, type NexusActionsConfig as z };
|
package/dist/site.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a0 as SiteActions, a1 as SiteActionsConfig } from './site-BIi93EZe.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-
|
|
7
|
+
import './smarty-streets-BM7oah88.js';
|
|
8
8
|
|
|
9
9
|
/** Auth options forwarded to NextAuth when creating a server site. */
|
|
10
10
|
interface ServerSiteAuthConfig {
|
package/dist/site.js
CHANGED
|
@@ -1,6 +1,84 @@
|
|
|
1
1
|
import { AugurAPI } from '@simpleapps-com/augur-api';
|
|
2
2
|
import { EdgeCacheValue } from '@simpleapps-com/augur-core';
|
|
3
|
-
import { TAttribute, TProductItem, TSmartyStreets } from '@simpleapps-com/augur-utils';
|
|
3
|
+
import { TCategory, TAttribute, TInvMast, TInvMastDoc, TStockData, TItemAccessory, TProductItem, TSmartyStreets } from '@simpleapps-com/augur-utils';
|
|
4
|
+
|
|
5
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
6
|
+
type ItemsApiClient = Pick<AugurAPI, "items">;
|
|
7
|
+
interface ItemActionsConfig {
|
|
8
|
+
/** Cache key prefix (e.g. "ampro:"). Default: "". */
|
|
9
|
+
cachePrefix?: string;
|
|
10
|
+
/** CDN edge cache value for most calls. Default: 1 (hour). */
|
|
11
|
+
edgeCache?: EdgeCacheValue;
|
|
12
|
+
/** CDN edge cache for rarely-changing data like FAQs. Default: 8 (hours). */
|
|
13
|
+
longEdgeCache?: EdgeCacheValue;
|
|
14
|
+
/** Redis TTL for most calls in seconds. Default: 3600 (1 hour). */
|
|
15
|
+
redisTtl?: number;
|
|
16
|
+
/** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
|
|
17
|
+
longRedisTtl?: number;
|
|
18
|
+
/** Sort category children by sequenceNo. Default: true. */
|
|
19
|
+
sortChildren?: boolean;
|
|
20
|
+
/** Prefix prepended to sortBy filter values (e.g. "item_category_sequence_no_min|"). */
|
|
21
|
+
sortByPrefix?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Typed options for getItemCategory. */
|
|
24
|
+
interface GetItemCategoryOptions {
|
|
25
|
+
childrenFilter?: string;
|
|
26
|
+
childrenLimit?: number;
|
|
27
|
+
childrenOffset?: number;
|
|
28
|
+
classId5List?: string;
|
|
29
|
+
filters?: Record<string, string>;
|
|
30
|
+
orderBy?: string;
|
|
31
|
+
path?: string;
|
|
32
|
+
productCollection?: string;
|
|
33
|
+
rootItemCategoryId?: string;
|
|
34
|
+
}
|
|
35
|
+
interface ItemActions {
|
|
36
|
+
itemCategoryLookup: (path: string) => Promise<unknown>;
|
|
37
|
+
getItemCategory: (uid: number, options?: GetItemCategoryOptions) => Promise<TCategory>;
|
|
38
|
+
getCategoryItems: (uid: number, filters: Record<string, unknown>) => Promise<unknown>;
|
|
39
|
+
getItemAttributes: (categoryUid: number) => Promise<TAttribute[]>;
|
|
40
|
+
getInvMast: (uid: number) => Promise<TInvMast>;
|
|
41
|
+
getInvMastDoc: (params: {
|
|
42
|
+
invMastUid?: number;
|
|
43
|
+
itemId?: string;
|
|
44
|
+
includePricing?: "Y" | "N";
|
|
45
|
+
}) => Promise<TInvMastDoc>;
|
|
46
|
+
getStock: (invMastUid: number) => Promise<TStockData[]>;
|
|
47
|
+
getStockCompanySummary: (invMastUid: number) => Promise<Record<string, number>>;
|
|
48
|
+
getItemFaqs: (invMastUid: number) => Promise<unknown[]>;
|
|
49
|
+
getItemSubstitutes: (invMastUid: number) => Promise<unknown[]>;
|
|
50
|
+
getItemAccessories: (invMastUid: number) => Promise<TItemAccessory[]>;
|
|
51
|
+
getSimilarItems: (invMastUid: number) => Promise<unknown[]>;
|
|
52
|
+
batchGetInvMastDocs: (params: {
|
|
53
|
+
invMastUid?: number;
|
|
54
|
+
itemId?: string;
|
|
55
|
+
}[]) => Promise<Record<string, TInvMastDoc>>;
|
|
56
|
+
batchGetStockData: (invMastUids: number[]) => Promise<Record<number, TStockData[]>>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
60
|
+
*
|
|
61
|
+
* Creates server-side item actions with Redis caching and edge cache support.
|
|
62
|
+
*
|
|
63
|
+
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
64
|
+
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* // lib/item-actions.ts
|
|
69
|
+
* import { createItemActions } from "@simpleapps-com/augur-server";
|
|
70
|
+
* import { getAugurClient } from "./augur-client";
|
|
71
|
+
*
|
|
72
|
+
* export const itemActions = createItemActions(getAugurClient(), {
|
|
73
|
+
* cachePrefix: "ampro:",
|
|
74
|
+
* });
|
|
75
|
+
*
|
|
76
|
+
* // In a server component:
|
|
77
|
+
* const category = await itemActions.getItemCategory(123);
|
|
78
|
+
* const doc = await itemActions.getInvMastDoc({ itemId: "ITEM-1" });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
declare function createItemActions(api: ItemsApiClient, config?: ItemActionsConfig): ItemActions;
|
|
4
82
|
|
|
5
83
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
6
84
|
type SearchApiClient = Pick<AugurAPI, "opensearch">;
|
|
@@ -270,4 +348,4 @@ interface SmartyStreetsActions {
|
|
|
270
348
|
*/
|
|
271
349
|
declare function createSmartyStreetsActions(api: SmartyStreetsApiClient, config?: SmartyStreetsActionsConfig): SmartyStreetsActions;
|
|
272
350
|
|
|
273
|
-
export { type AddressValidationResult as A, type CustomerListResult as C, type JoomlaActions as J, type NormalizedUserProfile as N, type SearchActions as S, type CustomersActions as a, type CustomersActionsConfig as b, type CustomersApiClient as c, type
|
|
351
|
+
export { type AddressValidationResult as A, type CustomerListResult as C, type GetItemCategoryOptions as G, type ItemActions as I, type JoomlaActions as J, type NormalizedUserProfile as N, type SearchActions as S, type CustomersActions as a, type CustomersActionsConfig as b, type CustomersApiClient as c, type ItemActionsConfig as d, type ItemsApiClient as e, type JoomlaActionsConfig as f, type JoomlaApiClient as g, type SearchActionsConfig as h, type SearchApiClient as i, type SearchPage as j, type ShippingActions as k, type ShippingActionsConfig as l, type ShippingAddress as m, type ShippingApiClient as n, type SmartyStreetsActions as o, type SmartyStreetsActionsConfig as p, type SmartyStreetsApiClient as q, createCustomersActions as r, createItemActions as s, createJoomlaActions as t, createSearchActions as u, createShippingActions as v, createSmartyStreetsActions as w };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { DeepMockClient, MockClientResult, createMockClient } from '@simpleapps-com/augur-core/testing';
|
|
2
|
-
export { c as clearSiteActions } from './server-site-registry
|
|
3
|
-
import {
|
|
2
|
+
export { c as clearSiteActions } from './server-site-registry--cWuKRVq.js';
|
|
3
|
+
import { a0 as SiteActions } from './site-BIi93EZe.js';
|
|
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-
|
|
7
|
+
import './smarty-streets-BM7oah88.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A mock function type compatible with both Vitest and Jest.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simpleapps-com/augur-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"valibot": "^1.0.0",
|
|
52
|
-
"@simpleapps-com/augur-core": "1.0.
|
|
53
|
-
"@simpleapps-com/augur-utils": "1.0.
|
|
52
|
+
"@simpleapps-com/augur-core": "1.0.19",
|
|
53
|
+
"@simpleapps-com/augur-utils": "1.0.19"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@simpleapps-com/augur-api": "^2026.3.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"next": "^16.1.6",
|
|
60
60
|
"next-auth": ">=5.0.0-beta.30",
|
|
61
61
|
"react": "^19.0.0",
|
|
62
|
-
"@simpleapps-com/augur-hooks": "1.0.
|
|
62
|
+
"@simpleapps-com/augur-hooks": "1.0.19"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"ioredis": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"tsup": "^8.5.0",
|
|
83
83
|
"vitest": "^3.2.0",
|
|
84
84
|
"@augur-packages/tsconfig": "0.0.0",
|
|
85
|
-
"@simpleapps-com/augur-hooks": "1.0.
|
|
85
|
+
"@simpleapps-com/augur-hooks": "1.0.19"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "tsup",
|