busroot-sdk 0.0.8-dev.2836398557 → 0.0.8-dev.2839966438

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 (2) hide show
  1. package/build/index.js +26 -8
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -280,14 +280,14 @@ var require_registry = __commonJS({
280
280
  enableProductionCorrection: {
281
281
  key: "enableProductionCorrection",
282
282
  label: "Allow Production Correction",
283
- description: "Allow operators to enter negative values to correct previous production counting errors.",
283
+ description: "Allow operators to correct production counting errors during a running schedule from the tablet.",
284
284
  allowedLevels: ["account", "plant", "stationGroup", "station"],
285
285
  oiManaged: false
286
286
  },
287
287
  enableHistoricalCorrection: {
288
288
  key: "enableHistoricalCorrection",
289
289
  label: "Allow Historical Production Correction",
290
- description: "Allow admins to correct the production count of a schedule that has already ended, from the schedule list and the Gantt. Independent of `enableProductionCorrection`, which gates the tablet's in-schedule corrections.",
290
+ description: "Correct production counts on schedules that have already ended. Available to admins from the action menu on the schedule list and Gantt chart. This is separate from the tablet's live correction feature.",
291
291
  allowedLevels: ["account"],
292
292
  oiManaged: false
293
293
  },
@@ -894,7 +894,7 @@ var require_error_key = __commonJS({
894
894
  Object.defineProperty(exports2, "__esModule", { value: true });
895
895
  exports2.TARGET_STATION_NOT_FOUND = exports2.INVALID_PARTS_PER_CYCLE = 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;
896
896
  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.TASK_LIST_NOT_FOUND = exports2.REASON_NOTE_REQUIRED = exports2.REASON_NOT_ALLOWED_FOR_STATION = exports2.REASON_NOT_FOUND = exports2.SKU_REQUIRED = exports2.STATION_REASSIGN_CROSS_GROUP = void 0;
897
- exports2.TOO_MANY_ACCESS_CODE_ATTEMPTS = exports2.TOO_MANY_REQUESTS = exports2.HISTORICAL_CORRECTION_CURSOR_RESET_FAILED = exports2.HISTORICAL_CORRECTION_WINDOW_EXPIRED = exports2.SCHEDULE_NOT_CORRECTABLE = exports2.HISTORICAL_CORRECTION_NOT_ALLOWED = exports2.PRODUCTION_EXCEEDS_MAX_COUNT = 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 = exports2.INVALID_API_KEY = exports2.UNSUPPORTED_API_KEY_OPERATION = void 0;
897
+ exports2.TOO_MANY_ACCESS_CODE_ATTEMPTS = exports2.TOO_MANY_REQUESTS = exports2.HISTORICAL_CORRECTION_LIMIT_REACHED = exports2.HISTORICAL_CORRECTION_CURSOR_RESET_FAILED = exports2.HISTORICAL_CORRECTION_WINDOW_EXPIRED = exports2.SCHEDULE_NOT_CORRECTABLE = exports2.HISTORICAL_CORRECTION_NOT_ALLOWED = exports2.PRODUCTION_EXCEEDS_MAX_COUNT = 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 = exports2.INVALID_API_KEY = exports2.UNSUPPORTED_API_KEY_OPERATION = void 0;
898
898
  exports2.CACHE_NOT_COMPLETE = "cacheNotComplete";
899
899
  exports2.INTERNAL_SERVER_ERROR = "internalServerError";
900
900
  exports2.INVALID_RANGECODE = "invalidRangeCode";
@@ -1016,6 +1016,7 @@ var require_error_key = __commonJS({
1016
1016
  exports2.SCHEDULE_NOT_CORRECTABLE = "scheduleNotCorrectable";
1017
1017
  exports2.HISTORICAL_CORRECTION_WINDOW_EXPIRED = "historicalCorrectionWindowExpired";
1018
1018
  exports2.HISTORICAL_CORRECTION_CURSOR_RESET_FAILED = "historicalCorrectionCursorResetFailed";
1019
+ exports2.HISTORICAL_CORRECTION_LIMIT_REACHED = "historicalCorrectionLimitReached";
1019
1020
  exports2.TOO_MANY_REQUESTS = "tooManyRequests";
1020
1021
  exports2.TOO_MANY_ACCESS_CODE_ATTEMPTS = "tooManyAccessCodeAttempts";
1021
1022
  }
@@ -6378,7 +6379,7 @@ var require_production2 = __commonJS({
6378
6379
  "../../packages/common/build/api-schemas/production.js"(exports2) {
6379
6380
  "use strict";
6380
6381
  Object.defineProperty(exports2, "__esModule", { value: true });
6381
- exports2.ProductionAggregateWindowGetRequest = exports2.ProductionHistoricalCorrectionPostRequest = exports2.MAX_HISTORICAL_CORRECTION_QUANTITY = exports2.ProductionManualPostRequest = void 0;
6382
+ exports2.ProductionAggregateWindowGetRequest = exports2.ProductionHistoricalCorrectionPostRequest = exports2.HISTORICAL_CORRECTION_WINDOW_MONTHS = exports2.MAX_HISTORICAL_CORRECTION_QUANTITY = exports2.ProductionManualPostRequest = void 0;
6382
6383
  var zod_1 = require("zod");
6383
6384
  var schemas_1 = require_schemas();
6384
6385
  var ProductionSchema = zod_1.z.object({
@@ -6399,6 +6400,7 @@ var require_production2 = __commonJS({
6399
6400
  });
6400
6401
  exports2.ProductionManualPostRequest = ProductionSchema.omit({ id: true });
6401
6402
  exports2.MAX_HISTORICAL_CORRECTION_QUANTITY = 1e6;
6403
+ exports2.HISTORICAL_CORRECTION_WINDOW_MONTHS = 1;
6402
6404
  exports2.ProductionHistoricalCorrectionPostRequest = zod_1.z.object({
6403
6405
  scheduleId: schemas_1.ScheduleIdSchema,
6404
6406
  operation: zod_1.z.enum(["add", "subtract"]),
@@ -6733,7 +6735,7 @@ var require_api_schemas = __commonJS({
6733
6735
  "use strict";
6734
6736
  Object.defineProperty(exports2, "__esModule", { value: true });
6735
6737
  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;
6736
- exports2.BufferedDauMessageSchema = exports2.DauMessagesGetParams = exports2.AgentRequest = exports2.AgentMessage = exports2.TaskListDeleteRequest = exports2.TaskListPostRequest = 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.MAX_HISTORICAL_CORRECTION_QUANTITY = exports2.ProductionAggregateWindowGetRequest = exports2.ProductionHistoricalCorrectionPostRequest = exports2.ProductionManualPostRequest = exports2.ShiftPatternDeleteRequest = exports2.ShiftPostRequest = exports2.ScheduleLogGetRequest = void 0;
6738
+ exports2.BufferedDauMessageSchema = exports2.DauMessagesGetParams = exports2.AgentRequest = exports2.AgentMessage = exports2.TaskListDeleteRequest = exports2.TaskListPostRequest = 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.HISTORICAL_CORRECTION_WINDOW_MONTHS = exports2.MAX_HISTORICAL_CORRECTION_QUANTITY = exports2.ProductionAggregateWindowGetRequest = exports2.ProductionHistoricalCorrectionPostRequest = exports2.ProductionManualPostRequest = exports2.ShiftPatternDeleteRequest = exports2.ShiftPostRequest = exports2.ScheduleLogGetRequest = void 0;
6737
6739
  var common_1 = require_common();
6738
6740
  Object.defineProperty(exports2, "UNKNOWN_CODE", { enumerable: true, get: function() {
6739
6741
  return common_1.UNKNOWN_CODE;
@@ -6916,6 +6918,9 @@ var require_api_schemas = __commonJS({
6916
6918
  Object.defineProperty(exports2, "MAX_HISTORICAL_CORRECTION_QUANTITY", { enumerable: true, get: function() {
6917
6919
  return production_1.MAX_HISTORICAL_CORRECTION_QUANTITY;
6918
6920
  } });
6921
+ Object.defineProperty(exports2, "HISTORICAL_CORRECTION_WINDOW_MONTHS", { enumerable: true, get: function() {
6922
+ return production_1.HISTORICAL_CORRECTION_WINDOW_MONTHS;
6923
+ } });
6919
6924
  var issue_1 = require_issue();
6920
6925
  Object.defineProperty(exports2, "DOWNTIME_NOTE_MAX_LENGTH", { enumerable: true, get: function() {
6921
6926
  return issue_1.DOWNTIME_NOTE_MAX_LENGTH;
@@ -8301,11 +8306,13 @@ var require_production3 = __commonJS({
8301
8306
  return mod && mod.__esModule ? mod : { "default": mod };
8302
8307
  };
8303
8308
  Object.defineProperty(exports2, "__esModule", { value: true });
8309
+ exports2.MAX_HISTORICAL_CORRECTIONS_PER_SCHEDULE = void 0;
8304
8310
  exports2.productionCap = productionCap;
8305
8311
  exports2.isAtProductionCap = isAtProductionCap;
8306
8312
  exports2.exceedsProductionCap = exceedsProductionCap;
8307
8313
  exports2.historicalCorrectionAnchor = historicalCorrectionAnchor;
8308
8314
  exports2.isHistoricalCorrectionRow = isHistoricalCorrectionRow;
8315
+ exports2.nextHistoricalCorrectionAnchor = nextHistoricalCorrectionAnchor;
8309
8316
  exports2.formatScheduleProductionCount = formatScheduleProductionCount;
8310
8317
  exports2.processProduction = processProduction;
8311
8318
  exports2.filterBySkuType = filterBySkuType;
@@ -8334,14 +8341,25 @@ var require_production3 = __commonJS({
8334
8341
  }
8335
8342
  return (quantityTotal ?? 0) + delta > cap;
8336
8343
  }
8337
- function historicalCorrectionAnchor(actualEndAtTimestamp) {
8338
- return actualEndAtTimestamp - time_1.TimeIntervals["1s"].ms;
8344
+ exports2.MAX_HISTORICAL_CORRECTIONS_PER_SCHEDULE = 100;
8345
+ function historicalCorrectionAnchor(actualEndAtTimestamp, sequence = 0) {
8346
+ return actualEndAtTimestamp - time_1.TimeIntervals["1s"].ms + sequence;
8339
8347
  }
8340
8348
  function isHistoricalCorrectionRow(production, schedule) {
8341
8349
  if (schedule.actualEndAtTimestamp == null || production.type !== enums_1.PRODUCTION_TYPE.CORRECTION) {
8342
8350
  return false;
8343
8351
  }
8344
- return production.lastUnitAtTimestamp === historicalCorrectionAnchor(schedule.actualEndAtTimestamp);
8352
+ const first = historicalCorrectionAnchor(schedule.actualEndAtTimestamp);
8353
+ return production.lastUnitAtTimestamp >= first && production.lastUnitAtTimestamp < first + exports2.MAX_HISTORICAL_CORRECTIONS_PER_SCHEDULE;
8354
+ }
8355
+ function nextHistoricalCorrectionAnchor(corrections, schedule) {
8356
+ const first = historicalCorrectionAnchor(schedule.actualEndAtTimestamp);
8357
+ const taken = corrections.filter((correction) => isHistoricalCorrectionRow(correction, schedule));
8358
+ if (taken.length === 0) {
8359
+ return first;
8360
+ }
8361
+ const next = Math.max(...taken.map((correction) => correction.lastUnitAtTimestamp)) + 1;
8362
+ return next < first + exports2.MAX_HISTORICAL_CORRECTIONS_PER_SCHEDULE ? next : null;
8345
8363
  }
8346
8364
  function formatScheduleProductionCount(manifest, quantityTotal) {
8347
8365
  const formatted = (0, _1.roundTo)(quantityTotal ?? 0, 2).toLocaleString("en-us");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busroot-sdk",
3
- "version": "0.0.8-dev.2836398557",
3
+ "version": "0.0.8-dev.2839966438",
4
4
  "description": "An SDK for accessing Busroot from output.industries",
5
5
  "homepage": "https://www.output.industries",
6
6
  "main": "./build/index.js",