@simpleapps-com/augur-server 1.0.19 → 1.0.20
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 +22 -22
- package/dist/actions.js +1 -1
- package/dist/actions.js.map +1 -1
- package/dist/{chunk-6D3JVRXB.js → chunk-DF3HMPTP.js} +4 -3
- package/dist/chunk-DF3HMPTP.js.map +1 -0
- package/dist/{chunk-MQGUOFAZ.js → chunk-QRCB7P2N.js} +6 -6
- package/dist/chunk-QRCB7P2N.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{server-site-registry--cWuKRVq.d.ts → server-site-registry-DXum3EsN.d.ts} +1 -1
- package/dist/{site-BIi93EZe.d.ts → site-B_2M8bT-.d.ts} +23 -14
- package/dist/site.d.ts +2 -2
- package/dist/site.js +2 -2
- package/dist/{smarty-streets-BM7oah88.d.ts → smarty-streets-wNE71Nip.d.ts} +11 -11
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-6D3JVRXB.js.map +0 -1
- package/dist/chunk-MQGUOFAZ.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, 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-
|
|
3
|
+
import { TPriceData, TTaxItem, TTax, TCartLookUp, TCartLine, TRelatedProduct, TCheckoutResult, TWebDesc, TTransactionSetup, TAccountQuery, TSurcharge, TCardInfo, TBillingUpdate, TPaymentValidation, TShippingMethod } 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-wNE71Nip.js';
|
|
5
5
|
|
|
6
6
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
7
7
|
type PricingApiClient = Pick<AugurAPI, "pricing">;
|
|
@@ -76,8 +76,8 @@ interface CommerceActions {
|
|
|
76
76
|
unitOfMeasure: string;
|
|
77
77
|
}[]) => Promise<unknown>;
|
|
78
78
|
deleteCartItems: (cartHdrUid: number) => Promise<void>;
|
|
79
|
-
getCartAlsoBought: (cartHdrUid: number) => Promise<
|
|
80
|
-
checkoutOrder: (cartHdrUid: number, data: Record<string, unknown>) => Promise<
|
|
79
|
+
getCartAlsoBought: (cartHdrUid: number) => Promise<TRelatedProduct[]>;
|
|
80
|
+
checkoutOrder: (cartHdrUid: number, data: Record<string, unknown>) => Promise<TCheckoutResult | undefined>;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
@@ -159,7 +159,7 @@ interface LegacyActionsConfig {
|
|
|
159
159
|
}
|
|
160
160
|
interface LegacyActions {
|
|
161
161
|
getItemWebDesc: (invMastUid: number) => Promise<TWebDesc | undefined>;
|
|
162
|
-
getAlsoBoughtItems: (invMastUid: number) => Promise<
|
|
162
|
+
getAlsoBoughtItems: (invMastUid: number) => Promise<TRelatedProduct[]>;
|
|
163
163
|
getItemTags: (invMastUid: number) => Promise<unknown[]>;
|
|
164
164
|
getStates: (params?: {
|
|
165
165
|
twoLetterCode?: string;
|
|
@@ -313,12 +313,12 @@ interface PaymentsActionsConfig {
|
|
|
313
313
|
mode?: string;
|
|
314
314
|
}
|
|
315
315
|
interface PaymentsActions {
|
|
316
|
-
transactionSetup: (params: Record<string, unknown>) => Promise<
|
|
317
|
-
accountQuery: (params: Record<string, unknown>) => Promise<
|
|
318
|
-
getSurcharge: (params: Record<string, unknown>) => Promise<
|
|
319
|
-
cardInfo: (params: Record<string, unknown>) => Promise<
|
|
320
|
-
billingUpdate: (params: Record<string, unknown>) => Promise<
|
|
321
|
-
validatePayment: (params: Record<string, unknown>) => Promise<
|
|
316
|
+
transactionSetup: (params: Record<string, unknown>) => Promise<TTransactionSetup | undefined>;
|
|
317
|
+
accountQuery: (params: Record<string, unknown>) => Promise<TAccountQuery | undefined>;
|
|
318
|
+
getSurcharge: (params: Record<string, unknown>) => Promise<TSurcharge | undefined>;
|
|
319
|
+
cardInfo: (params: Record<string, unknown>) => Promise<TCardInfo | undefined>;
|
|
320
|
+
billingUpdate: (params: Record<string, unknown>) => Promise<TBillingUpdate | undefined>;
|
|
321
|
+
validatePayment: (params: Record<string, unknown>) => Promise<TPaymentValidation | undefined>;
|
|
322
322
|
}
|
|
323
323
|
/**
|
|
324
324
|
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
@@ -349,7 +349,7 @@ interface UpsActionsConfig {
|
|
|
349
349
|
cachePrefix?: string;
|
|
350
350
|
}
|
|
351
351
|
interface UpsActions {
|
|
352
|
-
getRates: (params: Record<string, unknown>) => Promise<
|
|
352
|
+
getRates: (params: Record<string, unknown>) => Promise<TShippingMethod[] | undefined>;
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
355
|
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
@@ -868,7 +868,16 @@ interface SlackActions {
|
|
|
868
868
|
declare function createSlackActions(api: SlackApiClient, config?: SlackActionsConfig): SlackActions;
|
|
869
869
|
|
|
870
870
|
interface SiteActionsConfig {
|
|
871
|
-
/**
|
|
871
|
+
/**
|
|
872
|
+
* Cache key prefix shared across all services.
|
|
873
|
+
*
|
|
874
|
+
* Defaults to `"${siteId}:"` extracted from the API client.
|
|
875
|
+
* The site ID is the canonical cache namespace — most sites should
|
|
876
|
+
* NOT set this and let it derive automatically.
|
|
877
|
+
*
|
|
878
|
+
* Only override when migrating from a legacy prefix (e.g. `"ampro:"`
|
|
879
|
+
* instead of the site ID `"ampro-online"`).
|
|
880
|
+
*/
|
|
872
881
|
cachePrefix?: string;
|
|
873
882
|
/** Default edge cache TTL in seconds */
|
|
874
883
|
edgeCache?: EdgeCacheValue;
|
|
@@ -952,8 +961,8 @@ interface SiteActions {
|
|
|
952
961
|
* import { createSiteActions } from "@simpleapps-com/augur-server";
|
|
953
962
|
* import { getAugurClient } from "./augur-client";
|
|
954
963
|
*
|
|
964
|
+
* // cachePrefix defaults to "${siteId}:" from the API client — no need to set it.
|
|
955
965
|
* export const actions = createSiteActions(getAugurClient(), {
|
|
956
|
-
* cachePrefix: "ampro:",
|
|
957
966
|
* defaultCustomerId: process.env.NEXT_PUBLIC_DEFAULT_CUSTOMER_ID,
|
|
958
967
|
* defaultContactId: process.env.NEXT_PUBLIC_DEFAULT_CONTACT_ID,
|
|
959
968
|
* convertUnitOfMeasure: (uom) => uom === "EA" ? "EACH" : uom,
|
package/dist/site.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a0 as SiteActions, a1 as SiteActionsConfig } from './site-
|
|
1
|
+
import { a0 as SiteActions, a1 as SiteActionsConfig } from './site-B_2M8bT-.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-wNE71Nip.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,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSiteActions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DF3HMPTP.js";
|
|
4
4
|
import {
|
|
5
5
|
createAuthConfig
|
|
6
6
|
} from "./chunk-Z7QWERHW.js";
|
|
7
7
|
import "./chunk-XGRQ53P2.js";
|
|
8
8
|
import {
|
|
9
9
|
registerSiteActions
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QRCB7P2N.js";
|
|
11
11
|
|
|
12
12
|
// src/server-site.ts
|
|
13
13
|
function createServerSite(client, config = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AugurAPI } from '@simpleapps-com/augur-api';
|
|
2
2
|
import { EdgeCacheValue } from '@simpleapps-com/augur-core';
|
|
3
|
-
import { TCategory, TAttribute, TInvMast, TInvMastDoc, TStockData, TItemAccessory, TProductItem, TSmartyStreets } from '@simpleapps-com/augur-utils';
|
|
3
|
+
import { TCategory, TCategoryItemsResult, TAttribute, TInvMast, TInvMastDoc, TStockData, TItemAccessory, TProductItem, TShippingMethod, TJoomlaContent, TMenu, TPasswordVerification, CustomerDocument, TSmartyStreets } from '@simpleapps-com/augur-utils';
|
|
4
4
|
|
|
5
5
|
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
6
6
|
type ItemsApiClient = Pick<AugurAPI, "items">;
|
|
@@ -35,7 +35,7 @@ interface GetItemCategoryOptions {
|
|
|
35
35
|
interface ItemActions {
|
|
36
36
|
itemCategoryLookup: (path: string) => Promise<unknown>;
|
|
37
37
|
getItemCategory: (uid: number, options?: GetItemCategoryOptions) => Promise<TCategory>;
|
|
38
|
-
getCategoryItems: (uid: number, filters: Record<string, unknown>) => Promise<
|
|
38
|
+
getCategoryItems: (uid: number, filters: Record<string, unknown>) => Promise<TCategoryItemsResult>;
|
|
39
39
|
getItemAttributes: (categoryUid: number) => Promise<TAttribute[]>;
|
|
40
40
|
getInvMast: (uid: number) => Promise<TInvMast>;
|
|
41
41
|
getInvMastDoc: (params: {
|
|
@@ -169,7 +169,7 @@ interface ShippingActionsConfig {
|
|
|
169
169
|
redisTtl?: number;
|
|
170
170
|
}
|
|
171
171
|
interface ShippingActions {
|
|
172
|
-
getShippingRates: (toAddress: ShippingAddress, weight: number, serviceCodes?: string[]) => Promise<
|
|
172
|
+
getShippingRates: (toAddress: ShippingAddress, weight: number, serviceCodes?: string[]) => Promise<TShippingMethod[]>;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
@@ -221,12 +221,12 @@ interface NormalizedUserProfile {
|
|
|
221
221
|
permissions: string[];
|
|
222
222
|
}
|
|
223
223
|
interface JoomlaActions {
|
|
224
|
-
getJoomlaContent: (articleId: number) => Promise<
|
|
225
|
-
getJoomlaContentList: (params?: Record<string, unknown>) => Promise<
|
|
226
|
-
getJoomlaMenu: (params?: Record<string, unknown>) => Promise<
|
|
227
|
-
getJoomlaMenuDoc: (menuId: number | string) => Promise<
|
|
224
|
+
getJoomlaContent: (articleId: number) => Promise<TJoomlaContent>;
|
|
225
|
+
getJoomlaContentList: (params?: Record<string, unknown>) => Promise<TJoomlaContent[]>;
|
|
226
|
+
getJoomlaMenu: (params?: Record<string, unknown>) => Promise<TMenu[]>;
|
|
227
|
+
getJoomlaMenuDoc: (menuId: number | string) => Promise<TMenu>;
|
|
228
228
|
getUserProfile: (userId: number | string) => Promise<NormalizedUserProfile>;
|
|
229
|
-
verifyPassword: (username: string, password: string) => Promise<
|
|
229
|
+
verifyPassword: (username: string, password: string) => Promise<TPasswordVerification>;
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
232
232
|
* @deprecated Use `createSiteActions()` instead. This factory will be removed in the next major version.
|
|
@@ -268,9 +268,9 @@ interface CustomersActionsConfig {
|
|
|
268
268
|
redisTtl?: number;
|
|
269
269
|
}
|
|
270
270
|
interface CustomersActions {
|
|
271
|
-
getCustomer: (customerId: number) => Promise<
|
|
272
|
-
customerLookup: (params: Record<string, unknown>) => Promise<
|
|
273
|
-
getCustomerDoc: (customerId: number) => Promise<
|
|
271
|
+
getCustomer: (customerId: number) => Promise<CustomerDocument>;
|
|
272
|
+
customerLookup: (params: Record<string, unknown>) => Promise<CustomerDocument[]>;
|
|
273
|
+
getCustomerDoc: (customerId: number) => Promise<CustomerDocument>;
|
|
274
274
|
getCustomerOrders: (customerId: number, params?: Record<string, unknown>) => Promise<CustomerListResult>;
|
|
275
275
|
getCustomerOrderDetail: (customerId: number, orderId: number) => Promise<unknown>;
|
|
276
276
|
getCustomerInvoices: (customerId: number, params?: Record<string, unknown>) => Promise<CustomerListResult>;
|
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 { a0 as SiteActions } from './site-
|
|
2
|
+
export { c as clearSiteActions } from './server-site-registry-DXum3EsN.js';
|
|
3
|
+
import { a0 as SiteActions } from './site-B_2M8bT-.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-wNE71Nip.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A mock function type compatible with both Vitest and Jest.
|
package/dist/testing.js
CHANGED
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.20",
|
|
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.20",
|
|
53
|
+
"@simpleapps-com/augur-utils": "1.0.20"
|
|
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.20"
|
|
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.20"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "tsup",
|