busroot-sdk 0.0.8-dev.2708365288 → 0.0.8-dev.2713878872

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.
package/build/index.d.ts CHANGED
@@ -3246,6 +3246,7 @@ declare class BusrootClient {
3246
3246
  durationFormatted: string;
3247
3247
  };
3248
3248
  isOngoing: boolean;
3249
+ note?: string | undefined;
3249
3250
  reasonBreadcrumb?: {
3250
3251
  code: string;
3251
3252
  description: string;
package/build/index.js CHANGED
@@ -645,8 +645,8 @@ var require_error_key = __commonJS({
645
645
  "use strict";
646
646
  Object.defineProperty(exports2, "__esModule", { value: true });
647
647
  exports2.STATION_REASSIGN_CROSS_GROUP = exports2.TARGET_STATION_NOT_FOUND = exports2.PARTS_PER_CYCLE_NOT_ALLOWED_FOR_STATION = exports2.SCHEDULE_CANNOT_STOP_FUTURE = exports2.SCHEDULE_NON_PROD_OR_ENDED = exports2.SCHEDULE_CANNOT_CUT_SHORT = exports2.SCHEDULE_AUTO_ENDED_BY_QUANTITY = exports2.SCHEDULE_NOT_STARTED_OR_ENDED = exports2.ACTUAL_START_IN_PAST = exports2.PLANNED_START_IN_PAST = exports2.SCHEDULE_CANNOT_CHANGE_PROD_TO_NON_PROD = exports2.SCHEDULE_CANNOT_CHANGE_NON_PROD_TO_PROD = exports2.SCHEDULE_CANNOT_SET_PRIORITY_AFTER_START = exports2.SCHEDULE_ALREADY_STARTED_CANNOT_EDIT_START = exports2.SCHEDULE_ALREADY_ENDED = exports2.UNSUPPORTED_SCHEDULE_OPERATION = exports2.INVALID_RESOLUTION_MODE = exports2.EXISTED_EVENT = exports2.INVALID_SEARCH_TEXT = exports2.INVALID_SKIP = exports2.INVALID_LIMIT = exports2.INVALID_WINDOW_TIME = exports2.INVALID_NOTIFICATION_PREFERENCE = exports2.OVERLAPPED_SHIFT = exports2.INVALID_SHIFT_NAME = exports2.INVALID_WEEK_DAY = exports2.INVALID_FILE_TYPE = exports2.INVALID_HEADER_FIELDS = exports2.DELETE_LAST_SHIFT_PATTERN = exports2.INVALID_ACTUAL_START_AT_STATE = exports2.INVALID_DOMAIN = exports2.SKU_NOT_FOUND = exports2.STATION_GROUP_NOT_FOUND = exports2.WORK_ORDER_ENDED = exports2.SCHEDULE_NOT_FOUND = exports2.INVALID_SKU = exports2.INVALID_SCHEDULE = exports2.EXPIRED_TOKEN = exports2.UNAUTHORIZED_USER = exports2.UNAUTHENTICATED_USER = exports2.SHIFT_PATTERN_NOT_FOUND = exports2.INVALID_SHIFT_PATTERN_TITLE = exports2.INVALID_SHIFT_PATTERN_ID = exports2.INVALID_DELETE_SHIFTS = exports2.UNSUPPORTED_SHIFT_OVER_MID_NIGHT = exports2.INVALID_SHIFTS = exports2.INVALID_PLANTCODE = exports2.INVALID_RANGECODE = exports2.INTERNAL_SERVER_ERROR = exports2.CACHE_NOT_COMPLETE = void 0;
648
- exports2.DATABASE_ERROR_MESSAGE = exports2.INVALID_API_KEY = exports2.UNSUPPORTED_API_KEY_OPERATION = exports2.ACCOUNT_ARCHIVED = exports2.ACCOUNT_DENIED = exports2.ACCOUNT_NOT_FOUND = exports2.ACCOUNT_MISMATCH = exports2.USER_ACCOUNT_IS_BLOCKED = exports2.ACCOUNT_NOT_SELECTED = exports2.INVALID_USER_ACCOUNT = exports2.NO_ACCOUNT_AVAILABLE = exports2.EXPIRED_USER = exports2.USER_IS_BLOCKED = exports2.INVALID_USER = exports2.USER_NOT_FOUND = exports2.MULTIPLE_ACCOUNT_ASSOCIATED = exports2.UNSUPPORTED_USER_OPERATION = exports2.EMAIL_TYPE_NOT_FOUND = exports2.INVALID_STATION_CODE = exports2.DUPLICATED_STATION_CODE = exports2.DUPLICATED_STATION_GROUP_CODE = exports2.INVALID_INPUT = exports2.DUPLICATED_SKU_CODE = exports2.INVALID_SKU_CODE = exports2.TOO_LARGE = exports2.BUSINESS_CONFLICT = exports2.FORBIDDEN = exports2.INVALID_ACCESS_CODE = exports2.EXPIRED_API_KEY = exports2.UNSUPPORTED_ARCHIVE_LAST_PLANT = exports2.PLANT_NOT_EXISTS = exports2.NOT_EMPTY_STATION_GROUP = exports2.INVALID_AGGREGATE_WINDOW = exports2.DUPLICATED_SCHEDULE = exports2.INVALID_SCHEDULE_ORDER_TYPE = exports2.INVALID_SKU_GROUP_NAME = exports2.SKU_GROUP_NOT_FOUND = exports2.INVALID_SKU_GROUP = exports2.INVALID_DOWNTIMNE_DURATION_THRESHOLD_MULTIPLIER = exports2.REASON_NOT_DOWNTIME_TYPE = exports2.MANUAL_DOWNTIME_NO_ACTIVE_SCHEDULE = exports2.MANUAL_DOWNTIME_ALREADY_ONGOING = exports2.CACHE_WARMING_DISABLED = exports2.MANUAL_DOWNTIME_DISABLED = exports2.DOWNTIME_NOT_MANUAL = exports2.DOWNTIME_NOT_FOUND = exports2.STATION_NOT_FOUND = exports2.REASON_NOT_ALLOWED_FOR_STATION = exports2.REASON_NOT_FOUND = exports2.SKU_REQUIRED = void 0;
649
- exports2.PRODUCTION_BLOCKED_BY_MANUAL_DOWNTIME = exports2.PRODUCTION_CORRECTION_NOT_ALLOWED = exports2.PRODUCTION_QUANTITY_BELOW_ZERO = exports2.INVALID_PRODUCTION_ID = exports2.RESET_EXCEED_30_DAYS = exports2.INVALID_REASON_CODE = exports2.SELF_REFERENCING_CODE = exports2.PARENT_CODE_IN_USE = exports2.DUPLICATED_REASON_CODE = void 0;
648
+ exports2.INVALID_API_KEY = exports2.UNSUPPORTED_API_KEY_OPERATION = exports2.ACCOUNT_ARCHIVED = exports2.ACCOUNT_DENIED = exports2.ACCOUNT_NOT_FOUND = exports2.ACCOUNT_MISMATCH = exports2.USER_ACCOUNT_IS_BLOCKED = exports2.ACCOUNT_NOT_SELECTED = exports2.INVALID_USER_ACCOUNT = exports2.NO_ACCOUNT_AVAILABLE = exports2.EXPIRED_USER = exports2.USER_IS_BLOCKED = exports2.INVALID_USER = exports2.USER_NOT_FOUND = exports2.MULTIPLE_ACCOUNT_ASSOCIATED = exports2.UNSUPPORTED_USER_OPERATION = exports2.EMAIL_TYPE_NOT_FOUND = exports2.INVALID_STATION_CODE = exports2.DUPLICATED_STATION_CODE = exports2.DUPLICATED_STATION_GROUP_CODE = exports2.INVALID_INPUT = exports2.DUPLICATED_SKU_CODE = exports2.INVALID_SKU_CODE = exports2.TOO_LARGE = exports2.BUSINESS_CONFLICT = exports2.FORBIDDEN = exports2.INVALID_ACCESS_CODE = exports2.EXPIRED_API_KEY = exports2.UNSUPPORTED_ARCHIVE_LAST_PLANT = exports2.PLANT_NOT_EXISTS = exports2.NOT_EMPTY_STATION_GROUP = exports2.INVALID_AGGREGATE_WINDOW = exports2.DUPLICATED_SCHEDULE = exports2.INVALID_SCHEDULE_ORDER_TYPE = exports2.INVALID_SKU_GROUP_NAME = exports2.SKU_GROUP_NOT_FOUND = exports2.INVALID_SKU_GROUP = exports2.INVALID_DOWNTIMNE_DURATION_THRESHOLD_MULTIPLIER = exports2.REASON_NOT_DOWNTIME_TYPE = exports2.MANUAL_DOWNTIME_NO_ACTIVE_SCHEDULE = exports2.MANUAL_DOWNTIME_ALREADY_ONGOING = exports2.CACHE_WARMING_DISABLED = exports2.MANUAL_DOWNTIME_DISABLED = exports2.DOWNTIME_NOT_MANUAL = exports2.DOWNTIME_NOT_FOUND = exports2.STATION_NOT_FOUND = exports2.REASON_NOTE_REQUIRED = exports2.REASON_NOT_ALLOWED_FOR_STATION = exports2.REASON_NOT_FOUND = exports2.SKU_REQUIRED = void 0;
649
+ exports2.PRODUCTION_BLOCKED_BY_MANUAL_DOWNTIME = exports2.PRODUCTION_CORRECTION_NOT_ALLOWED = exports2.PRODUCTION_QUANTITY_BELOW_ZERO = exports2.INVALID_PRODUCTION_ID = exports2.RESET_EXCEED_30_DAYS = exports2.INVALID_REASON_CODE = exports2.SELF_REFERENCING_CODE = exports2.PARENT_CODE_IN_USE = exports2.DUPLICATED_REASON_CODE = exports2.DATABASE_ERROR_MESSAGE = void 0;
650
650
  exports2.CACHE_NOT_COMPLETE = "cacheNotComplete";
651
651
  exports2.INTERNAL_SERVER_ERROR = "internalServerError";
652
652
  exports2.INVALID_RANGECODE = "invalidRangeCode";
@@ -700,6 +700,7 @@ var require_error_key = __commonJS({
700
700
  exports2.SKU_REQUIRED = "skuRequired";
701
701
  exports2.REASON_NOT_FOUND = "reasonNotFound";
702
702
  exports2.REASON_NOT_ALLOWED_FOR_STATION = "reasonNotAllowedForStation";
703
+ exports2.REASON_NOTE_REQUIRED = "reasonNoteRequired";
703
704
  exports2.STATION_NOT_FOUND = "stationNotFound";
704
705
  exports2.DOWNTIME_NOT_FOUND = "downtimeNotFound";
705
706
  exports2.DOWNTIME_NOT_MANUAL = "downtimeNotManual";
@@ -1833,15 +1834,18 @@ var require_base_reason = __commonJS({
1833
1834
  require_extend();
1834
1835
  var enums_1 = require_enums();
1835
1836
  exports2.ReasonCodeSchema = zod_1.z.string().trim().min(1).max(50).refine((value) => value === value.toLowerCase()).describe("Unique reason code used to reference this reason (e.g., 'MAINTENANCE', 'BREAKDOWN', 'PLANNED-PM'). Must be unique within the account.");
1837
+ var REQUIRE_NOTES_DESCRIPTION = "Require Notes: When enabled, operators must enter notes before the reason can be confirmed. Only applies when the reason is assigned to a downtime.";
1836
1838
  exports2.BaseReasonSchema = zod_1.z.object({
1837
1839
  code: exports2.ReasonCodeSchema,
1838
1840
  description: zod_1.z.string().describe("Human-readable description of this reason (e.g., 'Planned maintenance', 'Equipment breakdown', 'Material shortage')"),
1839
- type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)).min(1).describe("Array of reason types this code applies to. Options: 'downtime' (for unplanned stoppages), 'non-production' (for planned activities), 'quality' (for bad/rejected production). A reason can have multiple types. Example: ['downtime'], ['non-production'], ['downtime', 'non-production']")
1841
+ type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)).min(1).describe("Array of reason types this code applies to. Options: 'downtime' (for unplanned stoppages), 'non-production' (for planned activities), 'quality' (for bad/rejected production). A reason can have multiple types. Example: ['downtime'], ['non-production'], ['downtime', 'non-production']"),
1842
+ requireNotes: zod_1.z.boolean().optional().describe(REQUIRE_NOTES_DESCRIPTION)
1840
1843
  }).strict();
1841
1844
  exports2.ManifestReasonSchema = zod_1.z.object({
1842
1845
  code: zod_1.z.string().describe("Unique reason code used to reference this reason (e.g., 'MAINTENANCE', 'BREAKDOWN', 'PLANNED-PM'). Must be unique within the account."),
1843
1846
  description: zod_1.z.string().describe("Human-readable description of this reason (e.g., 'Planned maintenance', 'Equipment breakdown', 'Material shortage')"),
1844
1847
  type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)).min(1).describe("Array of reason types this code applies to. Options: 'downtime' (for unplanned stoppages), 'non-production' (for planned activities), 'quality' (for bad/rejected production). A reason can have multiple types. Example: ['downtime'], ['non-production'], ['downtime', 'non-production']"),
1848
+ requireNotes: zod_1.z.boolean().optional().describe(REQUIRE_NOTES_DESCRIPTION),
1845
1849
  reasons: zod_1.z.lazy(() => zod_1.z.array(exports2.ManifestReasonSchema)).optional().describe("Optional array of child reasons that are subcategories of this reason. Used to create hierarchical reason structures (e.g., 'Maintenance' \u2192 'Preventive Maintenance' \u2192 'PM Check').")
1846
1850
  }).strict().openapi({ ref: "ManifestReason" });
1847
1851
  }
@@ -1961,6 +1965,9 @@ var require_downtime = __commonJS({
1961
1965
  estimateEndAt: zod_1.z.string().optional(),
1962
1966
  notifiedAt: zod_1.z.string().optional(),
1963
1967
  causeCode: zod_1.z.string().optional(),
1968
+ // Free-text detail captured when the reason was assigned. Mandatory for reasons flagged
1969
+ // `requireNotes`; null on every event that predates the feature or does not require one.
1970
+ note: zod_1.z.string().optional(),
1964
1971
  accountId: zod_1.z.string(),
1965
1972
  createdAt: zod_1.z.string(),
1966
1973
  updatedAt: zod_1.z.string(),
@@ -6115,17 +6122,20 @@ var require_issue = __commonJS({
6115
6122
  "../../packages/common/build/api-schemas/issue.js"(exports2) {
6116
6123
  "use strict";
6117
6124
  Object.defineProperty(exports2, "__esModule", { value: true });
6118
- exports2.IssueEventPostRequestRefinement = exports2.IssueEventPostRequest = exports2.IssueEventQueryRequest = exports2.ManualDowntimeEndByStationRequest = exports2.IssuePostRequest = exports2.IssueIdGetRequest = void 0;
6125
+ exports2.IssueEventPostRequestRefinement = exports2.IssueEventPostRequest = exports2.IssueEventQueryRequest = exports2.ManualDowntimeEndByStationRequest = exports2.IssuePostRequest = exports2.IssueIdGetRequest = exports2.DOWNTIME_NOTE_MAX_LENGTH = void 0;
6119
6126
  var zod_1 = require("zod");
6120
6127
  var enums_1 = require_enums();
6121
6128
  var schemas_1 = require_schemas();
6122
6129
  var IssueIdSchema = zod_1.z.coerce.number().int().gte(0);
6130
+ exports2.DOWNTIME_NOTE_MAX_LENGTH = 250;
6131
+ var DowntimeNoteSchema = zod_1.z.string().trim().max(exports2.DOWNTIME_NOTE_MAX_LENGTH).optional().describe(`Free-text note describing the downtime. Mandatory when the assigned reason has 'requireNotes' enabled, otherwise optional. Maximum ${exports2.DOWNTIME_NOTE_MAX_LENGTH} characters.`);
6123
6132
  exports2.IssueIdGetRequest = zod_1.z.object({
6124
6133
  id: IssueIdSchema
6125
6134
  });
6126
6135
  exports2.IssuePostRequest = zod_1.z.object({
6127
6136
  stationCode: schemas_1.StationCodeSchema,
6128
- reasonCode: zod_1.z.string().trim().min(1).describe("Reason code for the manual downtime. Must be a reason whose type includes 'downtime'.")
6137
+ reasonCode: zod_1.z.string().trim().min(1).describe("Reason code for the manual downtime. Must be a reason whose type includes 'downtime'."),
6138
+ note: DowntimeNoteSchema
6129
6139
  });
6130
6140
  exports2.ManualDowntimeEndByStationRequest = zod_1.z.object({
6131
6141
  stationCode: schemas_1.StationCodeSchema
@@ -6137,6 +6147,7 @@ var require_issue = __commonJS({
6137
6147
  type: zod_1.z.nativeEnum(enums_1.DowntimeEventType),
6138
6148
  estimatedTime: zod_1.z.number().nonnegative().optional(),
6139
6149
  causeCode: zod_1.z.string().trim().min(1).optional(),
6150
+ note: DowntimeNoteSchema,
6140
6151
  operator: zod_1.z.string().optional()
6141
6152
  });
6142
6153
  exports2.IssueEventPostRequestRefinement = exports2.IssueEventPostRequest.refine((data) => data.type !== enums_1.DowntimeEventType.Estimate || data.estimatedTime !== void 0, {
@@ -6146,7 +6157,10 @@ var require_issue = __commonJS({
6146
6157
  }).transform((value) => ({
6147
6158
  ...value,
6148
6159
  estimatedTime: value.type === enums_1.DowntimeEventType.Estimate ? value.estimatedTime : void 0,
6149
- causeCode: value.type === enums_1.DowntimeEventType.Cause ? value.causeCode : void 0
6160
+ causeCode: value.type === enums_1.DowntimeEventType.Cause ? value.causeCode : void 0,
6161
+ // A note only means anything alongside a reason — drop it on every other event type,
6162
+ // mirroring how causeCode is scoped.
6163
+ note: value.type === enums_1.DowntimeEventType.Cause ? value.note || void 0 : void 0
6150
6164
  }));
6151
6165
  }
6152
6166
  });
@@ -6301,9 +6315,13 @@ var require_note2 = __commonJS({
6301
6315
  return mod && mod.__esModule ? mod : { "default": mod };
6302
6316
  };
6303
6317
  Object.defineProperty(exports2, "__esModule", { value: true });
6304
- exports2.DeleteNoteRequest = exports2.NotePostRequest = void 0;
6318
+ exports2.DeleteNoteRequest = exports2.NotePostRequest = exports2.NoteGetRequest = void 0;
6305
6319
  var zod_1 = __importDefault(require("zod"));
6306
6320
  var schemas_1 = require_schemas();
6321
+ var common_1 = require_common();
6322
+ exports2.NoteGetRequest = zod_1.default.object({
6323
+ excludehidden: common_1.BooleanTypeSchema.describe("Excludes notes hidden from the Cockpit / Station Notes page.")
6324
+ });
6307
6325
  exports2.NotePostRequest = schemas_1.NoteSchema.omit({ accountId: true, updatedAt: true }).partial({ id: true, createdAt: true });
6308
6326
  exports2.DeleteNoteRequest = zod_1.default.object({
6309
6327
  id: zod_1.default.number({ coerce: true })
@@ -6382,7 +6400,7 @@ var require_api_schemas = __commonJS({
6382
6400
  "use strict";
6383
6401
  Object.defineProperty(exports2, "__esModule", { value: true });
6384
6402
  exports2.ScheduleEditPartsPerCycleOverridePostBodyRequest = exports2.ScheduleEditPartsPerCycleOverridePostParamRequest = exports2.ScheduleFutureGetParamRequest = exports2.ScheduleCutShortPostRequest = exports2.ScheduleDeleteRequest = exports2.SchedulePostRequestTransform = exports2.SchedulePostRequestSuperRefine = exports2.SchedulePostRequest = exports2.ScheduleWorkderGetRequest = exports2.ScheduleGetRequest = exports2.ReasonDeleteRequest = exports2.ReasonPostRequest = exports2.ReasonGetRequest = exports2.ReasonBreadcrumb = exports2.NotificationRefferencesRequest = exports2.StationGroupDeleteRquest = exports2.StationGroupGetRquest = exports2.StationGroupPostRequest = exports2.StationGroupCodeSchema = exports2.StationOperatorPostRequest = exports2.StationTargetGetRequest = exports2.StationWindowGetRequest = exports2.StationLogGetRequest = exports2.AdminStationPutBodyRequest = exports2.StationGetRequest = exports2.StationPostRequest = exports2.StationPostRequestTransform = exports2.StationPostRequestSuperRefine = exports2.StationDeleteRequest = exports2.AccountArchivePostRequest = exports2.AccountSettingPostRequest = exports2.SelectAccountPostRequest = exports2.NewAccountPostRequest = exports2.ArchivePlantPostRequest = exports2.PlantPostRequest = exports2.UserGetRequest = exports2.UserPostRequest = exports2.SkuCycleTimeAnalysisGetRequest = exports2.SkuDeleteRequest = exports2.SkuPostBulkRequest = exports2.SkuPostRequestTransform = exports2.SkuPostRequestSuperRefine = exports2.SkuPostRequest = exports2.BooleanTypeSchema = exports2.SortByStandardParam = exports2.BusrootPagingResponse = exports2.StandardRequestSuperRefine = exports2.StandardRequestParams = exports2.RangeCodeSchema = exports2.UNKNOWN_CODE = void 0;
6385
- exports2.BufferedDauMessageSchema = exports2.DauMessagesGetParams = exports2.AgentRequest = exports2.AgentMessage = exports2.TaskDeleteRequest = exports2.TaskPostRequest = exports2.NotePostRequest = exports2.DeleteNoteRequest = exports2.DeleteKeyDeleteRequest = exports2.FilterGetRequest = exports2.AccessCodeGetRequest = exports2.DebugMockClearPostRequest = exports2.DebugResetCursorPostRequest = exports2.DebugEmailDowntimeSummaryGetRequest = exports2.EmailTestHarnessPostRequestRefinement = exports2.EmailTestHarnessPostRequest = exports2.LoginPostRequest = exports2.CallBackGetRequest = exports2.DevicePostRequest = exports2.DeviceDeleteRequest = exports2.DashboardGetRquest = exports2.ManualDowntimeEndByStationRequest = exports2.IssueEventPostRequestRefinement = exports2.IssueEventPostRequest = exports2.IssueEventQueryRequest = exports2.IssuePostRequest = exports2.IssueIdGetRequest = exports2.ProductionAggregateWindowGetRequest = exports2.ProductionManualPostRequest = exports2.ShiftPatternDeleteRequest = exports2.ShiftPostRequest = exports2.ScheduleLogGetRequest = void 0;
6403
+ exports2.BufferedDauMessageSchema = exports2.DauMessagesGetParams = exports2.AgentRequest = exports2.AgentMessage = exports2.TaskDeleteRequest = exports2.TaskPostRequest = exports2.NotePostRequest = exports2.NoteGetRequest = exports2.DeleteNoteRequest = exports2.DeleteKeyDeleteRequest = exports2.FilterGetRequest = exports2.AccessCodeGetRequest = exports2.DebugMockClearPostRequest = exports2.DebugResetCursorPostRequest = exports2.DebugEmailDowntimeSummaryGetRequest = exports2.EmailTestHarnessPostRequestRefinement = exports2.EmailTestHarnessPostRequest = exports2.LoginPostRequest = exports2.CallBackGetRequest = exports2.DevicePostRequest = exports2.DeviceDeleteRequest = exports2.DashboardGetRquest = exports2.ManualDowntimeEndByStationRequest = exports2.IssueEventPostRequestRefinement = exports2.IssueEventPostRequest = exports2.IssueEventQueryRequest = exports2.IssuePostRequest = exports2.IssueIdGetRequest = exports2.DOWNTIME_NOTE_MAX_LENGTH = exports2.ProductionAggregateWindowGetRequest = exports2.ProductionManualPostRequest = exports2.ShiftPatternDeleteRequest = exports2.ShiftPostRequest = exports2.ScheduleLogGetRequest = void 0;
6386
6404
  var common_1 = require_common();
6387
6405
  Object.defineProperty(exports2, "UNKNOWN_CODE", { enumerable: true, get: function() {
6388
6406
  return common_1.UNKNOWN_CODE;
@@ -6560,6 +6578,9 @@ var require_api_schemas = __commonJS({
6560
6578
  return production_1.ProductionAggregateWindowGetRequest;
6561
6579
  } });
6562
6580
  var issue_1 = require_issue();
6581
+ Object.defineProperty(exports2, "DOWNTIME_NOTE_MAX_LENGTH", { enumerable: true, get: function() {
6582
+ return issue_1.DOWNTIME_NOTE_MAX_LENGTH;
6583
+ } });
6563
6584
  Object.defineProperty(exports2, "IssueIdGetRequest", { enumerable: true, get: function() {
6564
6585
  return issue_1.IssueIdGetRequest;
6565
6586
  } });
@@ -6626,6 +6647,9 @@ var require_api_schemas = __commonJS({
6626
6647
  Object.defineProperty(exports2, "DeleteNoteRequest", { enumerable: true, get: function() {
6627
6648
  return note_1.DeleteNoteRequest;
6628
6649
  } });
6650
+ Object.defineProperty(exports2, "NoteGetRequest", { enumerable: true, get: function() {
6651
+ return note_1.NoteGetRequest;
6652
+ } });
6629
6653
  Object.defineProperty(exports2, "NotePostRequest", { enumerable: true, get: function() {
6630
6654
  return note_1.NotePostRequest;
6631
6655
  } });
@@ -6666,14 +6690,16 @@ var require_reason3 = __commonJS({
6666
6690
  code: zod_1.z.string(),
6667
6691
  description: zod_1.z.string(),
6668
6692
  parentReasonCode: zod_1.z.string().nullish(),
6669
- type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE))
6693
+ type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)),
6694
+ requireNotes: zod_1.z.boolean().optional()
6670
6695
  });
6671
6696
  function toReasonViewModel(schemas) {
6672
6697
  return schemas.map((s) => ({
6673
6698
  code: s.code,
6674
6699
  description: s.description,
6675
6700
  type: s.type,
6676
- parentReasonCode: s.parentReasonCode
6701
+ parentReasonCode: s.parentReasonCode,
6702
+ requireNotes: s.requireNotes
6677
6703
  }));
6678
6704
  }
6679
6705
  }
@@ -7185,6 +7211,9 @@ var require_downtime2 = __commonJS({
7185
7211
  workOrderReference: zod_1.z.string().optional(),
7186
7212
  reasonCode: zod_1.z.string().optional(),
7187
7213
  reasonBreadcrumb: api_schemas_1.ReasonBreadcrumb.optional(),
7214
+ // Reconstructed from station_window, which carries no note — filled in separately from the
7215
+ // reason's downtime_event row (see DowntimeService.attachDowntimeNotes).
7216
+ note: zod_1.z.string().optional(),
7188
7217
  range: time_1.TimeRange,
7189
7218
  lostProductionCost: zod_1.z.number().optional(),
7190
7219
  lostProductionQuantity: zod_1.z.number().optional(),
@@ -7195,6 +7224,7 @@ var require_downtime2 = __commonJS({
7195
7224
  exports2.DowntimeViewModel = schemas_1.DowntimeSchema.merge(zod_1.z.object({
7196
7225
  hasCause: zod_1.z.boolean(),
7197
7226
  reasonCode: zod_1.z.string().optional(),
7227
+ note: zod_1.z.string().optional(),
7198
7228
  ragStatus: zod_1.z.nativeEnum(enums_1.RagStatus),
7199
7229
  stationName: zod_1.z.string().optional(),
7200
7230
  reasonBreadcrumb: zod_1.z.array(reason_1.ReasonViewModel),
@@ -7224,6 +7254,7 @@ var require_downtime2 = __commonJS({
7224
7254
  result.events.sort((a, b) => (0, moment_timezone_1.default)(b.createdAt).valueOf() - (0, moment_timezone_1.default)(a.createdAt).valueOf());
7225
7255
  const cause = result.events.find((event) => event.type === enums_1.DowntimeEventType.Cause);
7226
7256
  const causeCode = cause ? cause.causeCode : void 0;
7257
+ const note = cause?.note || void 0;
7227
7258
  const hasCause = cause !== void 0;
7228
7259
  const startAtTimestamp = (0, moment_timezone_1.default)(result.startAt).valueOf();
7229
7260
  const endAtTimestamp = (0, moment_timezone_1.default)(result.endAt).valueOf();
@@ -7247,6 +7278,7 @@ var require_downtime2 = __commonJS({
7247
7278
  hasCause,
7248
7279
  ragStatus: getRagStatus(result),
7249
7280
  reasonCode: causeCode,
7281
+ note,
7250
7282
  accountId: result.accountId,
7251
7283
  reasonBreadcrumb: [],
7252
7284
  startAtTimestamp,
@@ -7468,7 +7500,8 @@ var require_reason4 = __commonJS({
7468
7500
  code: reason.code,
7469
7501
  description: reason.description,
7470
7502
  type: reason.type,
7471
- parentReasonCode: parentReasonCode ?? null
7503
+ parentReasonCode: parentReasonCode ?? null,
7504
+ requireNotes: reason.requireNotes
7472
7505
  });
7473
7506
  if (reason.reasons?.length) {
7474
7507
  result.push(...flattenReasons(reason.reasons, reason.code));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busroot-sdk",
3
- "version": "0.0.8-dev.2708365288",
3
+ "version": "0.0.8-dev.2713878872",
4
4
  "description": "An SDK for accessing Busroot from output.industries",
5
5
  "homepage": "https://www.output.industries",
6
6
  "main": "./build/index.js",