@simpleapps-com/augur-server 2.2.29 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EXPORTS.md +18 -137
- package/README.md +18 -172
- package/dist/actions.d.ts +0 -320
- package/dist/actions.js +0 -552
- package/dist/actions.js.map +1 -1
- package/dist/{chunk-4OK7EWLJ.js → chunk-WOHZDFJF.js} +1 -1
- package/dist/chunk-WOHZDFJF.js.map +1 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/{server-site-registry-vsuD5FAk.d.ts → server-site-registry-CdBfczOj.d.ts} +1 -1
- package/dist/{site-BdJFUwsM.d.ts → site-BjSFqufX.d.ts} +156 -3
- package/dist/site.d.ts +1 -2
- package/dist/site.js +1 -1
- package/dist/testing.d.ts +2 -3
- package/dist/testing.js +1 -1
- package/llms.txt +21 -136
- package/package.json +5 -5
- package/dist/chunk-4OK7EWLJ.js.map +0 -1
- package/dist/smarty-streets-BnEIKoi8.d.ts +0 -158
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { ListResult } from '@simpleapps-com/augur-core';
|
|
2
|
-
import { TCategory, TCategoryItemsResult, TItemsFilters, TProductItem, TAttribute, TInvMast, TInvMastDoc, TStock, TItemAccessory, TSearchSuggestionsResponse, TShippingMethod, TJoomlaContent, TMenu, MenuItem, TPasswordVerification, TSmartyStreets } from '@simpleapps-com/augur-utils';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Standardized paginated response shape.
|
|
6
|
-
* Works with any factory method — compose with `paginateOffset()`.
|
|
7
|
-
*/
|
|
8
|
-
interface PaginatedResult<T> {
|
|
9
|
-
data: T[];
|
|
10
|
-
total: number;
|
|
11
|
-
nextCursor?: number;
|
|
12
|
-
hasMore: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Wraps a list of items with offset-based pagination metadata.
|
|
16
|
-
*
|
|
17
|
-
* Use this to standardize pagination responses from any factory method.
|
|
18
|
-
* Compatible with React Query's infinite query pattern (`getNextPageParam`).
|
|
19
|
-
*
|
|
20
|
-
* @param items - The items returned from the current page
|
|
21
|
-
* @param pageParam - The current page number (0-based)
|
|
22
|
-
* @param limit - The page size
|
|
23
|
-
* @param total - Optional total count of items (from API response)
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```ts
|
|
27
|
-
* const result = await actions.items.getCategoryItems(uid, {
|
|
28
|
-
* ...filters, offset: page * 24, limit: 24,
|
|
29
|
-
* });
|
|
30
|
-
* return paginateOffset(result.items, page, 24, result.total);
|
|
31
|
-
* // { data: [...], total: 150, nextCursor: 1, hasMore: true }
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
declare function paginateOffset<T>(items: T[], pageParam: number, limit: number, total?: number): PaginatedResult<T>;
|
|
35
|
-
|
|
36
|
-
/** Typed options for getItemCategory. */
|
|
37
|
-
interface GetItemCategoryOptions {
|
|
38
|
-
childrenFilter?: string;
|
|
39
|
-
childrenLimit?: number;
|
|
40
|
-
childrenOffset?: number;
|
|
41
|
-
classId5List?: string;
|
|
42
|
-
filters?: Record<string, string>;
|
|
43
|
-
orderBy?: string;
|
|
44
|
-
path?: string;
|
|
45
|
-
productCollection?: string;
|
|
46
|
-
rootItemCategoryId?: string;
|
|
47
|
-
}
|
|
48
|
-
interface ItemActions {
|
|
49
|
-
itemCategoryLookup: (path: string) => Promise<unknown>;
|
|
50
|
-
getItemCategory: (uid: number, options?: GetItemCategoryOptions) => Promise<TCategory>;
|
|
51
|
-
getCategoryItems: {
|
|
52
|
-
(uid: number, filters: Record<string, unknown>): Promise<TCategoryItemsResult>;
|
|
53
|
-
(uid: number, itemsFilters: TItemsFilters): Promise<TCategoryItemsResult>;
|
|
54
|
-
};
|
|
55
|
-
getCategoryItemsInfinite: (uid: number, itemsFilters?: TItemsFilters, pageParam?: number) => Promise<PaginatedResult<TProductItem>>;
|
|
56
|
-
getItemAttributes: (categoryUid: number) => Promise<{
|
|
57
|
-
attributes: TAttribute[];
|
|
58
|
-
}>;
|
|
59
|
-
getInvMast: (uid: number) => Promise<TInvMast>;
|
|
60
|
-
getInvMastDoc: {
|
|
61
|
-
(params: {
|
|
62
|
-
invMastUid?: number;
|
|
63
|
-
itemId?: string;
|
|
64
|
-
includePricing?: "Y" | "N";
|
|
65
|
-
}): Promise<TInvMastDoc>;
|
|
66
|
-
(invMastUid: number, itemId?: string, includePricing?: "Y" | "N"): Promise<TInvMastDoc>;
|
|
67
|
-
};
|
|
68
|
-
getStock: (invMastUid: number) => Promise<TStock>;
|
|
69
|
-
getStockCompanySummary: (invMastUid: number) => Promise<Record<string, number>>;
|
|
70
|
-
getItemFaqs: (invMastUid: number) => Promise<ListResult>;
|
|
71
|
-
getItemSubstitutes: (invMastUid: number) => Promise<ListResult>;
|
|
72
|
-
getItemAccessories: (invMastUid: number) => Promise<ListResult<TItemAccessory>>;
|
|
73
|
-
getSimilarItems: (invMastUid: number) => Promise<ListResult>;
|
|
74
|
-
batchGetInvMastDocs: (params: {
|
|
75
|
-
invMastUid?: number;
|
|
76
|
-
itemId?: string;
|
|
77
|
-
}[]) => Promise<Record<string, TInvMastDoc>>;
|
|
78
|
-
batchGetStockData: (invMastUids: number[]) => Promise<Record<number, TStock>>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Paginated response for infinite scroll. */
|
|
82
|
-
interface SearchPage {
|
|
83
|
-
data: TProductItem[];
|
|
84
|
-
total: number;
|
|
85
|
-
nextCursor?: number;
|
|
86
|
-
}
|
|
87
|
-
interface SearchActions {
|
|
88
|
-
getSearchAttributes: (q: string) => Promise<{
|
|
89
|
-
attributes: TAttribute[];
|
|
90
|
-
}>;
|
|
91
|
-
getSearchSuggestions: (q: string, limit?: number, offset?: number) => Promise<TSearchSuggestionsResponse>;
|
|
92
|
-
itemSearch: (filters: {
|
|
93
|
-
q: string;
|
|
94
|
-
limit: number;
|
|
95
|
-
offset: number;
|
|
96
|
-
sortBy?: string;
|
|
97
|
-
filters?: [string, string][];
|
|
98
|
-
}, itemCategoryUid?: number | string) => Promise<{
|
|
99
|
-
items: TProductItem[];
|
|
100
|
-
totalResults: number;
|
|
101
|
-
}>;
|
|
102
|
-
itemSearchInfinite: (filters: {
|
|
103
|
-
q: string;
|
|
104
|
-
limit: number;
|
|
105
|
-
sortBy?: string;
|
|
106
|
-
filters?: [string, string][];
|
|
107
|
-
}, itemCategoryUid?: number | string, pageParam?: number) => Promise<SearchPage>;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
interface ShippingAddress {
|
|
111
|
-
address1: string;
|
|
112
|
-
city: string;
|
|
113
|
-
state: string;
|
|
114
|
-
postalCode: string;
|
|
115
|
-
country?: string;
|
|
116
|
-
}
|
|
117
|
-
interface ShippingActions {
|
|
118
|
-
getShippingRates: (toAddress: ShippingAddress, weight: number, serviceCodes?: string[]) => Promise<ListResult<TShippingMethod>>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
interface NormalizedUserProfile {
|
|
122
|
-
id: string;
|
|
123
|
-
name: string;
|
|
124
|
-
email: string;
|
|
125
|
-
customerId: string;
|
|
126
|
-
permissions: string[];
|
|
127
|
-
}
|
|
128
|
-
interface JoomlaActions {
|
|
129
|
-
getJoomlaContent: {
|
|
130
|
-
(articleId: number): Promise<TJoomlaContent>;
|
|
131
|
-
(articleId: number | string, options: {
|
|
132
|
-
alias: string;
|
|
133
|
-
catId?: number;
|
|
134
|
-
}): Promise<TJoomlaContent>;
|
|
135
|
-
};
|
|
136
|
-
getJoomlaContentList: (params?: Record<string, unknown>) => Promise<ListResult<TJoomlaContent>>;
|
|
137
|
-
getJoomlaMenu: {
|
|
138
|
-
(params?: Record<string, unknown>): Promise<ListResult<TMenu>>;
|
|
139
|
-
(parentId: number, menuType: string): Promise<ListResult<TMenu>>;
|
|
140
|
-
};
|
|
141
|
-
getJoomlaMenuDoc: (menuId: number | string) => Promise<MenuItem>;
|
|
142
|
-
getUserProfile: (userId: number | string) => Promise<NormalizedUserProfile>;
|
|
143
|
-
verifyPassword: (username: string, password: string) => Promise<TPasswordVerification>;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/** Standardized response from address validation. */
|
|
147
|
-
interface AddressValidationResult {
|
|
148
|
-
data: TSmartyStreets | undefined;
|
|
149
|
-
status: "success" | "not_found" | "error";
|
|
150
|
-
error?: {
|
|
151
|
-
message: string;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
interface SmartyStreetsActions {
|
|
155
|
-
validateAddress: (params: Record<string, unknown>) => Promise<AddressValidationResult>;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export { type AddressValidationResult as A, type GetItemCategoryOptions as G, type ItemActions as I, type JoomlaActions as J, type NormalizedUserProfile as N, type PaginatedResult as P, type SearchActions as S, type ShippingActions as a, type SmartyStreetsActions as b, type ShippingAddress as c, type SearchPage as d, paginateOffset as p };
|