@augno/sdk 0.12.7 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/CHANGELOG.md +2 -4
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/catalog/catalog.d.mts +4 -4
  11. package/resources/catalog/catalog.d.mts.map +1 -1
  12. package/resources/catalog/catalog.d.ts +4 -4
  13. package/resources/catalog/catalog.d.ts.map +1 -1
  14. package/resources/catalog/catalog.js.map +1 -1
  15. package/resources/catalog/catalog.mjs.map +1 -1
  16. package/resources/catalog/index.d.mts +2 -2
  17. package/resources/catalog/index.d.mts.map +1 -1
  18. package/resources/catalog/index.d.ts +2 -2
  19. package/resources/catalog/index.d.ts.map +1 -1
  20. package/resources/catalog/index.js.map +1 -1
  21. package/resources/catalog/index.mjs.map +1 -1
  22. package/resources/catalog/items/index.d.mts +1 -1
  23. package/resources/catalog/items/index.d.mts.map +1 -1
  24. package/resources/catalog/items/index.d.ts +1 -1
  25. package/resources/catalog/items/index.d.ts.map +1 -1
  26. package/resources/catalog/items/index.js.map +1 -1
  27. package/resources/catalog/items/index.mjs.map +1 -1
  28. package/resources/catalog/items/items.d.mts +77 -1
  29. package/resources/catalog/items/items.d.mts.map +1 -1
  30. package/resources/catalog/items/items.d.ts +77 -1
  31. package/resources/catalog/items/items.d.ts.map +1 -1
  32. package/resources/catalog/items/items.js +29 -0
  33. package/resources/catalog/items/items.js.map +1 -1
  34. package/resources/catalog/items/items.mjs +29 -0
  35. package/resources/catalog/items/items.mjs.map +1 -1
  36. package/resources/catalog/product-lines.d.mts +42 -8
  37. package/resources/catalog/product-lines.d.mts.map +1 -1
  38. package/resources/catalog/product-lines.d.ts +42 -8
  39. package/resources/catalog/product-lines.d.ts.map +1 -1
  40. package/resources/catalog/product-lines.js +3 -3
  41. package/resources/catalog/product-lines.js.map +1 -1
  42. package/resources/catalog/product-lines.mjs +3 -3
  43. package/resources/catalog/product-lines.mjs.map +1 -1
  44. package/resources/catalog/products.d.mts +2 -2
  45. package/resources/catalog/products.d.ts +2 -2
  46. package/resources/catalog/products.js +2 -2
  47. package/resources/catalog/products.mjs +2 -2
  48. package/resources/core/analytics.d.mts +547 -0
  49. package/resources/core/analytics.d.mts.map +1 -0
  50. package/resources/core/analytics.d.ts +547 -0
  51. package/resources/core/analytics.d.ts.map +1 -0
  52. package/resources/core/analytics.js +67 -0
  53. package/resources/core/analytics.js.map +1 -0
  54. package/resources/core/analytics.mjs +63 -0
  55. package/resources/core/analytics.mjs.map +1 -0
  56. package/resources/core/audit-events.d.mts +4 -4
  57. package/resources/core/audit-events.d.mts.map +1 -1
  58. package/resources/core/audit-events.d.ts +4 -4
  59. package/resources/core/audit-events.d.ts.map +1 -1
  60. package/resources/core/core.d.mts +6 -2
  61. package/resources/core/core.d.mts.map +1 -1
  62. package/resources/core/core.d.ts +6 -2
  63. package/resources/core/core.d.ts.map +1 -1
  64. package/resources/core/core.js +4 -0
  65. package/resources/core/core.js.map +1 -1
  66. package/resources/core/core.mjs +4 -0
  67. package/resources/core/core.mjs.map +1 -1
  68. package/resources/core/index.d.mts +1 -0
  69. package/resources/core/index.d.mts.map +1 -1
  70. package/resources/core/index.d.ts +1 -0
  71. package/resources/core/index.d.ts.map +1 -1
  72. package/resources/core/index.js +3 -1
  73. package/resources/core/index.js.map +1 -1
  74. package/resources/core/index.mjs +1 -0
  75. package/resources/core/index.mjs.map +1 -1
  76. package/resources/index.d.mts +1 -1
  77. package/resources/index.d.mts.map +1 -1
  78. package/resources/index.d.ts +1 -1
  79. package/resources/index.d.ts.map +1 -1
  80. package/resources/index.js.map +1 -1
  81. package/resources/index.mjs +1 -1
  82. package/resources/index.mjs.map +1 -1
  83. package/resources/messaging/conversations/conversations.d.mts +3 -3
  84. package/resources/messaging/conversations/conversations.d.mts.map +1 -1
  85. package/resources/messaging/conversations/conversations.d.ts +3 -3
  86. package/resources/messaging/conversations/conversations.d.ts.map +1 -1
  87. package/resources/messaging/conversations/conversations.js.map +1 -1
  88. package/resources/messaging/conversations/conversations.mjs.map +1 -1
  89. package/resources/messaging/conversations/links.d.mts +2 -2
  90. package/resources/messaging/conversations/links.d.mts.map +1 -1
  91. package/resources/messaging/conversations/links.d.ts +2 -2
  92. package/resources/messaging/conversations/links.d.ts.map +1 -1
  93. package/resources/messaging/conversations/messages.d.mts +2 -2
  94. package/resources/messaging/conversations/messages.d.mts.map +1 -1
  95. package/resources/messaging/conversations/messages.d.ts +2 -2
  96. package/resources/messaging/conversations/messages.d.ts.map +1 -1
  97. package/resources/messaging/notifications/notifications.d.mts +2 -2
  98. package/resources/messaging/notifications/notifications.d.mts.map +1 -1
  99. package/resources/messaging/notifications/notifications.d.ts +2 -2
  100. package/resources/messaging/notifications/notifications.d.ts.map +1 -1
  101. package/resources/messaging/notifications/notifications.js.map +1 -1
  102. package/resources/messaging/notifications/notifications.mjs.map +1 -1
  103. package/resources/operations/demand-overrides.d.mts +468 -0
  104. package/resources/operations/demand-overrides.d.mts.map +1 -0
  105. package/resources/operations/demand-overrides.d.ts +468 -0
  106. package/resources/operations/demand-overrides.d.ts.map +1 -0
  107. package/resources/operations/demand-overrides.js +120 -0
  108. package/resources/operations/demand-overrides.js.map +1 -0
  109. package/resources/operations/demand-overrides.mjs +116 -0
  110. package/resources/operations/demand-overrides.mjs.map +1 -0
  111. package/resources/operations/index.d.mts +5 -1
  112. package/resources/operations/index.d.mts.map +1 -1
  113. package/resources/operations/index.d.ts +5 -1
  114. package/resources/operations/index.d.ts.map +1 -1
  115. package/resources/operations/index.js +9 -1
  116. package/resources/operations/index.js.map +1 -1
  117. package/resources/operations/index.mjs +5 -1
  118. package/resources/operations/index.mjs.map +1 -1
  119. package/resources/operations/machine-downtime-events.d.mts +424 -0
  120. package/resources/operations/machine-downtime-events.d.mts.map +1 -0
  121. package/resources/operations/machine-downtime-events.d.ts +424 -0
  122. package/resources/operations/machine-downtime-events.d.ts.map +1 -0
  123. package/resources/operations/machine-downtime-events.js +110 -0
  124. package/resources/operations/machine-downtime-events.js.map +1 -0
  125. package/resources/operations/machine-downtime-events.mjs +106 -0
  126. package/resources/operations/machine-downtime-events.mjs.map +1 -0
  127. package/resources/operations/operations.d.mts +444 -0
  128. package/resources/operations/operations.d.mts.map +1 -1
  129. package/resources/operations/operations.d.ts +444 -0
  130. package/resources/operations/operations.d.ts.map +1 -1
  131. package/resources/operations/operations.js +89 -0
  132. package/resources/operations/operations.js.map +1 -1
  133. package/resources/operations/operations.mjs +89 -0
  134. package/resources/operations/operations.mjs.map +1 -1
  135. package/resources/operations/production-schedule-settings/index.d.mts +3 -0
  136. package/resources/operations/production-schedule-settings/index.d.mts.map +1 -0
  137. package/resources/operations/production-schedule-settings/index.d.ts +3 -0
  138. package/resources/operations/production-schedule-settings/index.d.ts.map +1 -0
  139. package/resources/operations/production-schedule-settings/index.js +9 -0
  140. package/resources/operations/production-schedule-settings/index.js.map +1 -0
  141. package/resources/operations/production-schedule-settings/index.mjs +4 -0
  142. package/resources/operations/production-schedule-settings/index.mjs.map +1 -0
  143. package/resources/operations/production-schedule-settings/production-schedule-settings.d.mts +470 -0
  144. package/resources/operations/production-schedule-settings/production-schedule-settings.d.mts.map +1 -0
  145. package/resources/operations/production-schedule-settings/production-schedule-settings.d.ts +470 -0
  146. package/resources/operations/production-schedule-settings/production-schedule-settings.d.ts.map +1 -0
  147. package/resources/operations/production-schedule-settings/production-schedule-settings.js +88 -0
  148. package/resources/operations/production-schedule-settings/production-schedule-settings.js.map +1 -0
  149. package/resources/operations/production-schedule-settings/production-schedule-settings.mjs +83 -0
  150. package/resources/operations/production-schedule-settings/production-schedule-settings.mjs.map +1 -0
  151. package/resources/operations/production-schedule-settings/resources.d.mts +176 -0
  152. package/resources/operations/production-schedule-settings/resources.d.mts.map +1 -0
  153. package/resources/operations/production-schedule-settings/resources.d.ts +176 -0
  154. package/resources/operations/production-schedule-settings/resources.d.ts.map +1 -0
  155. package/resources/operations/production-schedule-settings/resources.js +74 -0
  156. package/resources/operations/production-schedule-settings/resources.js.map +1 -0
  157. package/resources/operations/production-schedule-settings/resources.mjs +70 -0
  158. package/resources/operations/production-schedule-settings/resources.mjs.map +1 -0
  159. package/resources/operations/production-schedule-settings.d.mts +2 -0
  160. package/resources/operations/production-schedule-settings.d.mts.map +1 -0
  161. package/resources/operations/production-schedule-settings.d.ts +2 -0
  162. package/resources/operations/production-schedule-settings.d.ts.map +1 -0
  163. package/resources/operations/production-schedule-settings.js +6 -0
  164. package/resources/operations/production-schedule-settings.js.map +1 -0
  165. package/resources/operations/production-schedule-settings.mjs +3 -0
  166. package/resources/operations/production-schedule-settings.mjs.map +1 -0
  167. package/resources/operations/production-schedules/actions.d.mts +668 -0
  168. package/resources/operations/production-schedules/actions.d.mts.map +1 -0
  169. package/resources/operations/production-schedules/actions.d.ts +668 -0
  170. package/resources/operations/production-schedules/actions.d.ts.map +1 -0
  171. package/resources/operations/production-schedules/actions.js +181 -0
  172. package/resources/operations/production-schedules/actions.js.map +1 -0
  173. package/resources/operations/production-schedules/actions.mjs +177 -0
  174. package/resources/operations/production-schedules/actions.mjs.map +1 -0
  175. package/resources/operations/production-schedules/index.d.mts +4 -0
  176. package/resources/operations/production-schedules/index.d.mts.map +1 -0
  177. package/resources/operations/production-schedules/index.d.ts +4 -0
  178. package/resources/operations/production-schedules/index.d.ts.map +1 -0
  179. package/resources/operations/production-schedules/index.js +11 -0
  180. package/resources/operations/production-schedules/index.js.map +1 -0
  181. package/resources/operations/production-schedules/index.mjs +5 -0
  182. package/resources/operations/production-schedules/index.mjs.map +1 -0
  183. package/resources/operations/production-schedules/lines.d.mts +420 -0
  184. package/resources/operations/production-schedules/lines.d.mts.map +1 -0
  185. package/resources/operations/production-schedules/lines.d.ts +420 -0
  186. package/resources/operations/production-schedules/lines.d.ts.map +1 -0
  187. package/resources/operations/production-schedules/lines.js +106 -0
  188. package/resources/operations/production-schedules/lines.js.map +1 -0
  189. package/resources/operations/production-schedules/lines.mjs +102 -0
  190. package/resources/operations/production-schedules/lines.mjs.map +1 -0
  191. package/resources/operations/production-schedules/production-schedules.d.mts +1177 -0
  192. package/resources/operations/production-schedules/production-schedules.d.mts.map +1 -0
  193. package/resources/operations/production-schedules/production-schedules.d.ts +1177 -0
  194. package/resources/operations/production-schedules/production-schedules.d.ts.map +1 -0
  195. package/resources/operations/production-schedules/production-schedules.js +238 -0
  196. package/resources/operations/production-schedules/production-schedules.js.map +1 -0
  197. package/resources/operations/production-schedules/production-schedules.mjs +233 -0
  198. package/resources/operations/production-schedules/production-schedules.mjs.map +1 -0
  199. package/resources/operations/production-schedules.d.mts +2 -0
  200. package/resources/operations/production-schedules.d.mts.map +1 -0
  201. package/resources/operations/production-schedules.d.ts +2 -0
  202. package/resources/operations/production-schedules.d.ts.map +1 -0
  203. package/resources/operations/production-schedules.js +6 -0
  204. package/resources/operations/production-schedules.js.map +1 -0
  205. package/resources/operations/production-schedules.mjs +3 -0
  206. package/resources/operations/production-schedules.mjs.map +1 -0
  207. package/resources/operations/shipping-terms.d.mts +9 -8
  208. package/resources/operations/shipping-terms.d.mts.map +1 -1
  209. package/resources/operations/shipping-terms.d.ts +9 -8
  210. package/resources/operations/shipping-terms.d.ts.map +1 -1
  211. package/resources/operations/shipping-terms.js.map +1 -1
  212. package/resources/operations/shipping-terms.mjs.map +1 -1
  213. package/resources/sales/customers/customers.d.mts +6 -18
  214. package/resources/sales/customers/customers.d.mts.map +1 -1
  215. package/resources/sales/customers/customers.d.ts +6 -18
  216. package/resources/sales/customers/customers.d.ts.map +1 -1
  217. package/resources/sales/customers/customers.js.map +1 -1
  218. package/resources/sales/customers/customers.mjs.map +1 -1
  219. package/resources/sales/customers/index.d.mts +1 -1
  220. package/resources/sales/customers/index.d.mts.map +1 -1
  221. package/resources/sales/customers/index.d.ts +1 -1
  222. package/resources/sales/customers/index.d.ts.map +1 -1
  223. package/resources/sales/customers/index.js.map +1 -1
  224. package/resources/sales/customers/index.mjs.map +1 -1
  225. package/resources/sales/index.d.mts +1 -1
  226. package/resources/sales/index.d.mts.map +1 -1
  227. package/resources/sales/index.d.ts +1 -1
  228. package/resources/sales/index.d.ts.map +1 -1
  229. package/resources/sales/index.js.map +1 -1
  230. package/resources/sales/index.mjs.map +1 -1
  231. package/resources/sales/sales-orders/lines/lines.d.mts +5 -5
  232. package/resources/sales/sales-orders/lines/lines.d.mts.map +1 -1
  233. package/resources/sales/sales-orders/lines/lines.d.ts +5 -5
  234. package/resources/sales/sales-orders/lines/lines.d.ts.map +1 -1
  235. package/resources/sales/sales-orders/sales-orders.d.mts +3 -2
  236. package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
  237. package/resources/sales/sales-orders/sales-orders.d.ts +3 -2
  238. package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
  239. package/resources/sales/sales-orders/sales-orders.js.map +1 -1
  240. package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
  241. package/resources/sales/sales.d.mts +2 -2
  242. package/resources/sales/sales.d.mts.map +1 -1
  243. package/resources/sales/sales.d.ts +2 -2
  244. package/resources/sales/sales.d.ts.map +1 -1
  245. package/resources/sales/sales.js.map +1 -1
  246. package/resources/sales/sales.mjs.map +1 -1
  247. package/src/client.ts +30 -2
  248. package/src/resources/catalog/catalog.ts +6 -0
  249. package/src/resources/catalog/index.ts +3 -0
  250. package/src/resources/catalog/items/index.ts +2 -0
  251. package/src/resources/catalog/items/items.ts +92 -0
  252. package/src/resources/catalog/product-lines.ts +49 -7
  253. package/src/resources/catalog/products.ts +2 -2
  254. package/src/resources/core/analytics.ts +677 -0
  255. package/src/resources/core/audit-events.ts +84 -0
  256. package/src/resources/core/core.ts +82 -0
  257. package/src/resources/core/index.ts +18 -0
  258. package/src/resources/index.ts +15 -1
  259. package/src/resources/messaging/conversations/conversations.ts +63 -0
  260. package/src/resources/messaging/conversations/links.ts +42 -0
  261. package/src/resources/messaging/conversations/messages.ts +42 -0
  262. package/src/resources/messaging/notifications/notifications.ts +42 -0
  263. package/src/resources/operations/demand-overrides.ts +631 -0
  264. package/src/resources/operations/index.ts +72 -1
  265. package/src/resources/operations/machine-downtime-events.ts +584 -0
  266. package/src/resources/operations/operations.ts +673 -0
  267. package/src/resources/operations/production-schedule-settings/index.ts +15 -0
  268. package/src/resources/operations/production-schedule-settings/production-schedule-settings.ts +595 -0
  269. package/src/resources/operations/production-schedule-settings/resources.ts +217 -0
  270. package/src/resources/operations/production-schedule-settings.ts +3 -0
  271. package/src/resources/operations/production-schedules/actions.ts +835 -0
  272. package/src/resources/operations/production-schedules/index.ts +64 -0
  273. package/src/resources/operations/production-schedules/lines.ts +584 -0
  274. package/src/resources/operations/production-schedules/production-schedules.ts +1548 -0
  275. package/src/resources/operations/production-schedules.ts +3 -0
  276. package/src/resources/operations/shipping-terms.ts +9 -8
  277. package/src/resources/sales/customers/customers.ts +5 -20
  278. package/src/resources/sales/customers/index.ts +0 -1
  279. package/src/resources/sales/index.ts +0 -1
  280. package/src/resources/sales/sales-orders/lines/lines.ts +5 -5
  281. package/src/resources/sales/sales-orders/sales-orders.ts +3 -2
  282. package/src/resources/sales/sales.ts +0 -2
  283. package/src/version.ts +1 -1
  284. package/version.d.mts +1 -1
  285. package/version.d.ts +1 -1
  286. package/version.js +1 -1
  287. package/version.mjs +1 -1
@@ -0,0 +1,677 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as CoreAPI from './core';
5
+ import * as APIKeysAPI from '../auth/api-keys/api-keys';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+
9
+ /**
10
+ * Analyze sales, orders, manufacturing, materials, and other business metrics.
11
+ */
12
+ export class Analytics extends APIResource {
13
+ /**
14
+ * Returns Overall Equipment Effectiveness (OEE) metrics by department.
15
+ *
16
+ * Availability is measured from logged machine downtime rather than inferred, so
17
+ * it requires both `planned_time` for the department and downtime events in the
18
+ * period. Departments with `has_downtime_data` false have no availability
19
+ * measurement, and their ratios are returned as null rather than as 100%.
20
+ *
21
+ * This endpoint requires the permission: `machine_downtime:read`.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const analyzeOeeResponse =
26
+ * await client.core.analytics.updateOee({
27
+ * end_date: '2026-05-10T00:23:00Z',
28
+ * start_date: '2026-05-10T00:00:00Z',
29
+ * department_ids: ['dp_01791c25ab59da4704cba61874'],
30
+ * });
31
+ * ```
32
+ */
33
+ updateOee(body: AnalyticsUpdateOeeParams, options?: RequestOptions): APIPromise<AnalyzeOeeResponse> {
34
+ return this._client.put('/v1/core/analytics/oee', { body, ...options });
35
+ }
36
+
37
+ /**
38
+ * Returns actual production measured against the plan that was live at the time.
39
+ *
40
+ * The baseline for each week is the schedule version published on or before that
41
+ * week began, so republishing mid-horizon cannot rewrite a week the floor has
42
+ * already worked. `baseline_schedules` names the versions used.
43
+ *
44
+ * Two ratios are returned because either alone misleads: `attainment_pct` caps
45
+ * each campaign at what was asked for, so over-building one SKU cannot hide a miss
46
+ * on another, while `output_ratio_pct` is uncapped and is what reveals
47
+ * over-production. Production with no matching planned campaign is reported as
48
+ * `unplanned_quantity` rather than discarded — that number is the clearest signal
49
+ * a schedule is being worked around.
50
+ *
51
+ * Every ratio is null rather than zero when nothing was planned, and
52
+ * `has_baseline` is false when nothing was ever published over the period.
53
+ *
54
+ * This endpoint requires the permission: `production_schedules:read`.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const analyzeScheduleAttainmentResponse =
59
+ * await client.core.analytics.updateScheduleAttainment({
60
+ * end_date: '2026-05-10T00:23:00Z',
61
+ * start_date: '2026-05-10T00:00:00Z',
62
+ * group_by: 'week',
63
+ * });
64
+ * ```
65
+ */
66
+ updateScheduleAttainment(
67
+ body: AnalyticsUpdateScheduleAttainmentParams,
68
+ options?: RequestOptions,
69
+ ): APIPromise<AnalyzeScheduleAttainmentResponse> {
70
+ return this._client.put('/v1/core/analytics/schedule-attainment', { body, ...options });
71
+ }
72
+ }
73
+
74
+ /**
75
+ * AnalyzeOeeRequest is the request to analyze Overall Equipment Effectiveness
76
+ * (OEE).
77
+ */
78
+ export interface AnalyzeOeeRequest {
79
+ /**
80
+ * The end date for the analysis period.
81
+ */
82
+ end_date: string;
83
+
84
+ /**
85
+ * The start date for the analysis period.
86
+ */
87
+ start_date: string;
88
+
89
+ /**
90
+ * Optional department IDs to filter by.
91
+ */
92
+ department_ids?: Array<string>;
93
+
94
+ /**
95
+ * Scheduled production time per department for the period. Availability,
96
+ * performance and OEE are only returned for departments this covers.
97
+ */
98
+ planned_time?: Array<OeeDepartmentPlannedTime>;
99
+ }
100
+
101
+ /**
102
+ * AnalyzeOeeResponse represents the response from the analyze OEE endpoint.
103
+ */
104
+ export interface AnalyzeOeeResponse {
105
+ /**
106
+ * List represents a paginated list of resources.
107
+ */
108
+ departments: ListOeeDepartment | null;
109
+
110
+ /**
111
+ * Resource type identifier.
112
+ */
113
+ object: 'analyze_oee_response';
114
+ }
115
+
116
+ /**
117
+ * AnalyzeScheduleAttainmentRequest is the request to measure production against
118
+ * plan.
119
+ */
120
+ export interface AnalyzeScheduleAttainmentRequest {
121
+ /**
122
+ * The end date for the analysis period.
123
+ */
124
+ end_date: string;
125
+
126
+ /**
127
+ * The start date for the analysis period.
128
+ */
129
+ start_date: string;
130
+
131
+ /**
132
+ * Only measure production in these departments.
133
+ */
134
+ department_ids?: Array<string>;
135
+
136
+ /**
137
+ * The dimension to break the results down by. Defaults to `week`.
138
+ */
139
+ group_by?: 'week' | 'machine' | 'department' | 'item';
140
+
141
+ /**
142
+ * Only measure production on these machines.
143
+ */
144
+ machine_ids?: Array<string>;
145
+ }
146
+
147
+ /**
148
+ * Actual production measured against the plan that was live at the time.
149
+ *
150
+ * The baseline for each week is the version that was published on or before that
151
+ * week began, so republishing mid-horizon cannot rewrite a week the floor has
152
+ * already worked. `baseline_schedules` names the versions used, so any number here
153
+ * can be traced back to the plan that produced it.
154
+ */
155
+ export interface AnalyzeScheduleAttainmentResponse {
156
+ /**
157
+ * List represents a paginated list of resources.
158
+ */
159
+ baseline_schedules: CoreAPI.ListEntity | null;
160
+
161
+ /**
162
+ * Whether the period had a plan to measure against. When `no_baseline`, every
163
+ * ratio is null and the period has no plan rather than a missed one.
164
+ */
165
+ baseline_status: 'measured' | 'no_baseline';
166
+
167
+ /**
168
+ * List represents a paginated list of resources.
169
+ */
170
+ buckets: ListAttainmentBucket | null;
171
+
172
+ /**
173
+ * End of the measured period.
174
+ */
175
+ ends_at: string;
176
+
177
+ /**
178
+ * List represents a paginated list of resources.
179
+ */
180
+ frozen_adherence: ListFrozenAdherence | null;
181
+
182
+ /**
183
+ * The dimension the breakdown is grouped by.
184
+ */
185
+ group_by: 'week' | 'machine' | 'department' | 'item';
186
+
187
+ /**
188
+ * Resource type identifier.
189
+ */
190
+ object: 'analyze_schedule_attainment_response';
191
+
192
+ /**
193
+ * Start of the measured period.
194
+ */
195
+ starts_at: string;
196
+
197
+ /**
198
+ * One row of a schedule-attainment breakdown.
199
+ *
200
+ * Both ratios are reported because either alone misleads. `attainment_pct` caps
201
+ * each SKU at what was asked for, so over-building one easy item cannot paper over
202
+ * a total miss on another; `output_ratio_pct` does not cap, so it is the only one
203
+ * that reveals over-production.
204
+ */
205
+ totals: AttainmentBucket;
206
+ }
207
+
208
+ /**
209
+ * One row of a schedule-attainment breakdown.
210
+ *
211
+ * Both ratios are reported because either alone misleads. `attainment_pct` caps
212
+ * each SKU at what was asked for, so over-building one easy item cannot paper over
213
+ * a total miss on another; `output_ratio_pct` does not cap, so it is the only one
214
+ * that reveals over-production.
215
+ */
216
+ export interface AttainmentBucket {
217
+ /**
218
+ * Units actually produced.
219
+ */
220
+ actual_quantity: number;
221
+
222
+ /**
223
+ * Share of the plan that was met. Null when nothing was planned.
224
+ */
225
+ attainment_pct: number | null;
226
+
227
+ /**
228
+ * Batches scanned in this bucket.
229
+ */
230
+ batch_count: number;
231
+
232
+ /**
233
+ * Identifies the bucket within the chosen grouping — a week start, machine ID,
234
+ * department ID or item ID.
235
+ */
236
+ key: string;
237
+
238
+ /**
239
+ * Display label for the bucket.
240
+ */
241
+ label: string;
242
+
243
+ /**
244
+ * Units produced that were planned for, capped per campaign at what was asked.
245
+ */
246
+ matched_quantity: number;
247
+
248
+ /**
249
+ * Output as a share of plan, uncapped. Null when nothing was planned.
250
+ */
251
+ output_ratio_pct: number | null;
252
+
253
+ /**
254
+ * Planned campaigns in this bucket.
255
+ */
256
+ planned_lines: number;
257
+
258
+ /**
259
+ * Units the live plan called for.
260
+ */
261
+ planned_quantity: number;
262
+
263
+ /**
264
+ * Machine hours the plan called for.
265
+ */
266
+ planned_run_hours: number;
267
+
268
+ /**
269
+ * Units produced with no matching planned campaign.
270
+ */
271
+ unplanned_quantity: number;
272
+
273
+ /**
274
+ * Units scrapped.
275
+ */
276
+ waste_quantity: number;
277
+
278
+ /**
279
+ * First day of the week, when grouping by week.
280
+ */
281
+ week_starts_at: string | null;
282
+ }
283
+
284
+ /**
285
+ * How well a published commitment survived the week it covered.
286
+ */
287
+ export interface FrozenAdherence {
288
+ /**
289
+ * Total absolute unit change across frozen-week deviations.
290
+ */
291
+ abs_delta_units: number;
292
+
293
+ /**
294
+ * Campaigns added into the frozen window after publish.
295
+ */
296
+ added_lines: number;
297
+
298
+ /**
299
+ * Frozen campaigns that were changed after publish.
300
+ */
301
+ deviated_lines: number;
302
+
303
+ /**
304
+ * Campaigns frozen at publish.
305
+ */
306
+ frozen_line_count: number;
307
+
308
+ /**
309
+ * Units frozen at publish.
310
+ */
311
+ frozen_planned_quantity: number;
312
+
313
+ /**
314
+ * Last day of the frozen window.
315
+ */
316
+ frozen_through_at: string | null;
317
+
318
+ /**
319
+ * Share of frozen campaigns that survived untouched. Null when nothing was frozen.
320
+ */
321
+ line_adherence_pct: number | null;
322
+
323
+ /**
324
+ * Entity is a polymorphic reference to any resource in the system.
325
+ */
326
+ schedule: CoreAPI.Entity | null;
327
+
328
+ /**
329
+ * Share of frozen units that survived untouched. Null when nothing was frozen.
330
+ */
331
+ units_adherence_pct: number | null;
332
+
333
+ /**
334
+ * Version number of that schedule.
335
+ */
336
+ version: number;
337
+ }
338
+
339
+ /**
340
+ * List represents a paginated list of resources.
341
+ */
342
+ export interface ListAttainmentBucket {
343
+ /**
344
+ * Resources in this page.
345
+ */
346
+ data: Array<AttainmentBucket>;
347
+
348
+ /**
349
+ * Resource type identifier.
350
+ */
351
+ object: 'list';
352
+
353
+ /**
354
+ * PageInfo contains URL-based pagination metadata.
355
+ */
356
+ page_info: APIKeysAPI.PageInfo;
357
+ }
358
+
359
+ /**
360
+ * List represents a paginated list of resources.
361
+ */
362
+ export interface ListFrozenAdherence {
363
+ /**
364
+ * Resources in this page.
365
+ */
366
+ data: Array<FrozenAdherence>;
367
+
368
+ /**
369
+ * Resource type identifier.
370
+ */
371
+ object: 'list';
372
+
373
+ /**
374
+ * PageInfo contains URL-based pagination metadata.
375
+ */
376
+ page_info: APIKeysAPI.PageInfo;
377
+ }
378
+
379
+ /**
380
+ * List represents a paginated list of resources.
381
+ */
382
+ export interface ListOeeDepartment {
383
+ /**
384
+ * Resources in this page.
385
+ */
386
+ data: Array<OeeDepartment>;
387
+
388
+ /**
389
+ * Resource type identifier.
390
+ */
391
+ object: 'list';
392
+
393
+ /**
394
+ * PageInfo contains URL-based pagination metadata.
395
+ */
396
+ page_info: APIKeysAPI.PageInfo;
397
+ }
398
+
399
+ /**
400
+ * List represents a paginated list of resources.
401
+ */
402
+ export interface ListOeeDowntimeReason {
403
+ /**
404
+ * Resources in this page.
405
+ */
406
+ data: Array<OeeDowntimeReason>;
407
+
408
+ /**
409
+ * Resource type identifier.
410
+ */
411
+ object: 'list';
412
+
413
+ /**
414
+ * PageInfo contains URL-based pagination metadata.
415
+ */
416
+ page_info: APIKeysAPI.PageInfo;
417
+ }
418
+
419
+ /**
420
+ * OeeDepartment represents OEE metrics for a single department.
421
+ */
422
+ export interface OeeDepartment {
423
+ /**
424
+ * Data-quality warnings for this grouping. Empty when the numbers can be taken at
425
+ * face value.
426
+ */
427
+ anomalies: Array<'performance_above_capacity'>;
428
+
429
+ /**
430
+ * Logged downtime charged against availability, in seconds.
431
+ */
432
+ availability_loss_seconds: number;
433
+
434
+ /**
435
+ * Run time divided by scheduled time.
436
+ */
437
+ availability_pct: number | null;
438
+
439
+ /**
440
+ * Time spent changing over between products, in seconds.
441
+ */
442
+ changeover_seconds: number;
443
+
444
+ /**
445
+ * Entity is a polymorphic reference to any resource in the system.
446
+ */
447
+ department: CoreAPI.Entity | null;
448
+
449
+ /**
450
+ * List represents a paginated list of resources.
451
+ */
452
+ downtime_breakdown: ListOeeDowntimeReason | null;
453
+
454
+ /**
455
+ * Number of downtime events logged in the period.
456
+ */
457
+ downtime_event_count: number;
458
+
459
+ /**
460
+ * The estimated runtime in hours.
461
+ */
462
+ estimated_runtime_hours: number;
463
+
464
+ /**
465
+ * The number of good units produced.
466
+ */
467
+ good_units: number;
468
+
469
+ /**
470
+ * The ideal time of the batch tickets in the performance sample, in seconds: what
471
+ * their output should have taken at each production step's ideal cycle time.
472
+ */
473
+ measured_ideal_seconds: number;
474
+
475
+ /**
476
+ * The actual time the sampled tickets took, in seconds, measured from the gaps
477
+ * between consecutive batch-ticket scans per machine, net of downtime already
478
+ * charged elsewhere.
479
+ */
480
+ measured_run_seconds: number;
481
+
482
+ /**
483
+ * Whether availability was measured from logged downtime or estimated from
484
+ * runtime. A department with no logged downtime computes as perfectly available,
485
+ * so an estimate is labelled rather than presented as a measurement.
486
+ */
487
+ measurement_status: 'measured' | 'estimated';
488
+
489
+ /**
490
+ * Time nobody planned to run, removed from the OEE denominator rather than counted
491
+ * as a loss.
492
+ */
493
+ not_scheduled_seconds: number;
494
+
495
+ /**
496
+ * Availability multiplied by performance multiplied by quality.
497
+ */
498
+ oee_pct: number | null;
499
+
500
+ /**
501
+ * How performance_pct was obtained: measured from scan intervals, or fallen back
502
+ * to the shift-pattern run-time estimate. Null when performance_pct is null.
503
+ */
504
+ performance_basis: 'scan_intervals' | 'run_time_estimate' | null;
505
+
506
+ /**
507
+ * Logged downtime charged against performance, in seconds.
508
+ */
509
+ performance_loss_seconds: number;
510
+
511
+ /**
512
+ * Ideal time over actual time for the sampled batch tickets (measured), or
513
+ * standard seconds earned divided by run time (estimated fallback).
514
+ */
515
+ performance_pct: number | null;
516
+
517
+ /**
518
+ * The number of batch tickets in the performance sample.
519
+ */
520
+ performance_ticket_count: number;
521
+
522
+ /**
523
+ * Logged downtime charged against quality, in seconds.
524
+ */
525
+ quality_loss_seconds: number;
526
+
527
+ /**
528
+ * Good units divided by total units produced.
529
+ */
530
+ quality_pct: number | null;
531
+
532
+ /**
533
+ * Scheduled time net of availability losses, in seconds.
534
+ */
535
+ run_time_seconds: number;
536
+
537
+ /**
538
+ * Planned time net of not-scheduled downtime, in seconds.
539
+ */
540
+ scheduled_seconds: number;
541
+
542
+ /**
543
+ * The number of seconds units.
544
+ */
545
+ seconds_units: number;
546
+
547
+ /**
548
+ * The time this output should have taken at each production step's own labor rate.
549
+ * This is the numerator of Performance.
550
+ */
551
+ standard_seconds_earned: number;
552
+
553
+ /**
554
+ * The number of waste units.
555
+ */
556
+ waste_units: number;
557
+ }
558
+
559
+ /**
560
+ * OeeDepartmentPlannedTime supplies the scheduled production time for one
561
+ * department.
562
+ */
563
+ export interface OeeDepartmentPlannedTime {
564
+ /**
565
+ * The department ID.
566
+ */
567
+ department_id: string;
568
+
569
+ /**
570
+ * Scheduled production hours for the period.
571
+ */
572
+ planned_hours: number;
573
+ }
574
+
575
+ /**
576
+ * OeeDowntimeReason represents one reason's contribution to a department's
577
+ * downtime.
578
+ */
579
+ export interface OeeDowntimeReason {
580
+ /**
581
+ * Downtime attributed to this reason, in seconds.
582
+ */
583
+ downtime_seconds: number;
584
+
585
+ /**
586
+ * Number of events logged against this reason.
587
+ */
588
+ event_count: number;
589
+
590
+ /**
591
+ * Which OEE term this reason charges.
592
+ */
593
+ oee_bucket: 'availability' | 'performance' | 'quality' | 'not_scheduled';
594
+
595
+ /**
596
+ * Why the machine stopped.
597
+ */
598
+ reason:
599
+ | 'breakdown'
600
+ | 'changeover'
601
+ | 'material_shortage'
602
+ | 'no_operator'
603
+ | 'planned_maintenance'
604
+ | 'minor_stop'
605
+ | 'quality_hold'
606
+ | 'no_schedule';
607
+ }
608
+
609
+ export interface AnalyticsUpdateOeeParams {
610
+ /**
611
+ * The end date for the analysis period.
612
+ */
613
+ end_date: string;
614
+
615
+ /**
616
+ * The start date for the analysis period.
617
+ */
618
+ start_date: string;
619
+
620
+ /**
621
+ * Optional department IDs to filter by.
622
+ */
623
+ department_ids?: Array<string>;
624
+
625
+ /**
626
+ * Scheduled production time per department for the period. Availability,
627
+ * performance and OEE are only returned for departments this covers.
628
+ */
629
+ planned_time?: Array<OeeDepartmentPlannedTime>;
630
+ }
631
+
632
+ export interface AnalyticsUpdateScheduleAttainmentParams {
633
+ /**
634
+ * The end date for the analysis period.
635
+ */
636
+ end_date: string;
637
+
638
+ /**
639
+ * The start date for the analysis period.
640
+ */
641
+ start_date: string;
642
+
643
+ /**
644
+ * Only measure production in these departments.
645
+ */
646
+ department_ids?: Array<string>;
647
+
648
+ /**
649
+ * The dimension to break the results down by. Defaults to `week`.
650
+ */
651
+ group_by?: 'week' | 'machine' | 'department' | 'item';
652
+
653
+ /**
654
+ * Only measure production on these machines.
655
+ */
656
+ machine_ids?: Array<string>;
657
+ }
658
+
659
+ export declare namespace Analytics {
660
+ export {
661
+ type AnalyzeOeeRequest as AnalyzeOeeRequest,
662
+ type AnalyzeOeeResponse as AnalyzeOeeResponse,
663
+ type AnalyzeScheduleAttainmentRequest as AnalyzeScheduleAttainmentRequest,
664
+ type AnalyzeScheduleAttainmentResponse as AnalyzeScheduleAttainmentResponse,
665
+ type AttainmentBucket as AttainmentBucket,
666
+ type FrozenAdherence as FrozenAdherence,
667
+ type ListAttainmentBucket as ListAttainmentBucket,
668
+ type ListFrozenAdherence as ListFrozenAdherence,
669
+ type ListOeeDepartment as ListOeeDepartment,
670
+ type ListOeeDowntimeReason as ListOeeDowntimeReason,
671
+ type OeeDepartment as OeeDepartment,
672
+ type OeeDepartmentPlannedTime as OeeDepartmentPlannedTime,
673
+ type OeeDowntimeReason as OeeDowntimeReason,
674
+ type AnalyticsUpdateOeeParams as AnalyticsUpdateOeeParams,
675
+ type AnalyticsUpdateScheduleAttainmentParams as AnalyticsUpdateScheduleAttainmentParams,
676
+ };
677
+ }