@augno/sdk 0.18.0 → 0.18.2

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 (280) hide show
  1. package/CHANGELOG.md +2 -7
  2. package/package.json +1 -1
  3. package/resources/ai/memories.d.mts +6 -6
  4. package/resources/ai/memories.d.mts.map +1 -1
  5. package/resources/ai/memories.d.ts +6 -6
  6. package/resources/ai/memories.d.ts.map +1 -1
  7. package/resources/auth/api-keys/api-keys.d.mts +8 -0
  8. package/resources/auth/api-keys/api-keys.d.mts.map +1 -1
  9. package/resources/auth/api-keys/api-keys.d.ts +8 -0
  10. package/resources/auth/api-keys/api-keys.d.ts.map +1 -1
  11. package/resources/auth/api-keys/api-keys.js.map +1 -1
  12. package/resources/auth/api-keys/api-keys.mjs.map +1 -1
  13. package/resources/catalog/items/attributes.d.mts +3 -0
  14. package/resources/catalog/items/attributes.d.mts.map +1 -1
  15. package/resources/catalog/items/attributes.d.ts +3 -0
  16. package/resources/catalog/items/attributes.d.ts.map +1 -1
  17. package/resources/catalog/items/attributes.js +3 -0
  18. package/resources/catalog/items/attributes.js.map +1 -1
  19. package/resources/catalog/items/attributes.mjs +3 -0
  20. package/resources/catalog/items/attributes.mjs.map +1 -1
  21. package/resources/catalog/materials/materials.d.mts +6 -0
  22. package/resources/catalog/materials/materials.d.mts.map +1 -1
  23. package/resources/catalog/materials/materials.d.ts +6 -0
  24. package/resources/catalog/materials/materials.d.ts.map +1 -1
  25. package/resources/catalog/materials/materials.js.map +1 -1
  26. package/resources/catalog/materials/materials.mjs.map +1 -1
  27. package/resources/catalog/parts/parts.d.mts +6 -0
  28. package/resources/catalog/parts/parts.d.mts.map +1 -1
  29. package/resources/catalog/parts/parts.d.ts +6 -0
  30. package/resources/catalog/parts/parts.d.ts.map +1 -1
  31. package/resources/catalog/parts/parts.js.map +1 -1
  32. package/resources/catalog/parts/parts.mjs.map +1 -1
  33. package/resources/catalog/products/products.d.mts +6 -4
  34. package/resources/catalog/products/products.d.mts.map +1 -1
  35. package/resources/catalog/products/products.d.ts +6 -4
  36. package/resources/catalog/products/products.d.ts.map +1 -1
  37. package/resources/catalog/products/products.js.map +1 -1
  38. package/resources/catalog/products/products.mjs.map +1 -1
  39. package/resources/core/actions.d.mts +73 -0
  40. package/resources/core/actions.d.mts.map +1 -0
  41. package/resources/core/actions.d.ts +73 -0
  42. package/resources/core/actions.d.ts.map +1 -0
  43. package/resources/core/actions.js +36 -0
  44. package/resources/core/actions.js.map +1 -0
  45. package/resources/core/actions.mjs +32 -0
  46. package/resources/core/actions.mjs.map +1 -0
  47. package/resources/core/audit-events.d.mts +4 -4
  48. package/resources/core/audit-events.d.mts.map +1 -1
  49. package/resources/core/audit-events.d.ts +4 -4
  50. package/resources/core/audit-events.d.ts.map +1 -1
  51. package/resources/core/core.d.mts +6 -2
  52. package/resources/core/core.d.mts.map +1 -1
  53. package/resources/core/core.d.ts +6 -2
  54. package/resources/core/core.d.ts.map +1 -1
  55. package/resources/core/core.js +4 -0
  56. package/resources/core/core.js.map +1 -1
  57. package/resources/core/core.mjs +4 -0
  58. package/resources/core/core.mjs.map +1 -1
  59. package/resources/core/index.d.mts +1 -0
  60. package/resources/core/index.d.mts.map +1 -1
  61. package/resources/core/index.d.ts +1 -0
  62. package/resources/core/index.d.ts.map +1 -1
  63. package/resources/core/index.js +3 -1
  64. package/resources/core/index.js.map +1 -1
  65. package/resources/core/index.mjs +1 -0
  66. package/resources/core/index.mjs.map +1 -1
  67. package/resources/core/jobs.d.mts +1 -1
  68. package/resources/core/jobs.d.mts.map +1 -1
  69. package/resources/core/jobs.d.ts +1 -1
  70. package/resources/core/jobs.d.ts.map +1 -1
  71. package/resources/messaging/conversations/conversations.d.mts +3 -3
  72. package/resources/messaging/conversations/conversations.d.mts.map +1 -1
  73. package/resources/messaging/conversations/conversations.d.ts +3 -3
  74. package/resources/messaging/conversations/conversations.d.ts.map +1 -1
  75. package/resources/messaging/conversations/conversations.js.map +1 -1
  76. package/resources/messaging/conversations/conversations.mjs.map +1 -1
  77. package/resources/messaging/conversations/links.d.mts +2 -2
  78. package/resources/messaging/conversations/links.d.mts.map +1 -1
  79. package/resources/messaging/conversations/links.d.ts +2 -2
  80. package/resources/messaging/conversations/links.d.ts.map +1 -1
  81. package/resources/messaging/conversations/messages.d.mts +2 -2
  82. package/resources/messaging/conversations/messages.d.mts.map +1 -1
  83. package/resources/messaging/conversations/messages.d.ts +2 -2
  84. package/resources/messaging/conversations/messages.d.ts.map +1 -1
  85. package/resources/messaging/notifications/notifications.d.mts +2 -2
  86. package/resources/messaging/notifications/notifications.d.mts.map +1 -1
  87. package/resources/messaging/notifications/notifications.d.ts +2 -2
  88. package/resources/messaging/notifications/notifications.d.ts.map +1 -1
  89. package/resources/messaging/notifications/notifications.js.map +1 -1
  90. package/resources/messaging/notifications/notifications.mjs.map +1 -1
  91. package/resources/operations/index.d.mts +2 -1
  92. package/resources/operations/index.d.mts.map +1 -1
  93. package/resources/operations/index.d.ts +2 -1
  94. package/resources/operations/index.d.ts.map +1 -1
  95. package/resources/operations/index.js +9 -7
  96. package/resources/operations/index.js.map +1 -1
  97. package/resources/operations/index.mjs +1 -0
  98. package/resources/operations/index.mjs.map +1 -1
  99. package/resources/operations/machine-downtime-events.d.mts +56 -7
  100. package/resources/operations/machine-downtime-events.d.mts.map +1 -1
  101. package/resources/operations/machine-downtime-events.d.ts +56 -7
  102. package/resources/operations/machine-downtime-events.d.ts.map +1 -1
  103. package/resources/operations/machine-downtime-events.js +11 -7
  104. package/resources/operations/machine-downtime-events.js.map +1 -1
  105. package/resources/operations/machine-downtime-events.mjs +11 -7
  106. package/resources/operations/machine-downtime-events.mjs.map +1 -1
  107. package/resources/operations/operating-calendars/closures.d.mts +173 -0
  108. package/resources/operations/operating-calendars/closures.d.mts.map +1 -0
  109. package/resources/operations/operating-calendars/closures.d.ts +173 -0
  110. package/resources/operations/operating-calendars/closures.d.ts.map +1 -0
  111. package/resources/operations/operating-calendars/closures.js +81 -0
  112. package/resources/operations/operating-calendars/closures.js.map +1 -0
  113. package/resources/operations/operating-calendars/closures.mjs +77 -0
  114. package/resources/operations/operating-calendars/closures.mjs.map +1 -0
  115. package/resources/operations/operating-calendars/index.d.mts +3 -0
  116. package/resources/operations/operating-calendars/index.d.mts.map +1 -0
  117. package/resources/operations/operating-calendars/index.d.ts +3 -0
  118. package/resources/operations/operating-calendars/index.d.ts.map +1 -0
  119. package/resources/operations/operating-calendars/index.js +9 -0
  120. package/resources/operations/operating-calendars/index.js.map +1 -0
  121. package/resources/operations/operating-calendars/index.mjs +4 -0
  122. package/resources/operations/operating-calendars/index.mjs.map +1 -0
  123. package/resources/operations/operating-calendars/operating-calendars.d.mts +332 -0
  124. package/resources/operations/operating-calendars/operating-calendars.d.mts.map +1 -0
  125. package/resources/operations/operating-calendars/operating-calendars.d.ts +332 -0
  126. package/resources/operations/operating-calendars/operating-calendars.d.ts.map +1 -0
  127. package/resources/operations/operating-calendars/operating-calendars.js +129 -0
  128. package/resources/operations/operating-calendars/operating-calendars.js.map +1 -0
  129. package/resources/operations/operating-calendars/operating-calendars.mjs +124 -0
  130. package/resources/operations/operating-calendars/operating-calendars.mjs.map +1 -0
  131. package/resources/operations/operating-calendars.d.mts +2 -0
  132. package/resources/operations/operating-calendars.d.mts.map +1 -0
  133. package/resources/operations/operating-calendars.d.ts +2 -0
  134. package/resources/operations/operating-calendars.d.ts.map +1 -0
  135. package/resources/operations/operating-calendars.js +6 -0
  136. package/resources/operations/operating-calendars.js.map +1 -0
  137. package/resources/operations/operating-calendars.mjs +3 -0
  138. package/resources/operations/operating-calendars.mjs.map +1 -0
  139. package/resources/operations/operations.d.mts +6 -2
  140. package/resources/operations/operations.d.mts.map +1 -1
  141. package/resources/operations/operations.d.ts +6 -2
  142. package/resources/operations/operations.d.ts.map +1 -1
  143. package/resources/operations/operations.js +4 -0
  144. package/resources/operations/operations.js.map +1 -1
  145. package/resources/operations/operations.mjs +4 -0
  146. package/resources/operations/operations.mjs.map +1 -1
  147. package/resources/operations/production-schedule-settings/production-schedule-settings.d.mts +43 -12
  148. package/resources/operations/production-schedule-settings/production-schedule-settings.d.mts.map +1 -1
  149. package/resources/operations/production-schedule-settings/production-schedule-settings.d.ts +43 -12
  150. package/resources/operations/production-schedule-settings/production-schedule-settings.d.ts.map +1 -1
  151. package/resources/operations/production-schedule-settings/production-schedule-settings.js.map +1 -1
  152. package/resources/operations/production-schedule-settings/production-schedule-settings.mjs.map +1 -1
  153. package/resources/operations/production-schedules/actions.d.mts +34 -1
  154. package/resources/operations/production-schedules/actions.d.mts.map +1 -1
  155. package/resources/operations/production-schedules/actions.d.ts +34 -1
  156. package/resources/operations/production-schedules/actions.d.ts.map +1 -1
  157. package/resources/operations/production-schedules/actions.js +8 -0
  158. package/resources/operations/production-schedules/actions.js.map +1 -1
  159. package/resources/operations/production-schedules/actions.mjs +8 -0
  160. package/resources/operations/production-schedules/actions.mjs.map +1 -1
  161. package/resources/operations/production-schedules/index.d.mts +1 -1
  162. package/resources/operations/production-schedules/index.d.mts.map +1 -1
  163. package/resources/operations/production-schedules/index.d.ts +1 -1
  164. package/resources/operations/production-schedules/index.d.ts.map +1 -1
  165. package/resources/operations/production-schedules/index.js.map +1 -1
  166. package/resources/operations/production-schedules/index.mjs.map +1 -1
  167. package/resources/operations/production-schedules/lines.d.mts +10 -6
  168. package/resources/operations/production-schedules/lines.d.mts.map +1 -1
  169. package/resources/operations/production-schedules/lines.d.ts +10 -6
  170. package/resources/operations/production-schedules/lines.d.ts.map +1 -1
  171. package/resources/operations/production-schedules/production-schedules.d.mts +295 -2
  172. package/resources/operations/production-schedules/production-schedules.d.mts.map +1 -1
  173. package/resources/operations/production-schedules/production-schedules.d.ts +295 -2
  174. package/resources/operations/production-schedules/production-schedules.d.ts.map +1 -1
  175. package/resources/operations/production-schedules/production-schedules.js +42 -0
  176. package/resources/operations/production-schedules/production-schedules.js.map +1 -1
  177. package/resources/operations/production-schedules/production-schedules.mjs +42 -0
  178. package/resources/operations/production-schedules/production-schedules.mjs.map +1 -1
  179. package/resources/sales/account-groups.d.mts +2 -1
  180. package/resources/sales/account-groups.d.mts.map +1 -1
  181. package/resources/sales/account-groups.d.ts +2 -1
  182. package/resources/sales/account-groups.d.ts.map +1 -1
  183. package/resources/sales/account-prices/account-prices.d.mts +10 -1
  184. package/resources/sales/account-prices/account-prices.d.mts.map +1 -1
  185. package/resources/sales/account-prices/account-prices.d.ts +10 -1
  186. package/resources/sales/account-prices/account-prices.d.ts.map +1 -1
  187. package/resources/sales/account-prices/account-prices.js.map +1 -1
  188. package/resources/sales/account-prices/account-prices.mjs.map +1 -1
  189. package/resources/sales/addresses.d.mts +20 -0
  190. package/resources/sales/addresses.d.mts.map +1 -1
  191. package/resources/sales/addresses.d.ts +20 -0
  192. package/resources/sales/addresses.d.ts.map +1 -1
  193. package/resources/sales/customers/customers.d.mts +72 -14
  194. package/resources/sales/customers/customers.d.mts.map +1 -1
  195. package/resources/sales/customers/customers.d.ts +72 -14
  196. package/resources/sales/customers/customers.d.ts.map +1 -1
  197. package/resources/sales/customers/customers.js +10 -5
  198. package/resources/sales/customers/customers.js.map +1 -1
  199. package/resources/sales/customers/customers.mjs +10 -5
  200. package/resources/sales/customers/customers.mjs.map +1 -1
  201. package/resources/sales/customers/index.d.mts +1 -1
  202. package/resources/sales/customers/index.d.mts.map +1 -1
  203. package/resources/sales/customers/index.d.ts +1 -1
  204. package/resources/sales/customers/index.d.ts.map +1 -1
  205. package/resources/sales/customers/index.js.map +1 -1
  206. package/resources/sales/customers/index.mjs.map +1 -1
  207. package/resources/sales/index.d.mts +1 -1
  208. package/resources/sales/index.d.mts.map +1 -1
  209. package/resources/sales/index.d.ts +1 -1
  210. package/resources/sales/index.d.ts.map +1 -1
  211. package/resources/sales/index.js.map +1 -1
  212. package/resources/sales/index.mjs.map +1 -1
  213. package/resources/sales/sales-orders/actions.d.mts +217 -1
  214. package/resources/sales/sales-orders/actions.d.mts.map +1 -1
  215. package/resources/sales/sales-orders/actions.d.ts +217 -1
  216. package/resources/sales/sales-orders/actions.d.ts.map +1 -1
  217. package/resources/sales/sales-orders/actions.js +36 -0
  218. package/resources/sales/sales-orders/actions.js.map +1 -1
  219. package/resources/sales/sales-orders/actions.mjs +36 -0
  220. package/resources/sales/sales-orders/actions.mjs.map +1 -1
  221. package/resources/sales/sales-orders/index.d.mts +1 -1
  222. package/resources/sales/sales-orders/index.d.mts.map +1 -1
  223. package/resources/sales/sales-orders/index.d.ts +1 -1
  224. package/resources/sales/sales-orders/index.d.ts.map +1 -1
  225. package/resources/sales/sales-orders/index.js.map +1 -1
  226. package/resources/sales/sales-orders/index.mjs.map +1 -1
  227. package/resources/sales/sales-orders/sales-orders.d.mts +105 -9
  228. package/resources/sales/sales-orders/sales-orders.d.mts.map +1 -1
  229. package/resources/sales/sales-orders/sales-orders.d.ts +105 -9
  230. package/resources/sales/sales-orders/sales-orders.d.ts.map +1 -1
  231. package/resources/sales/sales-orders/sales-orders.js.map +1 -1
  232. package/resources/sales/sales-orders/sales-orders.mjs.map +1 -1
  233. package/resources/sales/sales.d.mts +2 -2
  234. package/resources/sales/sales.d.mts.map +1 -1
  235. package/resources/sales/sales.d.ts +2 -2
  236. package/resources/sales/sales.d.ts.map +1 -1
  237. package/resources/sales/sales.js.map +1 -1
  238. package/resources/sales/sales.mjs.map +1 -1
  239. package/src/resources/ai/memories.ts +6 -6
  240. package/src/resources/auth/api-keys/api-keys.ts +9 -0
  241. package/src/resources/catalog/items/attributes.ts +3 -0
  242. package/src/resources/catalog/materials/materials.ts +6 -0
  243. package/src/resources/catalog/parts/parts.ts +6 -0
  244. package/src/resources/catalog/products/products.ts +6 -4
  245. package/src/resources/core/actions.ts +89 -0
  246. package/src/resources/core/audit-events.ts +16 -0
  247. package/src/resources/core/core.ts +19 -0
  248. package/src/resources/core/index.ts +6 -0
  249. package/src/resources/core/jobs.ts +4 -0
  250. package/src/resources/messaging/conversations/conversations.ts +12 -0
  251. package/src/resources/messaging/conversations/links.ts +8 -0
  252. package/src/resources/messaging/conversations/messages.ts +8 -0
  253. package/src/resources/messaging/notifications/notifications.ts +8 -0
  254. package/src/resources/operations/index.ts +15 -0
  255. package/src/resources/operations/machine-downtime-events.ts +62 -7
  256. package/src/resources/operations/operating-calendars/closures.ts +223 -0
  257. package/src/resources/operations/operating-calendars/index.ts +23 -0
  258. package/src/resources/operations/operating-calendars/operating-calendars.ts +427 -0
  259. package/src/resources/operations/operating-calendars.ts +3 -0
  260. package/src/resources/operations/operations.ts +36 -0
  261. package/src/resources/operations/production-schedule-settings/production-schedule-settings.ts +49 -12
  262. package/src/resources/operations/production-schedules/actions.ts +37 -1
  263. package/src/resources/operations/production-schedules/index.ts +4 -0
  264. package/src/resources/operations/production-schedules/lines.ts +10 -6
  265. package/src/resources/operations/production-schedules/production-schedules.ts +354 -1
  266. package/src/resources/sales/account-groups.ts +2 -1
  267. package/src/resources/sales/account-prices/account-prices.ts +11 -1
  268. package/src/resources/sales/addresses.ts +24 -0
  269. package/src/resources/sales/customers/customers.ts +90 -14
  270. package/src/resources/sales/customers/index.ts +1 -0
  271. package/src/resources/sales/index.ts +1 -0
  272. package/src/resources/sales/sales-orders/actions.ts +266 -0
  273. package/src/resources/sales/sales-orders/index.ts +4 -0
  274. package/src/resources/sales/sales-orders/sales-orders.ts +131 -7
  275. package/src/resources/sales/sales.ts +2 -0
  276. package/src/version.ts +1 -1
  277. package/version.d.mts +1 -1
  278. package/version.d.ts +1 -1
  279. package/version.js +1 -1
  280. package/version.mjs +1 -1
@@ -210,6 +210,14 @@ export class Actions extends APIResource {
210
210
  * released line records the run now carrying it, and a line that is already
211
211
  * released is never re-pointed.
212
212
  *
213
+ * Lots an earlier week already issued are carried forward rather than reissued.
214
+ * When a week fell short, the next plan asks for the shortfall — and the batches
215
+ * covering it are usually already printed and sitting on the floor. Those tickets
216
+ * are moved into this run and counted against the campaign, so only the genuinely
217
+ * new work is created. `carried_forward_batch_count` says how many arrived that
218
+ * way, and each one names the run it came off. Send `skip_carry_forward` to issue
219
+ * the whole week new instead.
220
+ *
213
221
  * Cancelled campaigns and campaigns planned at zero are left behind rather than
214
222
  * released. A week that would produce an implausible number of batches is rejected
215
223
  * outright, since that is far more likely to be a misconfigured lot size than a
@@ -679,6 +687,16 @@ export interface ReleaseProductionScheduleWeekRequest {
679
687
  * Applied to every batch this release creates, across all machines in the week.
680
688
  */
681
689
  scanning_station_id?: string;
690
+
691
+ /**
692
+ * Issue the whole week as new batches, leaving an earlier week's unworked lots
693
+ * where they are.
694
+ *
695
+ * Off unless you ask for it: reprinting a ticket the floor is already holding is
696
+ * exactly what carrying work forward exists to prevent, so it takes a deliberate
697
+ * choice to do it.
698
+ */
699
+ skip_carry_forward?: boolean;
682
700
  }
683
701
 
684
702
  /**
@@ -689,10 +707,18 @@ export interface ReleaseProductionScheduleWeekRequest {
689
707
  */
690
708
  export interface ReleaseScheduleWeekResult {
691
709
  /**
692
- * How many batches were created across all campaigns.
710
+ * How many batches the run holds across all campaigns, created and carried forward
711
+ * together.
693
712
  */
694
713
  batch_count: number;
695
714
 
715
+ /**
716
+ * How many of `batch_count` were moved off an earlier run rather than created.
717
+ *
718
+ * Tickets for these are already printed and on the floor.
719
+ */
720
+ carried_forward_batch_count: number;
721
+
696
722
  /**
697
723
  * A single page of resources, together with the metadata needed to page through
698
724
  * the rest of the result set.
@@ -1116,6 +1142,16 @@ export interface ActionReleaseWeekParams {
1116
1142
  * Applied to every batch this release creates, across all machines in the week.
1117
1143
  */
1118
1144
  scanning_station_id?: string;
1145
+
1146
+ /**
1147
+ * Issue the whole week as new batches, leaving an earlier week's unworked lots
1148
+ * where they are.
1149
+ *
1150
+ * Off unless you ask for it: reprinting a ticket the floor is already holding is
1151
+ * exactly what carrying work forward exists to prevent, so it takes a deliberate
1152
+ * choice to do it.
1153
+ */
1154
+ skip_carry_forward?: boolean;
1119
1155
  }
1120
1156
 
1121
1157
  export declare namespace Actions {
@@ -44,6 +44,7 @@ export {
44
44
  type ListProductionScheduleDerivedLine,
45
45
  type ListProductionScheduleDeviation,
46
46
  type ListProductionScheduleFinishedPolicy,
47
+ type ListProductionScheduleFinishingLine,
47
48
  type ListProductionScheduleItemPolicy,
48
49
  type ListReleaseScheduleBatch,
49
50
  type ListReleasedScheduleLine,
@@ -55,6 +56,7 @@ export {
55
56
  type ProductionScheduleDerivedLine,
56
57
  type ProductionScheduleDeviation,
57
58
  type ProductionScheduleFinishedPolicy,
59
+ type ProductionScheduleFinishingLine,
58
60
  type ProductionScheduleItemPolicy,
59
61
  type ReleaseScheduleBatch,
60
62
  type ReleaseScheduleWeekPreview,
@@ -62,11 +64,13 @@ export {
62
64
  type ScheduleAppliedOverride,
63
65
  type ScheduleAtRiskOrder,
64
66
  type ScheduleDiagnostics,
67
+ type ScheduleFinishingDiagnostics,
65
68
  type ScheduleOrderCoverage,
66
69
  type ScheduleOrderCoverageLine,
67
70
  type ProductionScheduleDeleteResponse,
68
71
  type ProductionScheduleListParams,
69
72
  type ProductionScheduleCreateParams,
73
+ type ProductionScheduleRetrieveFinishingLinesParams,
70
74
  type ProductionScheduleRetrieveDerivedLinesParams,
71
75
  type ProductionScheduleRetrieveDeviationsParams,
72
76
  type ProductionScheduleRetrieveWeekReleasePreviewParams,
@@ -425,9 +425,11 @@ export interface UpdateProductionScheduleLineRequest {
425
425
  /**
426
426
  * Units to build over the campaign.
427
427
  *
428
- * Changing this does not re-derive `lots` or `run_hours` send those alongside it
429
- * when they should follow, or the campaign will keep claiming its old share of
430
- * machine time.
428
+ * Changing this re-derives `lots` and `run_hours` from the rate and lot size this
429
+ * version was solved with, so the campaign never keeps claiming its old share of
430
+ * machine time; send either alongside it to override what is derived. A campaign
431
+ * builds something by definition, so use delete rather than a quantity of zero to
432
+ * take it off the plan.
431
433
  */
432
434
  quantity?: number;
433
435
 
@@ -587,9 +589,11 @@ export interface LineUpdateParams {
587
589
  /**
588
590
  * Body param: Units to build over the campaign.
589
591
  *
590
- * Changing this does not re-derive `lots` or `run_hours` send those alongside it
591
- * when they should follow, or the campaign will keep claiming its old share of
592
- * machine time.
592
+ * Changing this re-derives `lots` and `run_hours` from the rate and lot size this
593
+ * version was solved with, so the campaign never keeps claiming its old share of
594
+ * machine time; send either alongside it to override what is derived. A campaign
595
+ * builds something by definition, so use delete rather than a quantity of zero to
596
+ * take it off the plan.
593
597
  */
594
598
  quantity?: number;
595
599
 
@@ -198,6 +198,48 @@ export class ProductionSchedules extends APIResource {
198
198
  return this._client.get(path`/v1/operations/production-schedules/${id}/finished-policies`, options);
199
199
  }
200
200
 
201
+ /**
202
+ * Returns the second stage of a schedule: how many of which finished good to make
203
+ * from the knitted parts, week by week.
204
+ *
205
+ * The constraint plan says how much greige to knit and deliberately does not say
206
+ * what to turn it into — a family's demand is pooled onto the greige precisely so
207
+ * the buffer can sit at the undifferentiated stage, where it is cheapest. These
208
+ * lines are where that pooling is undone, against each finished SKU's own stock
209
+ * position, its own orders, and the hours the rest of the factory has that week.
210
+ *
211
+ * Levelled, not merely allocated. Work that does not fit a week moves to the next
212
+ * one rather than being dropped, so the plan never asks the second stage for more
213
+ * hours than it has. Two things bound it, and they are reported separately in the
214
+ * schedule's diagnostics because they call for opposite responses: a SKU held back
215
+ * for want of greige is a knitting problem, and a SKU held back for want of hours
216
+ * is a finishing one.
217
+ *
218
+ * Everything is counted in the constraint item's unit, so `greige_consumed` here
219
+ * and `planned_quantity` on the constraint plan are directly comparable — which is
220
+ * what lets the two stages be reconciled rather than only read side by side.
221
+ *
222
+ * This endpoint requires the permission: `production_schedules:read`.
223
+ *
224
+ * @example
225
+ * ```ts
226
+ * const listProductionScheduleFinishingLine =
227
+ * await client.operations.productionSchedules.retrieveFinishingLines(
228
+ * 'pnsc_m4zt3z8g8src',
229
+ * );
230
+ * ```
231
+ */
232
+ retrieveFinishingLines(
233
+ id: string,
234
+ query: ProductionScheduleRetrieveFinishingLinesParams | null | undefined = {},
235
+ options?: RequestOptions,
236
+ ): APIPromise<ListProductionScheduleFinishingLine> {
237
+ return this._client.get(path`/v1/operations/production-schedules/${id}/finishing-lines`, {
238
+ query,
239
+ ...options,
240
+ });
241
+ }
242
+
201
243
  /**
202
244
  * Returns the department work implied by a schedule's constraint plan.
203
245
  *
@@ -306,6 +348,11 @@ export class ProductionSchedules extends APIResource {
306
348
  * the release excludes them, so a week holding nothing but those previews as
307
349
  * empty.
308
350
  *
351
+ * Lots the floor is already holding are named as such. A batch with
352
+ * `carried_forward_from` set is a ticket an earlier week issued and nobody worked,
353
+ * which the release moves into the new run rather than reissuing, so nothing has
354
+ * to be reprinted.
355
+ *
309
356
  * This endpoint requires the permission: `production_schedules:read`.
310
357
  *
311
358
  * @example
@@ -497,6 +544,33 @@ export interface ListProductionScheduleFinishedPolicy {
497
544
  page_info: APIKeysAPI.PageInfo;
498
545
  }
499
546
 
547
+ /**
548
+ * A single page of resources, together with the metadata needed to page through
549
+ * the rest of the result set.
550
+ */
551
+ export interface ListProductionScheduleFinishingLine {
552
+ /**
553
+ * Resources in this page.
554
+ */
555
+ data: Array<ProductionScheduleFinishingLine>;
556
+
557
+ /**
558
+ * Resource type identifier.
559
+ */
560
+ object: 'list';
561
+
562
+ /**
563
+ * PageInfo describes where the current page sits within a paginated result set and
564
+ * how to move to the adjacent pages.
565
+ *
566
+ * Page a list by following the URLs below rather than assembling cursors yourself.
567
+ * For a top-level list endpoint the URL repeats the original request's query
568
+ * string with only the cursor swapped, so following it preserves the same filters,
569
+ * search term, and page size.
570
+ */
571
+ page_info: APIKeysAPI.PageInfo;
572
+ }
573
+
500
574
  /**
501
575
  * A single page of resources, together with the metadata needed to page through
502
576
  * the rest of the result set.
@@ -1186,6 +1260,150 @@ export interface ProductionScheduleFinishedPolicy {
1186
1260
  weeks_of_cover: number;
1187
1261
  }
1188
1262
 
1263
+ /**
1264
+ * One finished good's build in one week: the second stage of the plan.
1265
+ *
1266
+ * The constraint plan says how much greige to knit and deliberately does not say
1267
+ * what to turn it into — a family's demand is pooled onto the greige precisely so
1268
+ * the buffer can sit at the undifferentiated stage. These lines are where that
1269
+ * pooling is undone: how many of which finished good to make from the knitted
1270
+ * parts, decided against each SKU's own stock position, its own orders, and the
1271
+ * hours the rest of the factory has that week.
1272
+ *
1273
+ * Quantities are counted in the constraint item's unit, so `greige_consumed` and
1274
+ * the knit plan's `planned_quantity` are directly comparable. That is what lets
1275
+ * the two stages be reconciled rather than merely read side by side.
1276
+ */
1277
+ export interface ProductionScheduleFinishingLine {
1278
+ /**
1279
+ * Finishing line ID.
1280
+ */
1281
+ id: string;
1282
+
1283
+ /**
1284
+ * Creation timestamp.
1285
+ */
1286
+ created_at: string;
1287
+
1288
+ /**
1289
+ * Entity is a polymorphic reference to any resource in the system.
1290
+ */
1291
+ department: CoreAPI.Entity | null;
1292
+
1293
+ /**
1294
+ * How much of the week's draw on this SKU is an order rather than a forecast.
1295
+ */
1296
+ firm_units: number;
1297
+
1298
+ /**
1299
+ * Units of the constraint item this takes out of the greige buffer.
1300
+ *
1301
+ * Equal to `planned_quantity` unless a finishing yield loss means a finished unit
1302
+ * costs more than one knitted one.
1303
+ */
1304
+ greige_consumed: number;
1305
+
1306
+ /**
1307
+ * Entity is a polymorphic reference to any resource in the system.
1308
+ */
1309
+ greige_item: CoreAPI.Entity | null;
1310
+
1311
+ /**
1312
+ * SKU of that constraint item.
1313
+ */
1314
+ greige_sku: string;
1315
+
1316
+ /**
1317
+ * Whether the line sits inside the published frozen window.
1318
+ */
1319
+ is_frozen: boolean;
1320
+
1321
+ /**
1322
+ * Entity is a polymorphic reference to any resource in the system.
1323
+ */
1324
+ item: CoreAPI.Entity | null;
1325
+
1326
+ /**
1327
+ * Resource type identifier.
1328
+ */
1329
+ object: 'production_schedule_finishing_line';
1330
+
1331
+ /**
1332
+ * Units in one lot.
1333
+ */
1334
+ planned_lot_units: number;
1335
+
1336
+ /**
1337
+ * How many lots the quantity breaks into.
1338
+ */
1339
+ planned_lots: number;
1340
+
1341
+ /**
1342
+ * Units of the finished good to make.
1343
+ */
1344
+ planned_quantity: number;
1345
+
1346
+ /**
1347
+ * Hours of the second stage's capacity this line consumes.
1348
+ */
1349
+ planned_run_hours: number;
1350
+
1351
+ /**
1352
+ * Entity is a polymorphic reference to any resource in the system.
1353
+ */
1354
+ production_schedule: CoreAPI.Entity | null;
1355
+
1356
+ /**
1357
+ * Entity is a polymorphic reference to any resource in the system.
1358
+ */
1359
+ production_step: CoreAPI.Entity | null;
1360
+
1361
+ /**
1362
+ * And after it lands.
1363
+ */
1364
+ projected_on_hand_after: number;
1365
+
1366
+ /**
1367
+ * This SKU's own projected stock before the line lands.
1368
+ */
1369
+ projected_on_hand_before: number;
1370
+
1371
+ /**
1372
+ * SKU of the finished good, as it stood when the plan was generated.
1373
+ */
1374
+ sku: string;
1375
+
1376
+ /**
1377
+ * Whether the solver produced this line or a person did.
1378
+ */
1379
+ source: 'solver' | 'manual';
1380
+
1381
+ /**
1382
+ * Where the line stands.
1383
+ */
1384
+ status: 'planned' | 'released' | 'in_progress' | 'complete' | 'cancelled';
1385
+
1386
+ /**
1387
+ * Abbreviation of the unit everything on this line is counted in.
1388
+ */
1389
+ unit: string | null;
1390
+
1391
+ /**
1392
+ * Last updated timestamp.
1393
+ */
1394
+ updated_at: string;
1395
+
1396
+ /**
1397
+ * Zero-based week offset from the start of the horizon.
1398
+ */
1399
+ week_index: number;
1400
+
1401
+ /**
1402
+ * First day of the week this is planned in.
1403
+ */
1404
+ week_starts_at: string;
1405
+ }
1406
+
1189
1407
  /**
1190
1408
  * The per-item policy behind a schedule version.
1191
1409
  *
@@ -1432,6 +1650,15 @@ export interface ReleaseScheduleBatch {
1432
1650
  */
1433
1651
  batch: CoreAPI.Entity | null;
1434
1652
 
1653
+ /**
1654
+ * The number of the run this ticket came off, when the batch already existed.
1655
+ *
1656
+ * Present on a lot carried forward from an earlier week that the floor never
1657
+ * worked. The ticket is already printed and on the floor, so the release moves it
1658
+ * into the new run rather than issuing a replacement.
1659
+ */
1660
+ carried_forward_from: string | null;
1661
+
1435
1662
  /**
1436
1663
  * Entity is a polymorphic reference to any resource in the system.
1437
1664
  */
@@ -1460,7 +1687,7 @@ export interface ReleaseScheduleBatch {
1460
1687
  */
1461
1688
  export interface ReleaseScheduleWeekPreview {
1462
1689
  /**
1463
- * How many batches would be created.
1690
+ * How many batches the run would hold, created and carried forward together.
1464
1691
  */
1465
1692
  batch_count: number;
1466
1693
 
@@ -1472,6 +1699,11 @@ export interface ReleaseScheduleWeekPreview {
1472
1699
  */
1473
1700
  blocked_reason: string | null;
1474
1701
 
1702
+ /**
1703
+ * How many of `batch_count` would be moved off an earlier run rather than created.
1704
+ */
1705
+ carried_forward_batch_count: number;
1706
+
1475
1707
  /**
1476
1708
  * Entity is a polymorphic reference to any resource in the system.
1477
1709
  */
@@ -1529,6 +1761,12 @@ export interface ReleasedScheduleLine {
1529
1761
  */
1530
1762
  batches: ListReleaseScheduleBatch | null;
1531
1763
 
1764
+ /**
1765
+ * How much of `planned_quantity` is covered by tickets an earlier week already
1766
+ * issued.
1767
+ */
1768
+ carried_forward_quantity: number;
1769
+
1532
1770
  /**
1533
1771
  * Entity is a polymorphic reference to any resource in the system.
1534
1772
  */
@@ -1722,6 +1960,33 @@ export interface ScheduleDiagnostics {
1722
1960
  */
1723
1961
  excluded_item_count: number;
1724
1962
 
1963
+ /**
1964
+ * How the second stage fared: what it could not make, and which of the two things
1965
+ * it ran out of.
1966
+ *
1967
+ * The two starvation lists are the point of planning in two stages at all. A
1968
+ * finished good held back for want of greige is a knitting problem — knit more of
1969
+ * it, or knit it sooner — and one held back for want of hours is a finishing
1970
+ * problem: another shift, or a different mix. A single "short" list would throw
1971
+ * that distinction away, and it is the only thing this model knows that a
1972
+ * one-stage plan does not.
1973
+ */
1974
+ finishing: ScheduleFinishingDiagnostics;
1975
+
1976
+ /**
1977
+ * Whether the second stage's capacity was estimated rather than counted from
1978
+ * machines.
1979
+ */
1980
+ finishing_capacity_is_estimated: boolean;
1981
+
1982
+ /**
1983
+ * Machines outside the constraint department that the second stage was sized from.
1984
+ *
1985
+ * Zero means its capacity was estimated from the shift pattern alone rather than
1986
+ * counted.
1987
+ */
1988
+ finishing_machine_count: number;
1989
+
1725
1990
  /**
1726
1991
  * Outstanding order quantity this plan owes, expressed in the constraint item's
1727
1992
  * own unit.
@@ -1772,6 +2037,69 @@ export interface ScheduleDiagnostics {
1772
2037
  unschedulable_skus: Array<string>;
1773
2038
  }
1774
2039
 
2040
+ /**
2041
+ * How the second stage fared: what it could not make, and which of the two things
2042
+ * it ran out of.
2043
+ *
2044
+ * The two starvation lists are the point of planning in two stages at all. A
2045
+ * finished good held back for want of greige is a knitting problem — knit more of
2046
+ * it, or knit it sooner — and one held back for want of hours is a finishing
2047
+ * problem: another shift, or a different mix. A single "short" list would throw
2048
+ * that distinction away, and it is the only thing this model knows that a
2049
+ * one-stage plan does not.
2050
+ */
2051
+ export interface ScheduleFinishingDiagnostics {
2052
+ /**
2053
+ * Finished goods that had greige and never had hours.
2054
+ */
2055
+ capacity_starved_skus: Array<string>;
2056
+
2057
+ /**
2058
+ * Finished goods that wanted building across the whole horizon and never had
2059
+ * greige to build from.
2060
+ */
2061
+ greige_starved_skus: Array<string>;
2062
+
2063
+ /**
2064
+ * Finished goods with no measured finishing rate, which cannot be levelled because
2065
+ * the hours they cost are unknown.
2066
+ */
2067
+ items_without_run_rate: Array<string>;
2068
+
2069
+ /**
2070
+ * How many finishing lines the plan holds.
2071
+ */
2072
+ line_count: number;
2073
+
2074
+ /**
2075
+ * Hours the plan asks of it, week by week.
2076
+ */
2077
+ planned_hours_by_week: Array<number>;
2078
+
2079
+ /**
2080
+ * Total finished units the stage plans across the horizon.
2081
+ */
2082
+ total_planned_units: number;
2083
+
2084
+ /**
2085
+ * Constraint output the horizon never converts into anything.
2086
+ *
2087
+ * A large figure means the two stages are planned against different demand, which
2088
+ * is worth looking at rather than leaving as an unexplained pile of greige.
2089
+ */
2090
+ unused_greige_units: number;
2091
+
2092
+ /**
2093
+ * Those hours as a fraction of capacity, week by week.
2094
+ */
2095
+ utilisation_by_week: Array<number>;
2096
+
2097
+ /**
2098
+ * Hours the second stage can work in one week.
2099
+ */
2100
+ weekly_capacity_hours: number;
2101
+ }
2102
+
1775
2103
  /**
1776
2104
  * An order this schedule does not build in time, with the campaigns covering the
1777
2105
  * part it does.
@@ -1932,6 +2260,19 @@ export interface ProductionScheduleCreateParams {
1932
2260
  planning_as_of?: string;
1933
2261
  }
1934
2262
 
2263
+ export interface ProductionScheduleRetrieveFinishingLinesParams {
2264
+ /**
2265
+ * Only the finishing planned for this finished good.
2266
+ */
2267
+ item_id?: string;
2268
+
2269
+ /**
2270
+ * Only the finishing planned for this week, zero-based from the start of the
2271
+ * horizon.
2272
+ */
2273
+ week_index?: number;
2274
+ }
2275
+
1935
2276
  export interface ProductionScheduleRetrieveDerivedLinesParams {
1936
2277
  /**
1937
2278
  * Only return work owned by these departments.
@@ -1976,6 +2317,14 @@ export interface ProductionScheduleRetrieveDeviationsParams {
1976
2317
  }
1977
2318
 
1978
2319
  export interface ProductionScheduleRetrieveWeekReleasePreviewParams {
2320
+ /**
2321
+ * Preview the week as if every batch were newly issued.
2322
+ *
2323
+ * By default the preview counts tickets an earlier week issued and the floor never
2324
+ * worked against this week's campaigns, because that is what releasing would do.
2325
+ */
2326
+ skip_carry_forward?: boolean;
2327
+
1979
2328
  /**
1980
2329
  * Zero-based week offset from the start of the horizon.
1981
2330
  */
@@ -1992,6 +2341,7 @@ export declare namespace ProductionSchedules {
1992
2341
  type ListProductionScheduleDerivedLine as ListProductionScheduleDerivedLine,
1993
2342
  type ListProductionScheduleDeviation as ListProductionScheduleDeviation,
1994
2343
  type ListProductionScheduleFinishedPolicy as ListProductionScheduleFinishedPolicy,
2344
+ type ListProductionScheduleFinishingLine as ListProductionScheduleFinishingLine,
1995
2345
  type ListProductionScheduleItemPolicy as ListProductionScheduleItemPolicy,
1996
2346
  type ListReleaseScheduleBatch as ListReleaseScheduleBatch,
1997
2347
  type ListReleasedScheduleLine as ListReleasedScheduleLine,
@@ -2003,6 +2353,7 @@ export declare namespace ProductionSchedules {
2003
2353
  type ProductionScheduleDerivedLine as ProductionScheduleDerivedLine,
2004
2354
  type ProductionScheduleDeviation as ProductionScheduleDeviation,
2005
2355
  type ProductionScheduleFinishedPolicy as ProductionScheduleFinishedPolicy,
2356
+ type ProductionScheduleFinishingLine as ProductionScheduleFinishingLine,
2006
2357
  type ProductionScheduleItemPolicy as ProductionScheduleItemPolicy,
2007
2358
  type ReleaseScheduleBatch as ReleaseScheduleBatch,
2008
2359
  type ReleaseScheduleWeekPreview as ReleaseScheduleWeekPreview,
@@ -2010,11 +2361,13 @@ export declare namespace ProductionSchedules {
2010
2361
  type ScheduleAppliedOverride as ScheduleAppliedOverride,
2011
2362
  type ScheduleAtRiskOrder as ScheduleAtRiskOrder,
2012
2363
  type ScheduleDiagnostics as ScheduleDiagnostics,
2364
+ type ScheduleFinishingDiagnostics as ScheduleFinishingDiagnostics,
2013
2365
  type ScheduleOrderCoverage as ScheduleOrderCoverage,
2014
2366
  type ScheduleOrderCoverageLine as ScheduleOrderCoverageLine,
2015
2367
  type ProductionScheduleDeleteResponse as ProductionScheduleDeleteResponse,
2016
2368
  type ProductionScheduleListParams as ProductionScheduleListParams,
2017
2369
  type ProductionScheduleCreateParams as ProductionScheduleCreateParams,
2370
+ type ProductionScheduleRetrieveFinishingLinesParams as ProductionScheduleRetrieveFinishingLinesParams,
2018
2371
  type ProductionScheduleRetrieveDerivedLinesParams as ProductionScheduleRetrieveDerivedLinesParams,
2019
2372
  type ProductionScheduleRetrieveDeviationsParams as ProductionScheduleRetrieveDeviationsParams,
2020
2373
  type ProductionScheduleRetrieveWeekReleasePreviewParams as ProductionScheduleRetrieveWeekReleasePreviewParams,
@@ -164,7 +164,8 @@ export interface AccountGroup {
164
164
 
165
165
  /**
166
166
  * Calendar days between an order being issued and it being due to ship, inherited
167
- * by every customer in this group that has not set its own.
167
+ * by every customer in this group that has neither set its own nor inherited one
168
+ * from a parent account.
168
169
  */
169
170
  default_lead_time_days: number | null;
170
171
 
@@ -537,7 +537,8 @@ export interface CustomerDefaults {
537
537
  * Calendar days between an order being issued and it being due to ship.
538
538
  *
539
539
  * Sets each order's `ship_by_date` when it is issued. With none set here the
540
- * customer inherits its account group's lead time, then the account default.
540
+ * customer inherits its parent account's lead time, then its account group's, then
541
+ * the account default.
541
542
  */
542
543
  lead_time_days: number | null;
543
544
 
@@ -561,6 +562,15 @@ export interface CustomerDefaults {
561
562
  */
562
563
  priority: Priority | null;
563
564
 
565
+ /**
566
+ * The operating calendar naming the days this customer's dock accepts freight.
567
+ *
568
+ * A promised delivery date is worked back from a day the customer can actually
569
+ * receive on. With none set here the customer inherits its account group's
570
+ * calendar, then the account default, then Monday to Friday.
571
+ */
572
+ receive_calendar_id: string | null;
573
+
564
574
  /**
565
575
  * A user's membership in an account, carrying the account-specific status, role,
566
576
  * and department.
@@ -171,6 +171,12 @@ export interface AddressInput {
171
171
  */
172
172
  postal_code?: string;
173
173
 
174
+ /**
175
+ * The operating calendar naming the days this dock accepts freight, overriding the
176
+ * customer's own.
177
+ */
178
+ receive_calendar_id?: string;
179
+
174
180
  /**
175
181
  * State or administrative area.
176
182
  */
@@ -263,6 +269,12 @@ export interface UpdateAddressRequest {
263
269
  */
264
270
  postal_code?: string;
265
271
 
272
+ /**
273
+ * The operating calendar naming the days this dock accepts freight, overriding the
274
+ * customer's own. Clearing it returns this address to the customer's own calendar.
275
+ */
276
+ receive_calendar_id?: string | null;
277
+
266
278
  /**
267
279
  * State or administrative area.
268
280
  */
@@ -351,6 +363,12 @@ export interface AddressCreateParams {
351
363
  */
352
364
  postal_code?: string;
353
365
 
366
+ /**
367
+ * The operating calendar naming the days this dock accepts freight, overriding the
368
+ * customer's own.
369
+ */
370
+ receive_calendar_id?: string;
371
+
354
372
  /**
355
373
  * State or administrative area.
356
374
  */
@@ -411,6 +429,12 @@ export interface AddressUpdateParams {
411
429
  */
412
430
  postal_code?: string;
413
431
 
432
+ /**
433
+ * The operating calendar naming the days this dock accepts freight, overriding the
434
+ * customer's own. Clearing it returns this address to the customer's own calendar.
435
+ */
436
+ receive_calendar_id?: string | null;
437
+
414
438
  /**
415
439
  * State or administrative area.
416
440
  */