@simpleapps-com/augur-api 0.2.4 → 0.2.6

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.
Files changed (162) hide show
  1. package/README.md +197 -9
  2. package/dist/cjs/client.d.ts +36 -1
  3. package/dist/cjs/client.d.ts.map +1 -1
  4. package/dist/cjs/client.js +54 -1
  5. package/dist/cjs/client.js.map +1 -1
  6. package/dist/cjs/core/config.d.ts +24 -0
  7. package/dist/cjs/core/config.d.ts.map +1 -1
  8. package/dist/cjs/core/config.js +12 -1
  9. package/dist/cjs/core/config.js.map +1 -1
  10. package/dist/cjs/index.d.ts +2 -2
  11. package/dist/cjs/index.d.ts.map +1 -1
  12. package/dist/cjs/index.js +5 -2
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/services/agr-site/client.d.ts +522 -2
  15. package/dist/cjs/services/agr-site/client.d.ts.map +1 -1
  16. package/dist/cjs/services/agr-site/client.js +565 -12
  17. package/dist/cjs/services/agr-site/client.js.map +1 -1
  18. package/dist/cjs/services/p21-core/client.d.ts +627 -0
  19. package/dist/cjs/services/p21-core/client.d.ts.map +1 -0
  20. package/dist/cjs/services/p21-core/client.js +704 -0
  21. package/dist/cjs/services/p21-core/client.js.map +1 -0
  22. package/dist/cjs/services/p21-core/index.d.ts +3 -0
  23. package/dist/cjs/services/p21-core/index.d.ts.map +1 -0
  24. package/dist/cjs/services/p21-core/index.js +21 -0
  25. package/dist/cjs/services/p21-core/index.js.map +1 -0
  26. package/dist/cjs/services/p21-core/schemas/address.d.ts +88 -0
  27. package/dist/cjs/services/p21-core/schemas/address.d.ts.map +1 -0
  28. package/dist/cjs/services/p21-core/schemas/address.js +45 -0
  29. package/dist/cjs/services/p21-core/schemas/address.js.map +1 -0
  30. package/dist/cjs/services/p21-core/schemas/cash-drawer.d.ts +96 -0
  31. package/dist/cjs/services/p21-core/schemas/cash-drawer.d.ts.map +1 -0
  32. package/dist/cjs/services/p21-core/schemas/cash-drawer.js +39 -0
  33. package/dist/cjs/services/p21-core/schemas/cash-drawer.js.map +1 -0
  34. package/dist/cjs/services/p21-core/schemas/codes.d.ts +54 -0
  35. package/dist/cjs/services/p21-core/schemas/codes.d.ts.map +1 -0
  36. package/dist/cjs/services/p21-core/schemas/codes.js +25 -0
  37. package/dist/cjs/services/p21-core/schemas/codes.js.map +1 -0
  38. package/dist/cjs/services/p21-core/schemas/company.d.ts +80 -0
  39. package/dist/cjs/services/p21-core/schemas/company.d.ts.map +1 -0
  40. package/dist/cjs/services/p21-core/schemas/company.js +35 -0
  41. package/dist/cjs/services/p21-core/schemas/company.js.map +1 -0
  42. package/dist/cjs/services/p21-core/schemas/health.d.ts +46 -0
  43. package/dist/cjs/services/p21-core/schemas/health.d.ts.map +1 -0
  44. package/dist/cjs/services/p21-core/schemas/health.js +7 -0
  45. package/dist/cjs/services/p21-core/schemas/health.js.map +1 -0
  46. package/dist/cjs/services/p21-core/schemas/index.d.ts +8 -0
  47. package/dist/cjs/services/p21-core/schemas/index.d.ts.map +1 -0
  48. package/dist/cjs/services/p21-core/schemas/index.js +25 -0
  49. package/dist/cjs/services/p21-core/schemas/index.js.map +1 -0
  50. package/dist/cjs/services/p21-core/schemas/location.d.ts +84 -0
  51. package/dist/cjs/services/p21-core/schemas/location.d.ts.map +1 -0
  52. package/dist/cjs/services/p21-core/schemas/location.js +35 -0
  53. package/dist/cjs/services/p21-core/schemas/location.js.map +1 -0
  54. package/dist/cjs/services/p21-core/schemas/payment-types.d.ts +39 -0
  55. package/dist/cjs/services/p21-core/schemas/payment-types.d.ts.map +1 -0
  56. package/dist/cjs/services/p21-core/schemas/payment-types.js +26 -0
  57. package/dist/cjs/services/p21-core/schemas/payment-types.js.map +1 -0
  58. package/dist/cjs/services/p21-core/schemas.d.ts +2 -0
  59. package/dist/cjs/services/p21-core/schemas.d.ts.map +1 -0
  60. package/dist/cjs/services/p21-core/schemas.js +19 -0
  61. package/dist/cjs/services/p21-core/schemas.js.map +1 -0
  62. package/dist/cjs/services/vmi/client.d.ts +501 -1
  63. package/dist/cjs/services/vmi/client.d.ts.map +1 -1
  64. package/dist/cjs/services/vmi/client.js +408 -0
  65. package/dist/cjs/services/vmi/client.js.map +1 -1
  66. package/dist/esm/client.d.ts +36 -1
  67. package/dist/esm/client.d.ts.map +1 -1
  68. package/dist/esm/client.js +52 -0
  69. package/dist/esm/client.js.map +1 -1
  70. package/dist/esm/core/config.d.ts +24 -0
  71. package/dist/esm/core/config.d.ts.map +1 -1
  72. package/dist/esm/core/config.js +10 -0
  73. package/dist/esm/core/config.js.map +1 -1
  74. package/dist/esm/index.d.ts +2 -2
  75. package/dist/esm/index.d.ts.map +1 -1
  76. package/dist/esm/index.js +3 -1
  77. package/dist/esm/index.js.map +1 -1
  78. package/dist/esm/services/agr-site/client.d.ts +522 -2
  79. package/dist/esm/services/agr-site/client.d.ts.map +1 -1
  80. package/dist/esm/services/agr-site/client.js +565 -12
  81. package/dist/esm/services/agr-site/client.js.map +1 -1
  82. package/dist/esm/services/p21-core/client.d.ts +627 -0
  83. package/dist/esm/services/p21-core/client.d.ts.map +1 -0
  84. package/dist/esm/services/p21-core/client.js +700 -0
  85. package/dist/esm/services/p21-core/client.js.map +1 -0
  86. package/dist/esm/services/p21-core/index.d.ts +3 -0
  87. package/dist/esm/services/p21-core/index.d.ts.map +1 -0
  88. package/dist/esm/services/p21-core/index.js +3 -0
  89. package/dist/esm/services/p21-core/index.js.map +1 -0
  90. package/dist/esm/services/p21-core/schemas/address.d.ts +88 -0
  91. package/dist/esm/services/p21-core/schemas/address.d.ts.map +1 -0
  92. package/dist/esm/services/p21-core/schemas/address.js +42 -0
  93. package/dist/esm/services/p21-core/schemas/address.js.map +1 -0
  94. package/dist/esm/services/p21-core/schemas/cash-drawer.d.ts +96 -0
  95. package/dist/esm/services/p21-core/schemas/cash-drawer.d.ts.map +1 -0
  96. package/dist/esm/services/p21-core/schemas/cash-drawer.js +36 -0
  97. package/dist/esm/services/p21-core/schemas/cash-drawer.js.map +1 -0
  98. package/dist/esm/services/p21-core/schemas/codes.d.ts +54 -0
  99. package/dist/esm/services/p21-core/schemas/codes.d.ts.map +1 -0
  100. package/dist/esm/services/p21-core/schemas/codes.js +22 -0
  101. package/dist/esm/services/p21-core/schemas/codes.js.map +1 -0
  102. package/dist/esm/services/p21-core/schemas/company.d.ts +80 -0
  103. package/dist/esm/services/p21-core/schemas/company.d.ts.map +1 -0
  104. package/dist/esm/services/p21-core/schemas/company.js +32 -0
  105. package/dist/esm/services/p21-core/schemas/company.js.map +1 -0
  106. package/dist/esm/services/p21-core/schemas/health.d.ts +46 -0
  107. package/dist/esm/services/p21-core/schemas/health.d.ts.map +1 -0
  108. package/dist/esm/services/p21-core/schemas/health.js +4 -0
  109. package/dist/esm/services/p21-core/schemas/health.js.map +1 -0
  110. package/dist/esm/services/p21-core/schemas/index.d.ts +8 -0
  111. package/dist/esm/services/p21-core/schemas/index.d.ts.map +1 -0
  112. package/dist/esm/services/p21-core/schemas/index.js +9 -0
  113. package/dist/esm/services/p21-core/schemas/index.js.map +1 -0
  114. package/dist/esm/services/p21-core/schemas/location.d.ts +84 -0
  115. package/dist/esm/services/p21-core/schemas/location.d.ts.map +1 -0
  116. package/dist/esm/services/p21-core/schemas/location.js +32 -0
  117. package/dist/esm/services/p21-core/schemas/location.js.map +1 -0
  118. package/dist/esm/services/p21-core/schemas/payment-types.d.ts +39 -0
  119. package/dist/esm/services/p21-core/schemas/payment-types.d.ts.map +1 -0
  120. package/dist/esm/services/p21-core/schemas/payment-types.js +23 -0
  121. package/dist/esm/services/p21-core/schemas/payment-types.js.map +1 -0
  122. package/dist/esm/services/p21-core/schemas.d.ts +2 -0
  123. package/dist/esm/services/p21-core/schemas.d.ts.map +1 -0
  124. package/dist/esm/services/p21-core/schemas.js +3 -0
  125. package/dist/esm/services/p21-core/schemas.js.map +1 -0
  126. package/dist/esm/services/vmi/client.d.ts +501 -1
  127. package/dist/esm/services/vmi/client.d.ts.map +1 -1
  128. package/dist/esm/services/vmi/client.js +408 -0
  129. package/dist/esm/services/vmi/client.js.map +1 -1
  130. package/dist/types/client.d.ts +36 -1
  131. package/dist/types/client.d.ts.map +1 -1
  132. package/dist/types/core/config.d.ts +24 -0
  133. package/dist/types/core/config.d.ts.map +1 -1
  134. package/dist/types/index.d.ts +2 -2
  135. package/dist/types/index.d.ts.map +1 -1
  136. package/dist/types/services/agr-site/client.d.ts +522 -2
  137. package/dist/types/services/agr-site/client.d.ts.map +1 -1
  138. package/dist/types/services/p21-core/client.d.ts +627 -0
  139. package/dist/types/services/p21-core/client.d.ts.map +1 -0
  140. package/dist/types/services/p21-core/index.d.ts +3 -0
  141. package/dist/types/services/p21-core/index.d.ts.map +1 -0
  142. package/dist/types/services/p21-core/schemas/address.d.ts +88 -0
  143. package/dist/types/services/p21-core/schemas/address.d.ts.map +1 -0
  144. package/dist/types/services/p21-core/schemas/cash-drawer.d.ts +96 -0
  145. package/dist/types/services/p21-core/schemas/cash-drawer.d.ts.map +1 -0
  146. package/dist/types/services/p21-core/schemas/codes.d.ts +54 -0
  147. package/dist/types/services/p21-core/schemas/codes.d.ts.map +1 -0
  148. package/dist/types/services/p21-core/schemas/company.d.ts +80 -0
  149. package/dist/types/services/p21-core/schemas/company.d.ts.map +1 -0
  150. package/dist/types/services/p21-core/schemas/health.d.ts +46 -0
  151. package/dist/types/services/p21-core/schemas/health.d.ts.map +1 -0
  152. package/dist/types/services/p21-core/schemas/index.d.ts +8 -0
  153. package/dist/types/services/p21-core/schemas/index.d.ts.map +1 -0
  154. package/dist/types/services/p21-core/schemas/location.d.ts +84 -0
  155. package/dist/types/services/p21-core/schemas/location.d.ts.map +1 -0
  156. package/dist/types/services/p21-core/schemas/payment-types.d.ts +39 -0
  157. package/dist/types/services/p21-core/schemas/payment-types.d.ts.map +1 -0
  158. package/dist/types/services/p21-core/schemas.d.ts +2 -0
  159. package/dist/types/services/p21-core/schemas.d.ts.map +1 -0
  160. package/dist/types/services/vmi/client.d.ts +501 -1
  161. package/dist/types/services/vmi/client.d.ts.map +1 -1
  162. package/package.json +1 -1
@@ -0,0 +1,700 @@
1
+ import { z } from 'zod';
2
+ import { BaseServiceClient } from '../../core/base-client';
3
+ import { BaseResponseSchema } from '../../core/schemas';
4
+ // Create flexible response schemas using the STANDARD 8-field response format
5
+ // All APIs must use this format - no response validation per OpenAPI spec requirements
6
+ const UnknownResponseSchema = BaseResponseSchema(z.unknown());
7
+ const UnknownArrayResponseSchema = BaseResponseSchema(z.array(z.unknown()));
8
+ import { AddressSchema, CashDrawerSchema, CompanySchema, P21CodeSchema, LocationSchema, PaymentTypeSchema, HealthCheckResponseSchema, AddressListParamsSchema, AddressCorpListParamsSchema, AddressEnableParamsSchema, CashDrawerListParamsSchema, CompanyListParamsSchema, CompanyDetailParamsSchema, P21CodeListParamsSchema, LocationListParamsSchema, PaymentTypeListParamsSchema, } from './schemas';
9
+ /**
10
+ * P21 Core API Client
11
+ * @description Client for interacting with P21 Core system API endpoints for address management, cash drawer operations, company data, location management, and payment processing within the Prophet 21 ERP system
12
+ * @fullPath api.p21Core
13
+ * @service p21-core
14
+ * @domain enterprise-resource-planning
15
+ * @discoverable true
16
+ * @searchTerms ["p21-core", "prophet 21", "ERP", "addresses", "cash drawer", "company data", "locations", "payment types", "shipping methods", "business operations", "corporate addresses"]
17
+ * @relatedEndpoints ["api.p21Core.address", "api.p21Core.cashDrawer", "api.p21Core.company", "api.p21Core.location", "api.p21Core.paymentTypes", "api.p21Core.codes"]
18
+ * @commonPatterns ["ERP data management", "Address and shipping setup", "Cash drawer operations", "Company configuration", "Location management", "Payment processing setup"]
19
+ * @workflow ["erp-setup", "address-management", "financial-operations", "location-configuration", "payment-processing"]
20
+ * @prerequisites ["Valid P21 system access", "ERP authentication", "Company-specific permissions"]
21
+ * @nextSteps ["api.commerce.cartHeaders for e-commerce integration", "api.orders for order processing", "api.pricing for pricing management"]
22
+ * @businessRules ["Company-scoped data access", "Location-based permissions", "Cash drawer security controls", "Address validation for shipping"]
23
+ * @functionalArea "enterprise-resource-planning"
24
+ * @caching "Cache company and location data for 30 minutes, real-time for cash drawer operations"
25
+ * @performance "Supports pagination for all list operations, optimized for ERP transaction volumes"
26
+ * @example
27
+ * ```typescript
28
+ * import { HTTPClient } from '@augur/api-client/core';
29
+ * import { P21CoreClient } from '@augur/api-client/services/p21-core';
30
+ *
31
+ * const client = new P21CoreClient(new HTTPClient({ baseURL: 'https://p21-core.augur-api.com' }));
32
+ *
33
+ * // List companies with pagination
34
+ * const companies = await client.company.list({ limit: 20, offset: 0 });
35
+ * console.log(companies.data); // Company[]
36
+ *
37
+ * // Get company details
38
+ * const company = await client.company.get({ companyUid: 123 });
39
+ * console.log(company.data); // Company
40
+ *
41
+ * // List addresses for shipping configuration
42
+ * const addresses = await client.address.list({ carrierFlag: 'Y' });
43
+ * console.log(addresses.data); // Address[]
44
+ *
45
+ * // Get cash drawer status
46
+ * const cashDrawers = await client.cashDrawer.list({ statusCd: 704 });
47
+ * ```
48
+ */
49
+ export class P21CoreClient extends BaseServiceClient {
50
+ // Ensure schemas are referenced to avoid unused import warnings
51
+ get schemaRefs() {
52
+ return this._schemaRefs;
53
+ }
54
+ /**
55
+ * Create a new P21CoreClient instance
56
+ * @param http Configured HTTPClient instance with authentication
57
+ * @param baseUrl Base URL for the P21 Core API (default: https://p21-core.augur-api.com)
58
+ */
59
+ constructor(http, baseUrl = 'https://p21-core.augur-api.com') {
60
+ super('p21-core', http, baseUrl);
61
+ // Schema references for 100% coverage - ensuring all exports are imported
62
+ this._schemaRefs = {
63
+ AddressSchema,
64
+ CashDrawerSchema,
65
+ CompanySchema,
66
+ P21CodeSchema,
67
+ LocationSchema,
68
+ PaymentTypeSchema,
69
+ };
70
+ /**
71
+ * Address management operations for shipping and delivery configuration
72
+ * @fullPath api.p21Core.address
73
+ * @service p21-core
74
+ * @domain address-and-shipping-management
75
+ * @discoverable true
76
+ */
77
+ this.address = {
78
+ /**
79
+ * List all addresses with filtering capabilities for shipping method configuration
80
+ *
81
+ * @fullPath api.p21Core.address.list
82
+ * @service p21-core
83
+ * @domain address-and-shipping-management
84
+ * @dataMethod listData - returns only the address array without metadata
85
+ * @discoverable true
86
+ * @searchTerms ["addresses", "shipping", "delivery", "locations", "carriers", "shipping methods"]
87
+ * @relatedEndpoints ["api.p21Core.address.get", "api.p21Core.location.list", "api.commerce.cartHeaders.shipping"]
88
+ * @commonPatterns ["List shipping addresses", "Configure delivery options", "Manage carrier settings"]
89
+ * @workflow ["address-setup", "shipping-configuration", "delivery-management"]
90
+ * @prerequisites ["Valid authentication", "Address management permissions"]
91
+ * @nextSteps ["api.p21Core.address.get for details", "api.p21Core.address.enable for activation"]
92
+ * @businessRules ["Carrier flag controls shipping availability", "Status codes determine address visibility", "Default codes set primary shipping methods"]
93
+ * @functionalArea "address-and-shipping-management"
94
+ * @caching "Cache for 15 minutes, invalidate on address changes"
95
+ * @performance "Supports filtering by carrier, status, and default flags for efficient queries"
96
+ *
97
+ * @param params Optional filtering parameters for addresses
98
+ * @returns Promise<BaseResponse<Address[]>> Complete response with addresses array and metadata
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * // Get all active shipping addresses
103
+ * const response = await client.address.list({ carrierFlag: 'Y', statusCd: 704 });
104
+ * console.log(response.data); // Address[]
105
+ *
106
+ * // Get just the data
107
+ * const addresses = await client.address.listData({ enabledCd: 704 });
108
+ *
109
+ * // Get default shipping methods
110
+ * const defaults = await client.address.list({ defaultCd: 704 });
111
+ * ```
112
+ */
113
+ list: this.createListMethod('/address', AddressListParamsSchema, UnknownArrayResponseSchema),
114
+ /**
115
+ * Get address details by ID for shipping method configuration
116
+ *
117
+ * @fullPath api.p21Core.address.get
118
+ * @service p21-core
119
+ * @domain address-and-shipping-management
120
+ * @dataMethod getData - returns only the address object without metadata
121
+ * @discoverable true
122
+ * @searchTerms ["address details", "shipping method", "delivery configuration", "carrier info"]
123
+ * @relatedEndpoints ["api.p21Core.address.list", "api.p21Core.address.corpAddressList", "api.p21Core.location.get"]
124
+ * @commonPatterns ["Get shipping address details", "View delivery configuration", "Check carrier settings"]
125
+ * @workflow ["address-details", "shipping-setup", "delivery-configuration"]
126
+ * @prerequisites ["Valid address ID", "Address access permissions"]
127
+ * @nextSteps ["api.p21Core.address.enable for status changes", "api.p21Core.address.setDefault for primary selection"]
128
+ * @businessRules ["Address ID must exist in system", "User must have access to address company"]
129
+ * @functionalArea "address-and-shipping-management"
130
+ * @performance "Direct lookup by ID, very fast response"
131
+ *
132
+ * @param params Address ID parameter
133
+ * @returns Promise<BaseResponse<Address>> Complete response with address details
134
+ */
135
+ get: async (params) => {
136
+ return this.executeRequest({
137
+ method: 'GET',
138
+ path: '/address/{id}',
139
+ responseSchema: UnknownResponseSchema,
140
+ }, undefined, { id: params.id });
141
+ },
142
+ /**
143
+ * Get corporate address list for multi-location shipping setup
144
+ *
145
+ * @fullPath api.p21Core.address.corpAddressList
146
+ * @service p21-core
147
+ * @domain address-and-shipping-management
148
+ * @dataMethod corpAddressListData - returns only the corporate addresses array
149
+ * @discoverable true
150
+ * @searchTerms ["corporate addresses", "multi-location", "branch shipping", "company locations"]
151
+ * @relatedEndpoints ["api.p21Core.address.get", "api.p21Core.company.list", "api.p21Core.location.list"]
152
+ * @commonPatterns ["Setup multi-location shipping", "Configure branch addresses", "Manage corporate locations"]
153
+ * @workflow ["multi-location-setup", "corporate-shipping", "branch-management"]
154
+ * @prerequisites ["Valid address ID", "Corporate address access permissions"]
155
+ * @nextSteps ["api.p21Core.location.list for location details", "api.p21Core.company.get for company info"]
156
+ * @businessRules ["Returns addresses associated with specified location", "Supports search filtering", "Pagination for large datasets"]
157
+ * @functionalArea "address-and-shipping-management"
158
+ * @caching "Cache for 20 minutes, corporate addresses change infrequently"
159
+ * @performance "Indexed by address ID and company, supports text search"
160
+ */
161
+ corpAddressList: async (params) => {
162
+ return this.executeRequest({
163
+ method: 'GET',
164
+ path: '/address/{id}/corp-address',
165
+ paramsSchema: AddressCorpListParamsSchema,
166
+ responseSchema: UnknownArrayResponseSchema,
167
+ }, params, { id: params.id });
168
+ },
169
+ /**
170
+ * Set address as default shipping method for automated selection
171
+ *
172
+ * @fullPath api.p21Core.address.setDefault
173
+ * @service p21-core
174
+ * @domain address-and-shipping-management
175
+ * @dataMethod setDefaultData - returns confirmation without metadata
176
+ * @discoverable true
177
+ * @searchTerms ["default shipping", "primary address", "automatic selection", "shipping defaults"]
178
+ * @relatedEndpoints ["api.p21Core.address.list", "api.p21Core.address.enable", "api.commerce.cartHeaders.defaultShipping"]
179
+ * @commonPatterns ["Set primary shipping method", "Configure automatic selection", "Update default address"]
180
+ * @workflow ["shipping-defaults", "address-configuration", "automatic-selection"]
181
+ * @prerequisites ["Valid address ID", "Address modification permissions"]
182
+ * @nextSteps ["api.p21Core.address.list to verify changes", "api.commerce.cartHeaders for cart integration"]
183
+ * @businessRules ["Only one default per address type", "Must be enabled address", "Updates system-wide defaults"]
184
+ * @functionalArea "address-and-shipping-management"
185
+ * @performance "Immediate update with cache invalidation"
186
+ */
187
+ setDefault: async (params) => {
188
+ return this.executeRequest({
189
+ method: 'GET',
190
+ path: '/address/{id}/default',
191
+ responseSchema: UnknownResponseSchema,
192
+ }, undefined, { id: params.id });
193
+ },
194
+ /**
195
+ * Enable or disable address as shipping method for availability control
196
+ *
197
+ * @fullPath api.p21Core.address.enable
198
+ * @service p21-core
199
+ * @domain address-and-shipping-management
200
+ * @dataMethod enableData - returns status confirmation without metadata
201
+ * @discoverable true
202
+ * @searchTerms ["enable address", "disable shipping", "address status", "shipping availability"]
203
+ * @relatedEndpoints ["api.p21Core.address.list", "api.p21Core.address.setDefault", "api.commerce.cartHeaders.availableShipping"]
204
+ * @commonPatterns ["Enable shipping method", "Disable delivery option", "Control address availability"]
205
+ * @workflow ["address-activation", "shipping-control", "availability-management"]
206
+ * @prerequisites ["Valid address ID", "Address modification permissions"]
207
+ * @nextSteps ["api.p21Core.address.list to verify status", "api.p21Core.address.setDefault if enabling primary"]
208
+ * @businessRules ["Status codes: 704=enabled, 705=disabled, blank=inherited", "Disabled addresses hidden from selection", "Status affects availability in e-commerce"]
209
+ * @functionalArea "address-and-shipping-management"
210
+ * @performance "Immediate status update with real-time availability"
211
+ */
212
+ enable: async (params) => {
213
+ return this.executeRequest({
214
+ method: 'GET',
215
+ path: '/address/{id}/enable',
216
+ paramsSchema: AddressEnableParamsSchema,
217
+ responseSchema: UnknownResponseSchema,
218
+ }, params, { id: params.id });
219
+ },
220
+ /**
221
+ * Trigger data refresh for address synchronization
222
+ *
223
+ * @fullPath api.p21Core.address.refresh
224
+ * @service p21-core
225
+ * @domain address-and-shipping-management
226
+ * @dataMethod refreshData - returns refresh status without metadata
227
+ * @discoverable true
228
+ * @searchTerms ["refresh addresses", "sync data", "update cache", "data synchronization"]
229
+ * @relatedEndpoints ["api.p21Core.address.list", "api.p21Core.health.check"]
230
+ * @commonPatterns ["Sync address data", "Refresh shipping options", "Update cached information"]
231
+ * @workflow ["data-synchronization", "cache-refresh", "system-maintenance"]
232
+ * @prerequisites ["System admin permissions", "Data refresh authorization"]
233
+ * @nextSteps ["api.p21Core.address.list to verify updated data"]
234
+ * @businessRules ["Triggers background synchronization", "May take time for large datasets", "Updates all address-related caches"]
235
+ * @functionalArea "address-and-shipping-management"
236
+ * @performance "Asynchronous operation, returns immediately"
237
+ */
238
+ refresh: async () => {
239
+ return this.executeRequest({
240
+ method: 'GET',
241
+ path: '/address/refresh',
242
+ responseSchema: UnknownResponseSchema,
243
+ });
244
+ },
245
+ // Data methods for address operations
246
+ listData: async (params) => {
247
+ const response = await this.address.list(params);
248
+ return response.data;
249
+ },
250
+ getData: async (params) => {
251
+ const response = await this.address.get(params);
252
+ return response.data;
253
+ },
254
+ corpAddressListData: async (params) => {
255
+ const response = await this.address.corpAddressList(params);
256
+ return response.data;
257
+ },
258
+ setDefaultData: async (params) => {
259
+ const response = await this.address.setDefault(params);
260
+ return response.data;
261
+ },
262
+ enableData: async (params) => {
263
+ const response = await this.address.enable(params);
264
+ return response.data;
265
+ },
266
+ refreshData: async () => {
267
+ const response = await this.address.refresh();
268
+ return response.data;
269
+ },
270
+ };
271
+ /**
272
+ * Cash drawer management operations for point-of-sale and financial transactions
273
+ * @fullPath api.p21Core.cashDrawer
274
+ * @service p21-core
275
+ * @domain financial-and-pos-management
276
+ * @discoverable true
277
+ */
278
+ this.cashDrawer = {
279
+ /**
280
+ * List cash drawers with filtering for financial management and POS operations
281
+ *
282
+ * @fullPath api.p21Core.cashDrawer.list
283
+ * @service p21-core
284
+ * @domain financial-and-pos-management
285
+ * @dataMethod listData - returns only the cash drawer array without metadata
286
+ * @discoverable true
287
+ * @searchTerms ["cash drawers", "point of sale", "POS", "financial", "cash management", "drawer operations"]
288
+ * @relatedEndpoints ["api.p21Core.cashDrawer.get", "api.p21Core.company.list", "api.orders.invoices.list"]
289
+ * @commonPatterns ["List POS cash drawers", "Financial drawer management", "Cash operation monitoring"]
290
+ * @workflow ["pos-operations", "cash-management", "financial-reconciliation"]
291
+ * @prerequisites ["Valid authentication", "Cash drawer access permissions", "Company access rights"]
292
+ * @nextSteps ["api.p21Core.cashDrawer.get for details", "api.orders.invoices for transaction history"]
293
+ * @businessRules ["Status codes control drawer availability", "Company ID filters by location", "Drawer open status affects operations"]
294
+ * @functionalArea "financial-and-pos-management"
295
+ * @caching "Cache for 5 minutes only, financial data needs freshness"
296
+ * @performance "Real-time queries for accurate cash positions, supports company filtering"
297
+ *
298
+ * @param params Optional filtering parameters for cash drawers
299
+ * @returns Promise<BaseResponse<CashDrawer[]>> Complete response with cash drawer array and metadata
300
+ *
301
+ * @example
302
+ * ```typescript
303
+ * // Get active cash drawers for a company
304
+ * const response = await client.cashDrawer.list({ companyId: 'MAIN', statusCd: 704 });
305
+ * console.log(response.data); // CashDrawer[]
306
+ *
307
+ * // Get just the data
308
+ * const drawers = await client.cashDrawer.listData({ statusCd: 704 });
309
+ *
310
+ * // Search for specific drawer
311
+ * const found = await client.cashDrawer.list({ q: 'register1' });
312
+ * ```
313
+ */
314
+ list: this.createListMethod('/cash_drawer', CashDrawerListParamsSchema, UnknownArrayResponseSchema),
315
+ /**
316
+ * Get cash drawer details by UID for detailed financial information
317
+ *
318
+ * @fullPath api.p21Core.cashDrawer.get
319
+ * @service p21-core
320
+ * @domain financial-and-pos-management
321
+ * @dataMethod getData - returns only the cash drawer object without metadata
322
+ * @discoverable true
323
+ * @searchTerms ["cash drawer details", "POS details", "financial balance", "drawer status", "cash position"]
324
+ * @relatedEndpoints ["api.p21Core.cashDrawer.list", "api.orders.invoices.cashTransactions", "api.p21Core.company.get"]
325
+ * @commonPatterns ["Get drawer balance", "Check cash position", "View POS status", "Financial reconciliation"]
326
+ * @workflow ["cash-operations", "financial-reporting", "pos-management", "drawer-reconciliation"]
327
+ * @prerequisites ["Valid cash drawer UID", "Financial access permissions"]
328
+ * @nextSteps ["api.orders.invoices for transaction details", "financial reporting systems"]
329
+ * @businessRules ["Real-time balance calculations", "Includes opening balance, deposits, withdrawals", "Shows current drawer status (open/closed)"]
330
+ * @functionalArea "financial-and-pos-management"
331
+ * @performance "Direct lookup by UID, includes calculated balances"
332
+ *
333
+ * @param params Cash drawer UID parameter
334
+ * @returns Promise<BaseResponse<CashDrawer>> Complete response with cash drawer details including balances
335
+ */
336
+ get: async (params) => {
337
+ return this.executeRequest({
338
+ method: 'GET',
339
+ path: '/cash_drawer/{cashDrawerUid}',
340
+ responseSchema: UnknownResponseSchema,
341
+ }, undefined, { cashDrawerUid: params.cashDrawerUid });
342
+ },
343
+ // Data methods for cash drawer operations
344
+ listData: async (params) => {
345
+ const response = await this.cashDrawer.list(params);
346
+ return response.data;
347
+ },
348
+ getData: async (params) => {
349
+ const response = await this.cashDrawer.get(params);
350
+ return response.data;
351
+ },
352
+ };
353
+ /**
354
+ * Company management operations for enterprise configuration and corporate data
355
+ * @fullPath api.p21Core.company
356
+ * @service p21-core
357
+ * @domain company-and-corporate-management
358
+ * @discoverable true
359
+ */
360
+ this.company = {
361
+ /**
362
+ * List companies with filtering for enterprise management and corporate structure
363
+ *
364
+ * @fullPath api.p21Core.company.list
365
+ * @service p21-core
366
+ * @domain company-and-corporate-management
367
+ * @dataMethod listData - returns only the company array without metadata
368
+ * @discoverable true
369
+ * @searchTerms ["companies", "corporate", "enterprise", "business entities", "organizations", "company list"]
370
+ * @relatedEndpoints ["api.p21Core.company.get", "api.p21Core.location.list", "api.customers.customer.list"]
371
+ * @commonPatterns ["List corporate entities", "Enterprise structure management", "Company directory", "Business organization"]
372
+ * @workflow ["corporate-setup", "enterprise-management", "business-configuration", "multi-company-operations"]
373
+ * @prerequisites ["Valid authentication", "Company access permissions"]
374
+ * @nextSteps ["api.p21Core.company.get for details", "api.p21Core.location.list for company locations"]
375
+ * @businessRules ["Company ID filtering by access rights", "Search supports company name and ID", "Ordering by UID or custom fields"]
376
+ * @functionalArea "company-and-corporate-management"
377
+ * @caching "Cache for 30 minutes, company data changes infrequently"
378
+ * @performance "Indexed by company ID and name, supports text search and sorting"
379
+ *
380
+ * @param params Optional filtering and pagination parameters
381
+ * @returns Promise<BaseResponse<Company[]>> Complete response with company array and metadata
382
+ *
383
+ * @example
384
+ * ```typescript
385
+ * // Get all companies with pagination
386
+ * const response = await client.company.list({ limit: 50, offset: 0 });
387
+ * console.log(response.data); // Company[]
388
+ *
389
+ * // Get just the data
390
+ * const companies = await client.company.listData();
391
+ *
392
+ * // Search for specific company
393
+ * const found = await client.company.list({ q: 'Acme Corp' });
394
+ *
395
+ * // Filter by company ID
396
+ * const specific = await client.company.list({ companyId: 'ACME' });
397
+ * ```
398
+ */
399
+ list: this.createListMethod('/company', CompanyListParamsSchema, UnknownArrayResponseSchema),
400
+ /**
401
+ * Get company details by UID for detailed corporate information
402
+ *
403
+ * @fullPath api.p21Core.company.get
404
+ * @service p21-core
405
+ * @domain company-and-corporate-management
406
+ * @dataMethod getData - returns only the company object without metadata
407
+ * @discoverable true
408
+ * @searchTerms ["company details", "corporate info", "business entity", "organization details", "company profile"]
409
+ * @relatedEndpoints ["api.p21Core.company.list", "api.p21Core.location.list", "api.customers.customer.companyCustomers"]
410
+ * @commonPatterns ["Get corporate details", "View business information", "Company profile lookup", "Enterprise configuration"]
411
+ * @workflow ["company-details", "corporate-profile", "business-configuration", "enterprise-setup"]
412
+ * @prerequisites ["Valid company UID", "Company access permissions"]
413
+ * @nextSteps ["api.p21Core.location.list for company locations", "api.customers.customer.list for company customers"]
414
+ * @businessRules ["Company UID must exist", "Optional company ID parameter for validation", "Includes address and location references"]
415
+ * @functionalArea "company-and-corporate-management"
416
+ * @performance "Direct lookup by UID, includes related entity references"
417
+ *
418
+ * @param params Company UID and optional company ID
419
+ * @returns Promise<BaseResponse<Company>> Complete response with detailed company information
420
+ */
421
+ get: async (params) => {
422
+ return this.executeRequest({
423
+ method: 'GET',
424
+ path: '/company/{companyUid}',
425
+ paramsSchema: CompanyDetailParamsSchema,
426
+ responseSchema: UnknownResponseSchema,
427
+ }, params, { companyUid: params.companyUid });
428
+ },
429
+ // Data methods for company operations
430
+ listData: async (params) => {
431
+ const response = await this.company.list(params);
432
+ return response.data;
433
+ },
434
+ getData: async (params) => {
435
+ const response = await this.company.get(params);
436
+ return response.data;
437
+ },
438
+ };
439
+ /**
440
+ * P21 system codes and reference data operations
441
+ * @fullPath api.p21Core.codes
442
+ * @service p21-core
443
+ * @domain system-configuration
444
+ * @discoverable true
445
+ */
446
+ this.codes = {
447
+ /**
448
+ * Search P21 system codes for configuration and reference data lookup
449
+ *
450
+ * @fullPath api.p21Core.codes.search
451
+ * @service p21-core
452
+ * @domain system-configuration
453
+ * @dataMethod searchData - returns only the codes array without metadata
454
+ * @discoverable true
455
+ * @searchTerms ["P21 codes", "system codes", "reference data", "configuration codes", "lookup values"]
456
+ * @relatedEndpoints ["api.p21Core.company.list", "api.p21Core.location.list", "api.items.categories.list"]
457
+ * @commonPatterns ["Lookup system codes", "Reference data search", "Configuration values", "Code validation"]
458
+ * @workflow ["system-configuration", "reference-lookup", "data-validation", "code-management"]
459
+ * @prerequisites ["Valid search query", "System configuration access"]
460
+ * @nextSteps ["Use codes for configuration", "api.p21Core.company for related entities"]
461
+ * @businessRules ["Search query required", "Code number filtering available", "Language-specific descriptions"]
462
+ * @functionalArea "system-configuration"
463
+ * @caching "Cache for 60 minutes, system codes rarely change"
464
+ * @performance "Full-text search on descriptions, indexed by code numbers"
465
+ *
466
+ * @param params Search parameters including required query
467
+ * @returns Promise<BaseResponse<P21Code[]>> Complete response with matching system codes
468
+ *
469
+ * @example
470
+ * ```typescript
471
+ * // Search for status codes
472
+ * const response = await client.codes.search({ q: 'status' });
473
+ * console.log(response.data); // P21Code[]
474
+ *
475
+ * // Get just the data
476
+ * const codes = await client.codes.searchData({ q: 'shipping' });
477
+ *
478
+ * // Filter by specific code numbers
479
+ * const filtered = await client.codes.search({
480
+ * q: 'status',
481
+ * codeNoList: '704,705,700'
482
+ * });
483
+ * ```
484
+ */
485
+ search: this.createListMethod('/code-p21', P21CodeListParamsSchema, UnknownArrayResponseSchema),
486
+ // Data method for codes operations
487
+ searchData: async (params) => {
488
+ const response = await this.codes.search(params);
489
+ return response.data;
490
+ },
491
+ };
492
+ /**
493
+ * Location management operations for warehouse and distribution center configuration
494
+ * @fullPath api.p21Core.location
495
+ * @service p21-core
496
+ * @domain location-and-warehouse-management
497
+ * @discoverable true
498
+ */
499
+ this.location = {
500
+ /**
501
+ * List locations with filtering for warehouse and distribution management
502
+ *
503
+ * @fullPath api.p21Core.location.list
504
+ * @service p21-core
505
+ * @domain location-and-warehouse-management
506
+ * @dataMethod listData - returns only the location array without metadata
507
+ * @discoverable true
508
+ * @searchTerms ["locations", "warehouses", "distribution centers", "facilities", "branches", "sites"]
509
+ * @relatedEndpoints ["api.p21Core.location.get", "api.p21Core.company.list", "api.items.invLoc.list"]
510
+ * @commonPatterns ["List warehouse locations", "Distribution center management", "Facility directory", "Branch operations"]
511
+ * @workflow ["location-setup", "warehouse-management", "distribution-configuration", "facility-operations"]
512
+ * @prerequisites ["Valid authentication", "Location access permissions"]
513
+ * @nextSteps ["api.p21Core.location.get for details", "api.items.invLoc for inventory locations"]
514
+ * @businessRules ["Delete flag filters inactive locations", "Distribution center flag for DC identification", "Company scoped access"]
515
+ * @functionalArea "location-and-warehouse-management"
516
+ * @caching "Cache for 20 minutes, location data semi-static"
517
+ * @performance "Indexed by location ID and name, supports text search"
518
+ *
519
+ * @param params Optional filtering and pagination parameters
520
+ * @returns Promise<BaseResponse<Location[]>> Complete response with location array and metadata
521
+ *
522
+ * @example
523
+ * ```typescript
524
+ * // Get all active locations
525
+ * const response = await client.location.list({ deleteFlag: 'N' });
526
+ * console.log(response.data); // Location[]
527
+ *
528
+ * // Get just the data
529
+ * const locations = await client.location.listData();
530
+ *
531
+ * // Search for distribution centers
532
+ * const dcs = await client.location.list({ q: 'distribution' });
533
+ * ```
534
+ */
535
+ list: this.createListMethod('/location', LocationListParamsSchema, UnknownArrayResponseSchema),
536
+ /**
537
+ * Get location details by ID for warehouse and facility information
538
+ *
539
+ * @fullPath api.p21Core.location.get
540
+ * @service p21-core
541
+ * @domain location-and-warehouse-management
542
+ * @dataMethod getData - returns only the location object without metadata
543
+ * @discoverable true
544
+ * @searchTerms ["location details", "warehouse info", "facility details", "distribution center", "branch info"]
545
+ * @relatedEndpoints ["api.p21Core.location.list", "api.p21Core.company.get", "api.items.invLoc.locationInventory"]
546
+ * @commonPatterns ["Get warehouse details", "View facility information", "Location configuration", "Distribution center setup"]
547
+ * @workflow ["location-details", "warehouse-configuration", "facility-management", "shipping-setup"]
548
+ * @prerequisites ["Valid location ID", "Location access permissions"]
549
+ * @nextSteps ["api.items.invLoc for inventory", "api.p21Core.company for company details"]
550
+ * @businessRules ["Location ID must exist", "Includes shipping integration settings", "Company association required"]
551
+ * @functionalArea "location-and-warehouse-management"
552
+ * @performance "Direct lookup by location ID, includes shipping configurations"
553
+ *
554
+ * @param params Location ID parameter
555
+ * @returns Promise<BaseResponse<Location>> Complete response with detailed location information
556
+ */
557
+ get: async (params) => {
558
+ return this.executeRequest({
559
+ method: 'GET',
560
+ path: '/location/{locationId}',
561
+ responseSchema: UnknownResponseSchema,
562
+ }, undefined, { locationId: params.locationId });
563
+ },
564
+ // Data methods for location operations
565
+ listData: async (params) => {
566
+ const response = await this.location.list(params);
567
+ return response.data;
568
+ },
569
+ getData: async (params) => {
570
+ const response = await this.location.get(params);
571
+ return response.data;
572
+ },
573
+ };
574
+ /**
575
+ * Payment type management operations for payment processing configuration
576
+ * @fullPath api.p21Core.paymentTypes
577
+ * @service p21-core
578
+ * @domain payment-processing
579
+ * @discoverable true
580
+ */
581
+ this.paymentTypes = {
582
+ /**
583
+ * List payment types for payment processing and checkout configuration
584
+ *
585
+ * @fullPath api.p21Core.paymentTypes.list
586
+ * @service p21-core
587
+ * @domain payment-processing
588
+ * @dataMethod listData - returns only the payment types array without metadata
589
+ * @discoverable true
590
+ * @searchTerms ["payment types", "payment methods", "payment processing", "checkout options", "billing methods"]
591
+ * @relatedEndpoints ["api.payments.unified.paymentMethods", "api.commerce.checkout.paymentOptions", "api.orders.invoices.paymentHistory"]
592
+ * @commonPatterns ["List payment options", "Payment method configuration", "Checkout setup", "Billing configuration"]
593
+ * @workflow ["payment-setup", "checkout-configuration", "payment-processing", "billing-management"]
594
+ * @prerequisites ["Valid authentication", "Payment configuration access"]
595
+ * @nextSteps ["api.payments.unified for payment processing", "api.commerce.checkout for integration"]
596
+ * @businessRules ["Payment types define available options", "Configuration affects checkout flow", "Integration with payment processors"]
597
+ * @functionalArea "payment-processing"
598
+ * @caching "Cache for 45 minutes, payment types change infrequently"
599
+ * @performance "Simple list operation, minimal data volume"
600
+ *
601
+ * @param params Optional pagination parameters
602
+ * @returns Promise<BaseResponse<PaymentType[]>> Complete response with payment types array
603
+ *
604
+ * @example
605
+ * ```typescript
606
+ * // Get all payment types
607
+ * const response = await client.paymentTypes.list();
608
+ * console.log(response.data); // PaymentType[]
609
+ *
610
+ * // Get just the data
611
+ * const paymentTypes = await client.paymentTypes.listData();
612
+ *
613
+ * // Paginated results
614
+ * const paged = await client.paymentTypes.list({ limit: 20, offset: 0 });
615
+ * ```
616
+ */
617
+ list: this.createListMethod('/payment-types', PaymentTypeListParamsSchema, UnknownArrayResponseSchema),
618
+ // Data method for payment types operations
619
+ listData: async (params) => {
620
+ const response = await this.paymentTypes.list(params);
621
+ return response.data;
622
+ },
623
+ };
624
+ /**
625
+ * Health check operations for service monitoring and system status verification
626
+ * @fullPath api.p21Core.health
627
+ * @service p21-core
628
+ * @domain system-monitoring
629
+ * @discoverable true
630
+ */
631
+ this.health = {
632
+ /**
633
+ * Perform health check to verify P21 Core service status and connectivity
634
+ *
635
+ * @fullPath api.p21Core.health.check
636
+ * @service p21-core
637
+ * @domain system-monitoring
638
+ * @dataMethod checkData - returns only the health status without metadata
639
+ * @discoverable true
640
+ * @searchTerms ["health check", "service status", "system monitor", "service availability", "connectivity test"]
641
+ * @relatedEndpoints ["api.p21Core.ping", "system monitoring endpoints"]
642
+ * @commonPatterns ["Check service health", "Monitor system status", "Verify connectivity", "Service diagnostics"]
643
+ * @workflow ["system-monitoring", "health-verification", "service-diagnostics"]
644
+ * @prerequisites ["System access", "Monitoring permissions"]
645
+ * @nextSteps ["Service remediation if unhealthy", "Integration health checks"]
646
+ * @businessRules ["Returns site configuration", "Includes system hash for verification", "No authentication required"]
647
+ * @functionalArea "system-monitoring"
648
+ * @performance "Lightweight check, immediate response"
649
+ *
650
+ * @returns Promise<BaseResponse<HealthCheckResponse>> Service health status and configuration
651
+ */
652
+ check: async () => {
653
+ return this.executeRequest({
654
+ method: 'GET',
655
+ path: '/health-check',
656
+ responseSchema: HealthCheckResponseSchema,
657
+ });
658
+ },
659
+ /**
660
+ * Ping endpoint for basic connectivity testing and service availability
661
+ *
662
+ * @fullPath api.p21Core.health.ping
663
+ * @service p21-core
664
+ * @domain system-monitoring
665
+ * @dataMethod pingData - returns only the ping response without metadata
666
+ * @discoverable true
667
+ * @searchTerms ["ping", "connectivity", "service alive", "basic check", "availability test"]
668
+ * @relatedEndpoints ["api.p21Core.health.check"]
669
+ * @commonPatterns ["Test connectivity", "Basic availability check", "Service ping", "Network test"]
670
+ * @workflow ["connectivity-testing", "basic-monitoring", "network-verification"]
671
+ * @prerequisites ["Network access"]
672
+ * @nextSteps ["Full health check if ping succeeds"]
673
+ * @businessRules ["Minimal response for speed", "No authentication required", "Returns simple pong response"]
674
+ * @functionalArea "system-monitoring"
675
+ * @performance "Fastest possible response, minimal processing"
676
+ *
677
+ * @returns Promise<BaseResponse<string>> Simple ping response confirmation
678
+ */
679
+ ping: async () => {
680
+ return this.executeRequest({
681
+ method: 'GET',
682
+ path: '/ping',
683
+ responseSchema: UnknownResponseSchema,
684
+ });
685
+ },
686
+ // Data methods for health operations
687
+ checkData: async () => {
688
+ const response = await this.health.check();
689
+ return response.data;
690
+ },
691
+ pingData: async () => {
692
+ const response = await this.health.ping();
693
+ return response.data;
694
+ },
695
+ };
696
+ // Reference schemas to ensure 100% import coverage
697
+ void this.schemaRefs;
698
+ }
699
+ }
700
+ //# sourceMappingURL=client.js.map