@simpleapps-com/augur-server 2.3.1 → 2026.11.1
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 +29 -72
- package/README.md +29 -198
- package/dist/actions/agr-info.d.ts +43 -0
- package/dist/actions/agr-info.d.ts.map +1 -0
- package/dist/actions/agr-site.d.ts +37 -0
- package/dist/actions/agr-site.d.ts.map +1 -0
- package/dist/actions/agr-work.d.ts +29 -0
- package/dist/actions/agr-work.d.ts.map +1 -0
- package/dist/actions/avalara.d.ts +38 -0
- package/dist/actions/avalara.d.ts.map +1 -0
- package/dist/actions/basecamp2.d.ts +47 -0
- package/dist/actions/basecamp2.d.ts.map +1 -0
- package/dist/actions/brand-folder.d.ts +38 -0
- package/dist/actions/brand-folder.d.ts.map +1 -0
- package/dist/actions/commerce.d.ts +58 -0
- package/dist/actions/commerce.d.ts.map +1 -0
- package/dist/actions/customers.d.ts +44 -0
- package/dist/actions/customers.d.ts.map +1 -0
- package/dist/actions/favorites.d.ts +20 -0
- package/dist/actions/favorites.d.ts.map +1 -0
- package/dist/actions/gregorovich.d.ts +34 -0
- package/dist/actions/gregorovich.d.ts.map +1 -0
- package/dist/actions/items.d.ts +80 -0
- package/dist/actions/items.d.ts.map +1 -0
- package/dist/actions/joomla.d.ts +59 -0
- package/dist/actions/joomla.d.ts.map +1 -0
- package/dist/actions/legacy.d.ts +45 -0
- package/dist/actions/legacy.d.ts.map +1 -0
- package/dist/actions/logistics.d.ts +40 -0
- package/dist/actions/logistics.d.ts.map +1 -0
- package/dist/actions/orders.d.ts +36 -0
- package/dist/actions/orders.d.ts.map +1 -0
- package/dist/actions/p21-apis.d.ts +33 -0
- package/dist/actions/p21-apis.d.ts.map +1 -0
- package/dist/actions/p21-core.d.ts +46 -0
- package/dist/actions/p21-core.d.ts.map +1 -0
- package/dist/actions/p21-pim.d.ts +36 -0
- package/dist/actions/p21-pim.d.ts.map +1 -0
- package/dist/actions/p21-sism.d.ts +37 -0
- package/dist/actions/p21-sism.d.ts.map +1 -0
- package/dist/actions/payments.d.ts +39 -0
- package/dist/actions/payments.d.ts.map +1 -0
- package/dist/actions/pricing.d.ts +45 -0
- package/dist/actions/pricing.d.ts.map +1 -0
- package/dist/actions/search.d.ts +61 -0
- package/dist/actions/search.d.ts.map +1 -0
- package/dist/actions/shipping.d.ts +56 -0
- package/dist/actions/shipping.d.ts.map +1 -0
- package/dist/actions/site.d.ts +141 -0
- package/dist/actions/site.d.ts.map +1 -0
- package/dist/actions/smarty-streets.d.ts +45 -0
- package/dist/actions/smarty-streets.d.ts.map +1 -0
- package/dist/actions/vmi.d.ts +44 -0
- package/dist/actions/vmi.d.ts.map +1 -0
- package/dist/actions/wishlists.d.ts +28 -0
- package/dist/actions/wishlists.d.ts.map +1 -0
- package/dist/api-handler.d.ts +25 -0
- package/dist/api-handler.d.ts.map +1 -0
- package/dist/api.d.ts +2 -26
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +19 -14
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts +10 -12
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +2 -2
- package/dist/cache/redis-client.d.ts +16 -0
- package/dist/cache/redis-client.d.ts.map +1 -0
- package/dist/cache/with-cache.d.ts +18 -0
- package/dist/cache/with-cache.d.ts.map +1 -0
- package/dist/chunk-FWO6Q43T.js +162 -0
- package/dist/chunk-FWO6Q43T.js.map +1 -0
- package/dist/{chunk-HPQQYROJ.js → chunk-NTUPTNOI.js} +40 -7
- package/dist/chunk-NTUPTNOI.js.map +1 -0
- package/dist/{chunk-WOHZDFJF.js → chunk-PFYEMJTQ.js} +212 -642
- package/dist/chunk-PFYEMJTQ.js.map +1 -0
- package/dist/{chunk-KHFEDL47.js → chunk-SXXWBSTX.js} +18 -12
- package/dist/chunk-SXXWBSTX.js.map +1 -0
- package/dist/chunk-TVH5EONP.js +178 -0
- package/dist/chunk-TVH5EONP.js.map +1 -0
- package/dist/{chunk-TQP67TGL.js → chunk-U2BKHRJC.js} +13 -15
- package/dist/chunk-U2BKHRJC.js.map +1 -0
- package/dist/environment.d.ts +10 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/hooks.d.ts +8 -10
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +3 -3
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +16 -125
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/pagination.d.ts +32 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/query-action.d.ts +156 -17
- package/dist/query-action.d.ts.map +1 -0
- package/dist/query-action.js +3 -3
- package/dist/query-options-helper.d.ts +33 -0
- package/dist/query-options-helper.d.ts.map +1 -0
- package/dist/query.js +1 -2
- package/dist/recaptcha.d.ts +6 -0
- package/dist/recaptcha.d.ts.map +1 -0
- package/dist/rules.d.ts +221 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/scoped-client-key.d.ts +9 -0
- package/dist/scoped-client-key.d.ts.map +1 -0
- package/dist/sdk-call.d.ts +66 -0
- package/dist/sdk-call.d.ts.map +1 -0
- package/dist/sdk-client-store.d.ts +250 -0
- package/dist/sdk-client-store.d.ts.map +1 -0
- package/dist/server-actions.d.ts +2 -0
- package/dist/server-actions.d.ts.map +1 -0
- package/dist/server-query-client.d.ts +19 -0
- package/dist/server-query-client.d.ts.map +1 -0
- package/dist/{server-site-registry-CdBfczOj.d.ts → server-site-registry.d.ts} +7 -9
- package/dist/server-site-registry.d.ts.map +1 -0
- package/dist/{site.d.ts → server-site.d.ts} +11 -16
- package/dist/server-site.d.ts.map +1 -0
- package/dist/site-actions-store.d.ts +27 -0
- package/dist/site-actions-store.d.ts.map +1 -0
- package/dist/site.js +10 -10
- package/dist/site.js.map +1 -1
- package/dist/testing.d.ts +9 -12
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +7 -27
- package/dist/testing.js.map +1 -1
- package/dist/utils/batch-fetch.d.ts +7 -0
- package/dist/utils/batch-fetch.d.ts.map +1 -0
- package/llms.txt +71 -50
- package/package.json +34 -20
- package/dist/actions.d.ts +0 -2
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-HPQQYROJ.js.map +0 -1
- package/dist/chunk-KHFEDL47.js.map +0 -1
- package/dist/chunk-TQP67TGL.js.map +0 -1
- package/dist/chunk-WOHZDFJF.js.map +0 -1
- package/dist/chunk-ZUJZDRTP.js +0 -136
- package/dist/chunk-ZUJZDRTP.js.map +0 -1
- package/dist/query.d.ts +0 -31
- package/dist/site-BjSFqufX.d.ts +0 -469
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AugurAPI, BrandFolderTypes } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
3
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
|
+
export type BrandFolderApiClient = Pick<AugurAPI, "brandFolder">;
|
|
5
|
+
export interface BrandFolderActionsConfig {
|
|
6
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
7
|
+
cachePrefix?: string;
|
|
8
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
|
+
edgeCache?: EdgeCacheValue;
|
|
10
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
11
|
+
redisTtl?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface BrandFolderActions {
|
|
14
|
+
getCategories: (params?: BrandFolderTypes.CategoriesListParams) => Promise<ListResult>;
|
|
15
|
+
getCategory: (itemCategoryUid: number) => Promise<unknown>;
|
|
16
|
+
createFocus: (categoryId: string, data: Record<string, unknown>) => Promise<unknown | undefined>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates server-side brand-folder actions with Redis caching and edge cache support.
|
|
20
|
+
*
|
|
21
|
+
* Covers the Brand Folder service endpoints: category listing, category detail,
|
|
22
|
+
* and category focus creation.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { createBrandFolderActions } from "@simpleapps-com/augur-server";
|
|
27
|
+
* import { getAugurClient } from "./augur-client";
|
|
28
|
+
*
|
|
29
|
+
* export const brandFolderActions = createBrandFolderActions(getAugurClient(), {
|
|
30
|
+
* cachePrefix: "example:",
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* const categories = await brandFolderActions.getCategories();
|
|
34
|
+
* const category = await brandFolderActions.getCategory(123);
|
|
35
|
+
* const focus = await brandFolderActions.createFocus("cat-123", { focusLevel: "primary" });
|
|
36
|
+
* ``` */
|
|
37
|
+
export declare function createBrandFolderActions(api: BrandFolderApiClient, config?: BrandFolderActionsConfig): BrandFolderActions;
|
|
38
|
+
//# sourceMappingURL=brand-folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-folder.d.ts","sourceRoot":"","sources":["../../src/actions/brand-folder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAEjE,MAAM,WAAW,wBAAwB;IACvC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,oBAAoB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACvF,WAAW,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CAClG;AAED;;;;;;;;;;;;;;;;;;SAkBS;AACT,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,oBAAoB,EACzB,MAAM,GAAE,wBAA6B,GACpC,kBAAkB,CAyDpB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AugurAPI, CommerceTypes } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { TCartLine, TCartLookUp, TCheckoutResult } from "@simpleapps-com/augur-utils";
|
|
3
|
+
import type { ListResult } from "../sdk-call";
|
|
4
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
5
|
+
export type CommerceApiClient = Pick<AugurAPI, "commerce">;
|
|
6
|
+
export interface CommerceActionsConfig {
|
|
7
|
+
defaultContactId?: string | number;
|
|
8
|
+
defaultCustomerId?: string | number;
|
|
9
|
+
/** Optional UOM conversion function. E.g. (uom) => uom === "EA" ? "EACH" : uom */
|
|
10
|
+
convertUnitOfMeasure?: (uom: string) => string;
|
|
11
|
+
}
|
|
12
|
+
export interface CommerceActions {
|
|
13
|
+
cartHdrLookup: (params: {
|
|
14
|
+
userId?: string | number;
|
|
15
|
+
cartToken?: string;
|
|
16
|
+
contactId?: string | number;
|
|
17
|
+
customerId?: string | number;
|
|
18
|
+
}) => Promise<TCartLookUp | false>;
|
|
19
|
+
getCartLines: (cartHdrUid: number) => Promise<ListResult<TCartLine>>;
|
|
20
|
+
addToCart: (cartHdrUid: number, items: {
|
|
21
|
+
itemId?: string;
|
|
22
|
+
invMastUid: number;
|
|
23
|
+
quantity: number;
|
|
24
|
+
unitOfMeasure: string;
|
|
25
|
+
}[]) => Promise<unknown>;
|
|
26
|
+
updateCartLines: (cartHdrUid: number, lines: {
|
|
27
|
+
lineNo: number;
|
|
28
|
+
invMastUid: number;
|
|
29
|
+
quantity: number;
|
|
30
|
+
unitOfMeasure: string;
|
|
31
|
+
}[]) => Promise<unknown>;
|
|
32
|
+
deleteCartItems: (cartHdrUid: number) => Promise<void>;
|
|
33
|
+
getCartAlsoBought: (cartHdrUid: number) => Promise<ListResult<CommerceTypes.CartHdrAlsoBoughtListItem>>;
|
|
34
|
+
checkoutOrder: (cartHdrUid: number, data: Record<string, unknown>) => Promise<TCheckoutResult>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates server-side commerce actions for cart operations.
|
|
38
|
+
*
|
|
39
|
+
* Unlike pricing actions, commerce actions do NOT use caching because
|
|
40
|
+
* cart operations are real-time and must always reflect current state.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // lib/commerce-actions.ts
|
|
45
|
+
* import { createCommerceActions } from "@simpleapps-com/augur-server";
|
|
46
|
+
* import { getAugurClient } from "./augur-client";
|
|
47
|
+
*
|
|
48
|
+
* export const commerceActions = createCommerceActions(getAugurClient(), {
|
|
49
|
+
* // defaultContactId/defaultCustomerId fall back to env vars automatically
|
|
50
|
+
* convertUnitOfMeasure: (uom) => uom === "EA" ? "EACH" : uom,
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // In a server action:
|
|
54
|
+
* const cart = await commerceActions.cartHdrLookup({ userId: 123 });
|
|
55
|
+
* const lines = await commerceActions.getCartLines(cart.cartHdrUid);
|
|
56
|
+
* ``` */
|
|
57
|
+
export declare function createCommerceActions(api: CommerceApiClient, config?: CommerceActionsConfig): CommerceActions;
|
|
58
|
+
//# sourceMappingURL=commerce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce.d.ts","sourceRoot":"","sources":["../../src/actions/commerce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MA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,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;KACvB,EAAE,KACA,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtB,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD,iBAAiB,EAAE,CACjB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAElE,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CAChG;AAED;;;;;;;;;;;;;;;;;;;;SAoBS;AACT,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,iBAAiB,EACtB,MAAM,GAAE,qBAA0B,GACjC,eAAe,CAkGjB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AugurAPI, CustomersTypes } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { CustomerDocument } from "@simpleapps-com/augur-utils";
|
|
3
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
4
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
5
|
+
export type CustomersApiClient = Pick<AugurAPI, "customers">;
|
|
6
|
+
export interface CustomersActionsConfig {
|
|
7
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
8
|
+
cachePrefix?: string;
|
|
9
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
10
|
+
edgeCache?: EdgeCacheValue;
|
|
11
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
12
|
+
redisTtl?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CustomersActions {
|
|
15
|
+
customerLookup: (params: CustomersTypes.CustomerLookupGetParams) => Promise<ListResult<CustomersTypes.CustomerLookupGetItem>>;
|
|
16
|
+
getCustomerDoc: (customerId: number) => Promise<CustomerDocument>;
|
|
17
|
+
getCustomerOrders: (customerId: number, params?: CustomersTypes.CustomerOrdersListParams) => Promise<ListResult>;
|
|
18
|
+
getCustomerOrderDetail: (customerId: number, orderId: number) => Promise<unknown>;
|
|
19
|
+
getCustomerInvoices: (customerId: number, params?: CustomersTypes.CustomerInvoicesListParams) => Promise<ListResult>;
|
|
20
|
+
getCustomerInvoiceDetail: (customerId: number, invoiceNo: number) => Promise<unknown>;
|
|
21
|
+
getCustomerQuotes: (customerId: number, params?: Record<string, unknown>) => Promise<ListResult>;
|
|
22
|
+
getCustomerQuoteDetail: (customerId: number, quoteNo: number) => Promise<unknown>;
|
|
23
|
+
getShipToAddresses: (customerId: number) => Promise<ListResult>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates server-side customer actions with Redis caching and edge cache support.
|
|
27
|
+
*
|
|
28
|
+
* Covers the customers microservice endpoints used by ecommerce sites:
|
|
29
|
+
* customer lookup, doc, orders, invoices, quotes, and ship-to addresses.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { createCustomersActions } from "@simpleapps-com/augur-server";
|
|
34
|
+
* import { getAugurClient } from "./augur-client";
|
|
35
|
+
*
|
|
36
|
+
* export const customersActions = createCustomersActions(getAugurClient(), {
|
|
37
|
+
* cachePrefix: "example:",
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* const customer = await customersActions.getCustomerDoc(123);
|
|
41
|
+
* const orders = await customersActions.getCustomerOrders(123);
|
|
42
|
+
* ``` */
|
|
43
|
+
export declare function createCustomersActions(api: CustomersApiClient, config?: CustomersActionsConfig): CustomersActions;
|
|
44
|
+
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/actions/customers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,2BAA2B,C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AU,CAAC,CAAC;IACjG,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClF,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;SAiBS;AACT,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,EACvB,MAAM,GAAE,sBAA2B,GAClC,gBAAgB,CA0KlB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
3
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
|
+
export type FavoritesApiClient = Pick<AugurAPI, "items">;
|
|
5
|
+
export interface FavoritesActionsConfig {
|
|
6
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
7
|
+
cachePrefix?: string;
|
|
8
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
|
+
edgeCache?: EdgeCacheValue;
|
|
10
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
11
|
+
redisTtl?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FavoritesActions {
|
|
14
|
+
getFavorites: (userId: number) => Promise<ListResult>;
|
|
15
|
+
addFavorite: (userId: number, invMastUid: number) => Promise<unknown>;
|
|
16
|
+
removeFavorite: (userId: number, invMastUid: number) => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/** Creates server-side favorites actions with Redis caching and edge cache support. */
|
|
19
|
+
export declare function createFavoritesActions(api: FavoritesApiClient, config?: FavoritesActionsConfig): FavoritesActions;
|
|
20
|
+
//# sourceMappingURL=favorites.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favorites.d.ts","sourceRoot":"","sources":["../../src/actions/favorites.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACrC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACtD,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,EACvB,MAAM,GAAE,sBAA2B,GAClC,gBAAgB,CA4BlB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
3
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
|
+
export type GregorovichApiClient = Pick<AugurAPI, "gregorovich">;
|
|
5
|
+
export interface GregorovichActionsConfig {
|
|
6
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
7
|
+
cachePrefix?: string;
|
|
8
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
|
+
edgeCache?: EdgeCacheValue;
|
|
10
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
11
|
+
redisTtl?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface GregorovichActions {
|
|
14
|
+
getDocuments: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates server-side gregorovich actions with Redis caching and edge cache support.
|
|
18
|
+
*
|
|
19
|
+
* Covers the Gregorovich service's document listing, the only endpoint the SDK
|
|
20
|
+
* exposes since augur-api 2026.10.8.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { createGregorovichActions } from "@simpleapps-com/augur-server";
|
|
25
|
+
* import { getAugurClient } from "./augur-client";
|
|
26
|
+
*
|
|
27
|
+
* export const gregorovichActions = createGregorovichActions(getAugurClient(), {
|
|
28
|
+
* cachePrefix: "example:",
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* const docs = await gregorovichActions.getDocuments();
|
|
32
|
+
* ``` */
|
|
33
|
+
export declare function createGregorovichActions(api: GregorovichApiClient, config?: GregorovichActionsConfig): GregorovichActions;
|
|
34
|
+
//# sourceMappingURL=gregorovich.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gregorovich.d.ts","sourceRoot":"","sources":["../../src/actions/gregorovich.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAEjE,MAAM,WAAW,wBAAwB;IACvC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACzE;AAED;;;;;;;;;;;;;;;;SAgBS;AACT,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,oBAAoB,EACzB,MAAM,GAAE,wBAA6B,GACpC,kBAAkB,CAqBpB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { GetItemCategoryApiOptions } from "@simpleapps-com/augur-hooks";
|
|
3
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
4
|
+
import type { TAttribute, TCategory, TCategoryItemsResult, TInvMast, TInvMastDoc, TItemAccessory, TItemsFilters, TProductItem, TStock } from "@simpleapps-com/augur-utils";
|
|
5
|
+
import type { PaginatedResult } from "../pagination";
|
|
6
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
7
|
+
export type ItemsApiClient = Pick<AugurAPI, "items">;
|
|
8
|
+
export interface ItemActionsConfig {
|
|
9
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
10
|
+
cachePrefix?: string;
|
|
11
|
+
/** CDN edge cache value for most calls. Default: 1 (hour). */
|
|
12
|
+
edgeCache?: EdgeCacheValue;
|
|
13
|
+
/** CDN edge cache for rarely-changing data like FAQs. Default: 8 (hours). */
|
|
14
|
+
longEdgeCache?: EdgeCacheValue;
|
|
15
|
+
/** Redis TTL for most calls in seconds. Default: 3600 (1 hour). */
|
|
16
|
+
redisTtl?: number;
|
|
17
|
+
/** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
|
|
18
|
+
longRedisTtl?: number;
|
|
19
|
+
/** Sort category children by sequenceNo. Default: true. */
|
|
20
|
+
sortChildren?: boolean;
|
|
21
|
+
/** Prefix prepended to sortBy filter values (e.g. "item_category_sequence_no_min|"). */
|
|
22
|
+
sortByPrefix?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Typed options for getItemCategory: the same options augur-hooks passes for a category. */
|
|
25
|
+
type GetItemCategoryOptions = GetItemCategoryApiOptions;
|
|
26
|
+
export interface ItemActions {
|
|
27
|
+
itemCategoryLookup: (path: string) => Promise<unknown>;
|
|
28
|
+
getItemCategory: (uid: number, options?: GetItemCategoryOptions) => Promise<TCategory>;
|
|
29
|
+
getCategoryItems: {
|
|
30
|
+
(uid: number, filters: Record<string, unknown>): Promise<TCategoryItemsResult>;
|
|
31
|
+
(uid: number, itemsFilters: TItemsFilters): Promise<TCategoryItemsResult>;
|
|
32
|
+
};
|
|
33
|
+
getCategoryItemsInfinite: (uid: number, itemsFilters?: TItemsFilters, pageParam?: number) => Promise<PaginatedResult<TProductItem>>;
|
|
34
|
+
getItemAttributes: (categoryUid: number) => Promise<{
|
|
35
|
+
attributes: TAttribute[];
|
|
36
|
+
}>;
|
|
37
|
+
getInvMast: (uid: number) => Promise<TInvMast>;
|
|
38
|
+
getInvMastDoc: {
|
|
39
|
+
(params: {
|
|
40
|
+
invMastUid?: number;
|
|
41
|
+
itemId?: string;
|
|
42
|
+
includePricing?: "Y" | "N";
|
|
43
|
+
}): Promise<TInvMastDoc>;
|
|
44
|
+
(invMastUid: number, itemId?: string, includePricing?: "Y" | "N"): Promise<TInvMastDoc>;
|
|
45
|
+
};
|
|
46
|
+
getStock: (invMastUid: number) => Promise<TStock>;
|
|
47
|
+
getStockCompanySummary: (invMastUid: number) => Promise<Record<string, number>>;
|
|
48
|
+
getItemFaqs: (invMastUid: number) => Promise<ListResult>;
|
|
49
|
+
getItemSubstitutes: (invMastUid: number) => Promise<ListResult>;
|
|
50
|
+
getItemAccessories: (invMastUid: number) => Promise<ListResult<TItemAccessory>>;
|
|
51
|
+
getSimilarItems: (invMastUid: number) => Promise<ListResult>;
|
|
52
|
+
batchGetInvMastDocs: (params: {
|
|
53
|
+
invMastUid?: number;
|
|
54
|
+
itemId?: string;
|
|
55
|
+
}[]) => Promise<Record<string, TInvMastDoc>>;
|
|
56
|
+
batchGetStockData: (invMastUids: number[]) => Promise<Record<number, TStock>>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Creates server-side item actions with Redis caching and edge cache support.
|
|
60
|
+
*
|
|
61
|
+
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
62
|
+
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* // lib/item-actions.ts
|
|
67
|
+
* import { createItemActions } from "@simpleapps-com/augur-server";
|
|
68
|
+
* import { getAugurClient } from "./augur-client";
|
|
69
|
+
*
|
|
70
|
+
* export const itemActions = createItemActions(getAugurClient(), {
|
|
71
|
+
* cachePrefix: "example:",
|
|
72
|
+
* });
|
|
73
|
+
*
|
|
74
|
+
* // In a server component:
|
|
75
|
+
* const category = await itemActions.getItemCategory(123);
|
|
76
|
+
* const doc = await itemActions.getInvMastDoc({ itemId: "ITEM-1" });
|
|
77
|
+
* ``` */
|
|
78
|
+
export declare function createItemActions(api: ItemsApiClient, config?: ItemActionsConfig): ItemActions;
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../src/actions/items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,aAAa,E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E,KAC/C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAC1C,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/E;AAED;;;;;;;;;;;;;;;;;;;SAmBS;AACT,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,cAAc,EACnB,MAAM,GAAE,iBAAsB,GAC7B,WAAW,CAyWb"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { MenuItem, TJoomlaContent, TMenu, TPasswordVerification } from "@simpleapps-com/augur-utils";
|
|
3
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
4
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
5
|
+
export type JoomlaApiClient = Pick<AugurAPI, "joomla">;
|
|
6
|
+
export interface JoomlaActionsConfig {
|
|
7
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
8
|
+
cachePrefix?: string;
|
|
9
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
10
|
+
edgeCache?: EdgeCacheValue;
|
|
11
|
+
/** Redis TTL for Joomla lookups in seconds. Default: 3600 (1 hour). */
|
|
12
|
+
redisTtl?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface NormalizedUserProfile {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
email: string;
|
|
18
|
+
customerId: string;
|
|
19
|
+
permissions: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface JoomlaActions {
|
|
22
|
+
getJoomlaContent: {
|
|
23
|
+
(articleId: number): Promise<TJoomlaContent>;
|
|
24
|
+
(articleId: number | string, options: {
|
|
25
|
+
alias: string;
|
|
26
|
+
catId?: number;
|
|
27
|
+
}): Promise<TJoomlaContent>;
|
|
28
|
+
};
|
|
29
|
+
getJoomlaContentList: (params?: Record<string, unknown>) => Promise<ListResult<TJoomlaContent>>;
|
|
30
|
+
getJoomlaMenu: {
|
|
31
|
+
(params?: Record<string, unknown>): Promise<ListResult<TMenu>>;
|
|
32
|
+
(parentId: number, menuType: string): Promise<ListResult<TMenu>>;
|
|
33
|
+
};
|
|
34
|
+
getJoomlaMenuDoc: (menuId: number | string) => Promise<MenuItem>;
|
|
35
|
+
getUserProfile: (userId: number | string) => Promise<NormalizedUserProfile>;
|
|
36
|
+
verifyPassword: (username: string, password: string) => Promise<TPasswordVerification>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Creates server-side Joomla content actions with Redis caching and edge cache support.
|
|
40
|
+
*
|
|
41
|
+
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
42
|
+
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* // lib/joomla-actions.ts
|
|
47
|
+
* import { createJoomlaActions } from "@simpleapps-com/augur-server";
|
|
48
|
+
* import { getAugurClient } from "./augur-client";
|
|
49
|
+
*
|
|
50
|
+
* export const joomlaActions = createJoomlaActions(getAugurClient(), {
|
|
51
|
+
* cachePrefix: "example:",
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* // In a server component:
|
|
55
|
+
* const article = await joomlaActions.getJoomlaContent(42);
|
|
56
|
+
* const articles = await joomlaActions.getJoomlaContentList({ catid: 5 });
|
|
57
|
+
* ``` */
|
|
58
|
+
export declare function createJoomlaActions(api: JoomlaApiClient, config?: JoomlaActionsConfig): JoomlaActions;
|
|
59
|
+
//# sourceMappingURL=joomla.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joomla.d.ts","sourceRoot":"","sources":["../../src/actions/joomla.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D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,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;KAClE,CAAC;IACF,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC5E,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACxF;AAED;;;;;;;;;;;;;;;;;;;SAmBS;AACT,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,eAAe,EACpB,MAAM,GAAE,mBAAwB,GAC/B,aAAa,CAoKf"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AugurAPI, LegacyTypes } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { TWebDesc } from "@simpleapps-com/augur-utils";
|
|
3
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
4
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
5
|
+
export type LegacyApiClient = Pick<AugurAPI, "legacy">;
|
|
6
|
+
export interface LegacyActionsConfig {
|
|
7
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
8
|
+
cachePrefix?: string;
|
|
9
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
10
|
+
edgeCache?: EdgeCacheValue;
|
|
11
|
+
/** CDN edge cache for rarely-changing data like states. Default: 8 (hours). */
|
|
12
|
+
longEdgeCache?: EdgeCacheValue;
|
|
13
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
14
|
+
redisTtl?: number;
|
|
15
|
+
/** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
|
|
16
|
+
longRedisTtl?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface LegacyActions {
|
|
19
|
+
getItemWebDesc: (invMastUid: number) => Promise<TWebDesc | undefined>;
|
|
20
|
+
getAlsoBoughtItems: (invMastUid: number) => Promise<ListResult<LegacyTypes.InvMastAlsoBoughtListItem>>;
|
|
21
|
+
getItemTags: (invMastUid: number) => Promise<ListResult>;
|
|
22
|
+
getStates: (params?: {
|
|
23
|
+
twoLetterCode?: string;
|
|
24
|
+
}) => Promise<ListResult>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates server-side legacy actions with Redis caching and edge cache support.
|
|
28
|
+
*
|
|
29
|
+
* Covers the legacy microservice endpoints used by ecommerce sites:
|
|
30
|
+
* webDesc, alsoBought, tags, and states.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { createLegacyActions } from "@simpleapps-com/augur-server";
|
|
35
|
+
* import { getAugurClient } from "./augur-client";
|
|
36
|
+
*
|
|
37
|
+
* export const legacyActions = createLegacyActions(getAugurClient(), {
|
|
38
|
+
* cachePrefix: "example:",
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* const webDesc = await legacyActions.getItemWebDesc(12345);
|
|
42
|
+
* const states = await legacyActions.getStates();
|
|
43
|
+
* ``` */
|
|
44
|
+
export declare function createLegacyActions(api: LegacyApiClient, config?: LegacyActionsConfig): LegacyActions;
|
|
45
|
+
//# sourceMappingURL=legacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../src/actions/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IACtE,kBAAkB,EAAE,CAClB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAChE,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACzD,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACzE;AAED;;;;;;;;;;;;;;;;;SAiBS;AACT,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,eAAe,EACpB,MAAM,GAAE,mBAAwB,GAC/B,aAAa,CA4Ef"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AugurAPI, LogisticsTypes } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
3
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
|
+
export type LogisticsApiClient = Pick<AugurAPI, "logistics">;
|
|
5
|
+
export interface LogisticsActionsConfig {
|
|
6
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
7
|
+
cachePrefix?: string;
|
|
8
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
|
+
edgeCache?: EdgeCacheValue;
|
|
10
|
+
/** CDN edge cache for rarely-changing data like ship-via options. Default: 8 (hours). */
|
|
11
|
+
longEdgeCache?: EdgeCacheValue;
|
|
12
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
13
|
+
redisTtl?: number;
|
|
14
|
+
/** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
|
|
15
|
+
longRedisTtl?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface LogisticsActions {
|
|
18
|
+
getFreightRates: (params: LogisticsTypes.SpeedshipFreightListParams) => Promise<ListResult>;
|
|
19
|
+
getShipVia: (params: LogisticsTypes.ShipviaRatesListParams) => Promise<ListResult>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates server-side logistics actions with selective Redis caching.
|
|
23
|
+
*
|
|
24
|
+
* Freight rate lookups are real-time and NOT cached.
|
|
25
|
+
* Ship-via carrier options rarely change and ARE cached with long TTL.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { createLogisticsActions } from "@simpleapps-com/augur-server";
|
|
30
|
+
* import { getAugurClient } from "./augur-client";
|
|
31
|
+
*
|
|
32
|
+
* export const logisticsActions = createLogisticsActions(getAugurClient(), {
|
|
33
|
+
* cachePrefix: "example:",
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* const rates = await logisticsActions.getFreightRates({ fromPostalCode: "90210" });
|
|
37
|
+
* const carriers = await logisticsActions.getShipVia();
|
|
38
|
+
* ``` */
|
|
39
|
+
export declare function createLogisticsActions(api: LogisticsApiClient, config?: LogisticsActionsConfig): LogisticsActions;
|
|
40
|
+
//# sourceMappingURL=logistics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logistics.d.ts","sourceRoot":"","sources":["../../src/actions/logistics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,yFAAyF;IACzF,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,0BAA0B,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5F,UAAU,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,sBAAsB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACpF;AAED;;;;;;;;;;;;;;;;;SAiBS;AACT,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,kBAAkB,EACvB,MAAM,GAAE,sBAA2B,GAClC,gBAAgB,CAkClB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { EdgeCacheValue } from "../sdk-call";
|
|
3
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
|
+
export type OrderApiClient = Pick<AugurAPI, "orders">;
|
|
5
|
+
export interface OrderActionsConfig {
|
|
6
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
7
|
+
cachePrefix?: string;
|
|
8
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
|
+
edgeCache?: EdgeCacheValue;
|
|
10
|
+
/** Redis TTL for order doc lookups in seconds. Default: 3600 (1 hour). */
|
|
11
|
+
redisTtl?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface OrderActions {
|
|
14
|
+
getOrderDoc: (orderNo: string, postalCode: string) => Promise<unknown>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates server-side order actions with Redis caching and edge cache support.
|
|
18
|
+
*
|
|
19
|
+
* Uses `withServerCache` which produces cache keys compatible with augur-hooks'
|
|
20
|
+
* `withCache`, so server-prefetched data is shared with client-side hooks.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* // lib/order-actions.ts
|
|
25
|
+
* import { createOrderActions } from "@simpleapps-com/augur-server";
|
|
26
|
+
* import { getAugurClient } from "./augur-client";
|
|
27
|
+
*
|
|
28
|
+
* export const orderActions = createOrderActions(getAugurClient(), {
|
|
29
|
+
* cachePrefix: "example:",
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // In a server component:
|
|
33
|
+
* const doc = await orderActions.getOrderDoc("12345", "90210");
|
|
34
|
+
* ``` */
|
|
35
|
+
export declare function createOrderActions(api: OrderApiClient, config?: OrderActionsConfig): OrderActions;
|
|
36
|
+
//# sourceMappingURL=orders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/actions/orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,sEAAsE;AACtE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AAED;;;;;;;;;;;;;;;;;;SAkBS;AACT,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,MAAM,GAAE,kBAAuB,GAC9B,YAAY,CAqBd"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AugurAPI, P21ApisTypes } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { EdgeCacheValue } from "../sdk-call";
|
|
3
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
|
+
export type P21ApisApiClient = Pick<AugurAPI, "p21Apis">;
|
|
5
|
+
export interface P21ApisActionsConfig {
|
|
6
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
7
|
+
cachePrefix?: string;
|
|
8
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
|
+
edgeCache?: EdgeCacheValue;
|
|
10
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
11
|
+
redisTtl?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface P21ApisActions {
|
|
14
|
+
refreshContacts: (params?: P21ApisTypes.EntityContactsRefreshGetParams) => Promise<unknown | undefined>;
|
|
15
|
+
refreshCustomers: (params?: P21ApisTypes.EntityCustomersRefreshGetParams) => Promise<unknown | undefined>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates server-side P21 APIs actions.
|
|
19
|
+
*
|
|
20
|
+
* Covers the P21 APIs microservice entity refresh triggers. Refreshes are
|
|
21
|
+
* never cached, so the cache config is accepted for API symmetry only.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { createP21ApisActions } from "@simpleapps-com/augur-server";
|
|
26
|
+
* import { getAugurClient } from "./augur-client";
|
|
27
|
+
*
|
|
28
|
+
* export const p21ApisActions = createP21ApisActions(getAugurClient());
|
|
29
|
+
*
|
|
30
|
+
* await p21ApisActions.refreshContacts();
|
|
31
|
+
* ``` */
|
|
32
|
+
export declare function createP21ApisActions(api: P21ApisApiClient, _config?: P21ApisActionsConfig): P21ApisActions;
|
|
33
|
+
//# sourceMappingURL=p21-apis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p21-apis.d.ts","sourceRoot":"","sources":["../../src/actions/p21-apis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,CACf,MAAM,CAAC,EAAE,YAAY,CAAC,8BAA8B,KACjD,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAClC,gBAAgB,EAAE,CAChB,MAAM,CAAC,EAAE,YAAY,CAAC,+BAA+B,KAClD,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;;;;SAcS;AACT,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,gBAAgB,EACrB,OAAO,GAAE,oBAAyB,GACjC,cAAc,CA2BhB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AugurAPI } from "@simpleapps-com/augur-api";
|
|
2
|
+
import type { EdgeCacheValue, ListResult } from "../sdk-call";
|
|
3
|
+
/** Derived from augur-api SDK — keeps types in sync automatically. */
|
|
4
|
+
export type P21CoreApiClient = Pick<AugurAPI, "p21Core">;
|
|
5
|
+
export interface P21CoreActionsConfig {
|
|
6
|
+
/** Cache key prefix (e.g. "example:"). Default: "". */
|
|
7
|
+
cachePrefix?: string;
|
|
8
|
+
/** CDN edge cache value passed to SDK. Default: 1 (hour). */
|
|
9
|
+
edgeCache?: EdgeCacheValue;
|
|
10
|
+
/** CDN edge cache for rarely-changing data. Default: 8 (hours). */
|
|
11
|
+
longEdgeCache?: EdgeCacheValue;
|
|
12
|
+
/** Redis TTL in seconds. Default: 3600 (1 hour). */
|
|
13
|
+
redisTtl?: number;
|
|
14
|
+
/** Redis TTL for rarely-changing data in seconds. Default: 28800 (8 hours). */
|
|
15
|
+
longRedisTtl?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface P21CoreActions {
|
|
18
|
+
getAddresses: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
19
|
+
getCompanies: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
20
|
+
/** `companyId` is the P21 company ID string (e.g. "EXAMPLE"), per the SDK. */
|
|
21
|
+
getCompany: (companyId: string) => Promise<unknown | undefined>;
|
|
22
|
+
getLocations: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
23
|
+
getPaymentTypes: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
24
|
+
getCashDrawers: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
25
|
+
getCodeP21: (params?: Record<string, unknown>) => Promise<ListResult>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Creates server-side P21 Core actions with Redis caching and edge cache support.
|
|
29
|
+
*
|
|
30
|
+
* Covers the P21 Core microservice endpoints: addresses, companies,
|
|
31
|
+
* locations, payment types, cash drawers, and P21 codes.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { createP21CoreActions } from "@simpleapps-com/augur-server";
|
|
36
|
+
* import { getAugurClient } from "./augur-client";
|
|
37
|
+
*
|
|
38
|
+
* export const p21CoreActions = createP21CoreActions(getAugurClient(), {
|
|
39
|
+
* cachePrefix: "example:",
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* const companies = await p21CoreActions.getCompanies();
|
|
43
|
+
* const company = await p21CoreActions.getCompany("EXAMPLE");
|
|
44
|
+
* ``` */
|
|
45
|
+
export declare function createP21CoreActions(api: P21CoreApiClient, config?: P21CoreActionsConfig): P21CoreActions;
|
|
46
|
+
//# sourceMappingURL=p21-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p21-core.d.ts","sourceRoot":"","sources":["../../src/actions/p21-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9D,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,mEAAmE;IACnE,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACxE,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,E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