@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,468 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as UnitsAPI from "../catalog/units.js";
3
+ import * as CoreAPI from "../core/core.js";
4
+ import * as RequestLogsAPI from "../core/request-logs.js";
5
+ import * as APIKeysAPI from "../auth/api-keys/api-keys.js";
6
+ import { APIPromise } from "../../core/api-promise.js";
7
+ import { RequestOptions } from "../../internal/request-options.js";
8
+ /**
9
+ * Adjust the demand a production schedule plans against. Overrides are how management accounts for demand that sales history cannot see.
10
+ */
11
+ export declare class DemandOverrides extends APIResource {
12
+ /**
13
+ * Returns a paginated list of demand overrides, most recently created first.
14
+ *
15
+ * The period filters match on overlap rather than containment, so an override
16
+ * spanning a quarter is returned when querying a single month inside it.
17
+ *
18
+ * This endpoint requires the permission: `demand_overrides:read`.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const listDemandOverride =
23
+ * await client.operations.demandOverrides.list();
24
+ * ```
25
+ */
26
+ list(query?: DemandOverrideListParams | null | undefined, options?: RequestOptions): APIPromise<ListDemandOverride>;
27
+ /**
28
+ * Retrieves a single demand override by ID.
29
+ *
30
+ * This endpoint requires the permission: `demand_overrides:read`.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const demandOverride =
35
+ * await client.operations.demandOverrides.retrieve(
36
+ * 'deov_0192b7d38c4f5a9b02d3e16f88',
37
+ * );
38
+ * ```
39
+ */
40
+ retrieve(id: string, query?: DemandOverrideRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<DemandOverride>;
41
+ /**
42
+ * Creates a demand override.
43
+ *
44
+ * The scope reference is validated against the account's items or product lines,
45
+ * so an override can never silently match nothing. An `account`-scoped override
46
+ * applies to every planned item and takes no scope reference; it must be a delta,
47
+ * not an absolute value. An `absolute` value replaces the forecast for the period,
48
+ * `delta_units` adds to it, and `delta_percent` scales it; a percent override
49
+ * cannot reduce demand by more than 100%.
50
+ *
51
+ * This endpoint requires the permission: `demand_overrides:create`.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const demandOverride =
56
+ * await client.operations.demandOverrides.create({
57
+ * adjustment: 'delta_units',
58
+ * period_ends_at: '2026-05-10T00:23:00Z',
59
+ * period_starts_at: '2026-05-10T00:00:00Z',
60
+ * scope_ref_id: 'it_0131e386ac683e8c29a71f6f1f',
61
+ * scope_type: 'item',
62
+ * value: 5000,
63
+ * });
64
+ * ```
65
+ */
66
+ create(params: DemandOverrideCreateParams, options?: RequestOptions): APIPromise<DemandOverride>;
67
+ /**
68
+ * Updates a demand override.
69
+ *
70
+ * The type and value are validated as a pair against the resulting override, so
71
+ * switching an existing units adjustment to `delta_percent` is checked as a
72
+ * percent even when only the type is sent.
73
+ *
74
+ * This endpoint requires the permission: `demand_overrides:update`.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const demandOverride =
79
+ * await client.operations.demandOverrides.update(
80
+ * 'deov_0192b7d38c4f5a9b02d3e16f88',
81
+ * { value: 7500 },
82
+ * );
83
+ * ```
84
+ */
85
+ update(id: string, params?: DemandOverrideUpdateParams | null | undefined, options?: RequestOptions): APIPromise<DemandOverride>;
86
+ /**
87
+ * Deletes a demand override.
88
+ *
89
+ * Schedules already generated are unaffected: a version snapshots the overrides it
90
+ * applied, so deleting one changes future solves only.
91
+ *
92
+ * This endpoint requires the permission: `demand_overrides:delete`.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const demandOverride =
97
+ * await client.operations.demandOverrides.delete(
98
+ * 'deov_0192b7d38c4f5a9b02d3e16f88',
99
+ * );
100
+ * ```
101
+ */
102
+ delete(id: string, options?: RequestOptions): APIPromise<DemandOverrideDeleteResponse>;
103
+ }
104
+ /**
105
+ * Request to create a demand override.
106
+ */
107
+ export interface CreateDemandOverrideRequest {
108
+ /**
109
+ * How the value adjusts the forecast.
110
+ */
111
+ adjustment: 'absolute' | 'delta_units' | 'delta_percent';
112
+ /**
113
+ * Last day of the demand period the override applies to.
114
+ */
115
+ period_ends_at: string;
116
+ /**
117
+ * First day of the demand period the override applies to.
118
+ */
119
+ period_starts_at: string;
120
+ /**
121
+ * ID of the item or product line the override targets. Omit for an `account`-wide
122
+ * override, which targets every planned item.
123
+ */
124
+ scope_ref_id: string;
125
+ /**
126
+ * What the override targets.
127
+ */
128
+ scope_type: 'item' | 'product_line' | 'account';
129
+ /**
130
+ * The adjustment, interpreted according to `adjustment`.
131
+ */
132
+ value: number;
133
+ /**
134
+ * Whether the override is applied to solves at all. Defaults to true.
135
+ */
136
+ active?: boolean;
137
+ /**
138
+ * When the override starts being applied to solves. Defaults to now.
139
+ */
140
+ effective_at?: string;
141
+ /**
142
+ * When the override stops being applied to solves. Omit for an override with no
143
+ * end.
144
+ */
145
+ expires_at?: string;
146
+ /**
147
+ * Free-form notes about the adjustment.
148
+ */
149
+ note?: string;
150
+ /**
151
+ * Why the adjustment was made.
152
+ */
153
+ reason?: 'new_customer' | 'lost_account' | 'promotion' | 'seasonal_shift' | 'new_product' | 'discontinued' | 'market_intelligence' | 'other';
154
+ /**
155
+ * ID of the unit the value is expressed in.
156
+ */
157
+ unit_id?: string;
158
+ }
159
+ /**
160
+ * An adjustment to the demand a production schedule plans against.
161
+ *
162
+ * Sales history cannot see a large customer that is about to order, a promotion,
163
+ * or a line that is being discontinued. An override is how management tells the
164
+ * planner about it. The period bounds the demand months the adjustment applies to;
165
+ * `effective_from` and `expires_at` bound when the override is consulted at all,
166
+ * which is a different question — an override for next quarter typically stops
167
+ * applying once the real orders arrive.
168
+ *
169
+ * A product-line override applies to each of the line's items; an account-wide
170
+ * override applies to every planned item, which is how a global growth assumption
171
+ * (e.g. "plan for double demand") is expressed.
172
+ */
173
+ export interface DemandOverride {
174
+ /**
175
+ * Demand override ID.
176
+ */
177
+ id: string;
178
+ /**
179
+ * How the value adjusts the forecast.
180
+ */
181
+ adjustment: 'absolute' | 'delta_units' | 'delta_percent';
182
+ /**
183
+ * Creation timestamp.
184
+ */
185
+ created_at: string;
186
+ /**
187
+ * Reference to an actor — the user, API key, agent, or group identity associated
188
+ * with an action.
189
+ */
190
+ created_by: RequestLogsAPI.Actor | null;
191
+ /**
192
+ * When the override starts being applied to solves.
193
+ */
194
+ effective_at: string;
195
+ /**
196
+ * When the override stops being applied to solves.
197
+ */
198
+ expires_at: string | null;
199
+ /**
200
+ * Free-form notes about the adjustment.
201
+ */
202
+ note: string | null;
203
+ /**
204
+ * Resource type identifier.
205
+ */
206
+ object: 'demand_override';
207
+ /**
208
+ * Last day of the demand period the override applies to.
209
+ */
210
+ period_ends_at: string;
211
+ /**
212
+ * First day of the demand period the override applies to.
213
+ */
214
+ period_starts_at: string;
215
+ /**
216
+ * Why the adjustment was made.
217
+ */
218
+ reason: 'new_customer' | 'lost_account' | 'promotion' | 'seasonal_shift' | 'new_product' | 'discontinued' | 'market_intelligence' | 'other' | null;
219
+ /**
220
+ * Entity is a polymorphic reference to any resource in the system.
221
+ */
222
+ scope: CoreAPI.Entity | null;
223
+ /**
224
+ * What kind of resource the override targets. Mirrors `scope.type`, which is only
225
+ * present when the scope is expanded.
226
+ */
227
+ scope_type: 'item' | 'product_line' | 'account';
228
+ /**
229
+ * Whether the override is applied to solves at all.
230
+ */
231
+ status: 'active' | 'inactive';
232
+ /**
233
+ * Unit of measurement used for conversions and product quantities.
234
+ */
235
+ unit: UnitsAPI.Unit | null;
236
+ /**
237
+ * Last updated timestamp.
238
+ */
239
+ updated_at: string;
240
+ /**
241
+ * The adjustment, interpreted according to `adjustment`.
242
+ */
243
+ value: number;
244
+ }
245
+ /**
246
+ * List represents a paginated list of resources.
247
+ */
248
+ export interface ListDemandOverride {
249
+ /**
250
+ * Resources in this page.
251
+ */
252
+ data: Array<DemandOverride>;
253
+ /**
254
+ * Resource type identifier.
255
+ */
256
+ object: 'list';
257
+ /**
258
+ * PageInfo contains URL-based pagination metadata.
259
+ */
260
+ page_info: APIKeysAPI.PageInfo;
261
+ }
262
+ /**
263
+ * Request to update a demand override.
264
+ */
265
+ export interface UpdateDemandOverrideRequest {
266
+ /**
267
+ * Whether the override is applied to solves at all.
268
+ */
269
+ active?: boolean;
270
+ /**
271
+ * How the value adjusts the forecast.
272
+ */
273
+ adjustment?: 'absolute' | 'delta_units' | 'delta_percent';
274
+ /**
275
+ * When the override stops being applied to solves. Clear it to make the override
276
+ * permanent.
277
+ */
278
+ expires_at?: string | null;
279
+ /**
280
+ * Free-form notes about the adjustment.
281
+ */
282
+ note?: string | null;
283
+ /**
284
+ * Last day of the demand period the override applies to.
285
+ */
286
+ period_ends_at?: string;
287
+ /**
288
+ * First day of the demand period the override applies to.
289
+ */
290
+ period_starts_at?: string;
291
+ /**
292
+ * Why the adjustment was made.
293
+ */
294
+ reason?: 'new_customer' | 'lost_account' | 'promotion' | 'seasonal_shift' | 'new_product' | 'discontinued' | 'market_intelligence' | 'other' | null;
295
+ /**
296
+ * ID of the unit the value is expressed in.
297
+ */
298
+ unit_id?: string | null;
299
+ /**
300
+ * The adjustment, interpreted according to `adjustment`.
301
+ */
302
+ value?: number;
303
+ }
304
+ export interface DemandOverrideDeleteResponse {
305
+ }
306
+ export interface DemandOverrideListParams {
307
+ /**
308
+ * Only return overrides making these kinds of adjustment.
309
+ */
310
+ adjustments?: Array<'absolute' | 'delta_units' | 'delta_percent'>;
311
+ /**
312
+ * Opaque cursor token identifying where the page of results starts.
313
+ *
314
+ * Use the `cursor` value embedded in a previous response's `next_page_url` or
315
+ * `previous_page_url` to fetch the adjacent page. Omit to start from the first
316
+ * page.
317
+ */
318
+ cursor?: string;
319
+ /**
320
+ * Sub-objects to expand in the response. When omitted, sub-objects are returned as
321
+ * `null`.
322
+ */
323
+ include?: Array<'scope'>;
324
+ /**
325
+ * Maximum number of results to return in a single page.
326
+ */
327
+ limit?: number;
328
+ /**
329
+ * Only return overrides whose period starts on or before this timestamp, formatted
330
+ * as RFC3339.
331
+ */
332
+ period_end?: string;
333
+ /**
334
+ * Only return overrides whose period ends on or after this timestamp, formatted as
335
+ * RFC3339.
336
+ */
337
+ period_start?: string;
338
+ /**
339
+ * Free-text search term used to filter results.
340
+ *
341
+ * Which fields are matched against the term varies by endpoint.
342
+ */
343
+ q?: string;
344
+ /**
345
+ * Only return overrides targeting these items or product lines.
346
+ */
347
+ scope_ref_ids?: Array<string>;
348
+ /**
349
+ * Only return overrides targeting these kinds of resource.
350
+ */
351
+ scope_types?: Array<'item' | 'product_line' | 'account'>;
352
+ /**
353
+ * Only return overrides in these activation states.
354
+ */
355
+ statuses?: Array<'active' | 'inactive'>;
356
+ }
357
+ export interface DemandOverrideRetrieveParams {
358
+ /**
359
+ * Sub-objects to expand in the response. When omitted, sub-objects are returned as
360
+ * `null`.
361
+ */
362
+ include?: Array<'scope'>;
363
+ }
364
+ export interface DemandOverrideCreateParams {
365
+ /**
366
+ * Body param: How the value adjusts the forecast.
367
+ */
368
+ adjustment: 'absolute' | 'delta_units' | 'delta_percent';
369
+ /**
370
+ * Body param: Last day of the demand period the override applies to.
371
+ */
372
+ period_ends_at: string;
373
+ /**
374
+ * Body param: First day of the demand period the override applies to.
375
+ */
376
+ period_starts_at: string;
377
+ /**
378
+ * Body param: ID of the item or product line the override targets. Omit for an
379
+ * `account`-wide override, which targets every planned item.
380
+ */
381
+ scope_ref_id: string;
382
+ /**
383
+ * Body param: What the override targets.
384
+ */
385
+ scope_type: 'item' | 'product_line' | 'account';
386
+ /**
387
+ * Body param: The adjustment, interpreted according to `adjustment`.
388
+ */
389
+ value: number;
390
+ /**
391
+ * Query param: Sub-objects to expand in the response. When omitted, sub-objects
392
+ * are returned as `null`.
393
+ */
394
+ include?: Array<'scope'>;
395
+ /**
396
+ * Body param: Whether the override is applied to solves at all. Defaults to true.
397
+ */
398
+ active?: boolean;
399
+ /**
400
+ * Body param: When the override starts being applied to solves. Defaults to now.
401
+ */
402
+ effective_at?: string;
403
+ /**
404
+ * Body param: When the override stops being applied to solves. Omit for an
405
+ * override with no end.
406
+ */
407
+ expires_at?: string;
408
+ /**
409
+ * Body param: Free-form notes about the adjustment.
410
+ */
411
+ note?: string;
412
+ /**
413
+ * Body param: Why the adjustment was made.
414
+ */
415
+ reason?: 'new_customer' | 'lost_account' | 'promotion' | 'seasonal_shift' | 'new_product' | 'discontinued' | 'market_intelligence' | 'other';
416
+ /**
417
+ * Body param: ID of the unit the value is expressed in.
418
+ */
419
+ unit_id?: string;
420
+ }
421
+ export interface DemandOverrideUpdateParams {
422
+ /**
423
+ * Query param: Sub-objects to expand in the response. When omitted, sub-objects
424
+ * are returned as `null`.
425
+ */
426
+ include?: Array<'scope'>;
427
+ /**
428
+ * Body param: Whether the override is applied to solves at all.
429
+ */
430
+ active?: boolean;
431
+ /**
432
+ * Body param: How the value adjusts the forecast.
433
+ */
434
+ adjustment?: 'absolute' | 'delta_units' | 'delta_percent';
435
+ /**
436
+ * Body param: When the override stops being applied to solves. Clear it to make
437
+ * the override permanent.
438
+ */
439
+ expires_at?: string | null;
440
+ /**
441
+ * Body param: Free-form notes about the adjustment.
442
+ */
443
+ note?: string | null;
444
+ /**
445
+ * Body param: Last day of the demand period the override applies to.
446
+ */
447
+ period_ends_at?: string;
448
+ /**
449
+ * Body param: First day of the demand period the override applies to.
450
+ */
451
+ period_starts_at?: string;
452
+ /**
453
+ * Body param: Why the adjustment was made.
454
+ */
455
+ reason?: 'new_customer' | 'lost_account' | 'promotion' | 'seasonal_shift' | 'new_product' | 'discontinued' | 'market_intelligence' | 'other' | null;
456
+ /**
457
+ * Body param: ID of the unit the value is expressed in.
458
+ */
459
+ unit_id?: string | null;
460
+ /**
461
+ * Body param: The adjustment, interpreted according to `adjustment`.
462
+ */
463
+ value?: number;
464
+ }
465
+ export declare namespace DemandOverrides {
466
+ export { type CreateDemandOverrideRequest as CreateDemandOverrideRequest, type DemandOverride as DemandOverride, type ListDemandOverride as ListDemandOverride, type UpdateDemandOverrideRequest as UpdateDemandOverrideRequest, type DemandOverrideDeleteResponse as DemandOverrideDeleteResponse, type DemandOverrideListParams as DemandOverrideListParams, type DemandOverrideRetrieveParams as DemandOverrideRetrieveParams, type DemandOverrideCreateParams as DemandOverrideCreateParams, type DemandOverrideUpdateParams as DemandOverrideUpdateParams, };
467
+ }
468
+ //# sourceMappingURL=demand-overrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demand-overrides.d.ts","sourceRoot":"","sources":["../../src/resources/operations/demand-overrides.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,KAAK,OAAO;OACZ,KAAK,cAAc;OACnB,KAAK,UAAU;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAA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ated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DemandOverrides = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
+ /**
8
+ * Adjust the demand a production schedule plans against. Overrides are how management accounts for demand that sales history cannot see.
9
+ */
10
+ class DemandOverrides extends resource_1.APIResource {
11
+ /**
12
+ * Returns a paginated list of demand overrides, most recently created first.
13
+ *
14
+ * The period filters match on overlap rather than containment, so an override
15
+ * spanning a quarter is returned when querying a single month inside it.
16
+ *
17
+ * This endpoint requires the permission: `demand_overrides:read`.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const listDemandOverride =
22
+ * await client.operations.demandOverrides.list();
23
+ * ```
24
+ */
25
+ list(query = {}, options) {
26
+ return this._client.get('/v1/operations/demand-overrides', { query, ...options });
27
+ }
28
+ /**
29
+ * Retrieves a single demand override by ID.
30
+ *
31
+ * This endpoint requires the permission: `demand_overrides:read`.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const demandOverride =
36
+ * await client.operations.demandOverrides.retrieve(
37
+ * 'deov_0192b7d38c4f5a9b02d3e16f88',
38
+ * );
39
+ * ```
40
+ */
41
+ retrieve(id, query = {}, options) {
42
+ return this._client.get((0, path_1.path) `/v1/operations/demand-overrides/${id}`, { query, ...options });
43
+ }
44
+ /**
45
+ * Creates a demand override.
46
+ *
47
+ * The scope reference is validated against the account's items or product lines,
48
+ * so an override can never silently match nothing. An `account`-scoped override
49
+ * applies to every planned item and takes no scope reference; it must be a delta,
50
+ * not an absolute value. An `absolute` value replaces the forecast for the period,
51
+ * `delta_units` adds to it, and `delta_percent` scales it; a percent override
52
+ * cannot reduce demand by more than 100%.
53
+ *
54
+ * This endpoint requires the permission: `demand_overrides:create`.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const demandOverride =
59
+ * await client.operations.demandOverrides.create({
60
+ * adjustment: 'delta_units',
61
+ * period_ends_at: '2026-05-10T00:23:00Z',
62
+ * period_starts_at: '2026-05-10T00:00:00Z',
63
+ * scope_ref_id: 'it_0131e386ac683e8c29a71f6f1f',
64
+ * scope_type: 'item',
65
+ * value: 5000,
66
+ * });
67
+ * ```
68
+ */
69
+ create(params, options) {
70
+ const { include, ...body } = params;
71
+ return this._client.post('/v1/operations/demand-overrides', { query: { include }, body, ...options });
72
+ }
73
+ /**
74
+ * Updates a demand override.
75
+ *
76
+ * The type and value are validated as a pair against the resulting override, so
77
+ * switching an existing units adjustment to `delta_percent` is checked as a
78
+ * percent even when only the type is sent.
79
+ *
80
+ * This endpoint requires the permission: `demand_overrides:update`.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const demandOverride =
85
+ * await client.operations.demandOverrides.update(
86
+ * 'deov_0192b7d38c4f5a9b02d3e16f88',
87
+ * { value: 7500 },
88
+ * );
89
+ * ```
90
+ */
91
+ update(id, params = {}, options) {
92
+ const { include, ...body } = params ?? {};
93
+ return this._client.patch((0, path_1.path) `/v1/operations/demand-overrides/${id}`, {
94
+ query: { include },
95
+ body,
96
+ ...options,
97
+ });
98
+ }
99
+ /**
100
+ * Deletes a demand override.
101
+ *
102
+ * Schedules already generated are unaffected: a version snapshots the overrides it
103
+ * applied, so deleting one changes future solves only.
104
+ *
105
+ * This endpoint requires the permission: `demand_overrides:delete`.
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * const demandOverride =
110
+ * await client.operations.demandOverrides.delete(
111
+ * 'deov_0192b7d38c4f5a9b02d3e16f88',
112
+ * );
113
+ * ```
114
+ */
115
+ delete(id, options) {
116
+ return this._client.delete((0, path_1.path) `/v1/operations/demand-overrides/${id}`, options);
117
+ }
118
+ }
119
+ exports.DemandOverrides = DemandOverrides;
120
+ //# sourceMappingURL=demand-overrides.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demand-overrides.js","sourceRoot":"","sources":["../../src/resources/operations/demand-overrides.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF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