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