@dx-do/client 6.3.2 → 6.3.3
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/dist/index.cjs.js +457 -34
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +438 -35
- package/dist/index.esm.js.map +1 -1
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/model/maintenance/create.d.ts +137 -0
- package/dist/src/lib/model/maintenance/create.d.ts.map +1 -0
- package/dist/src/lib/model/maintenance/delete.d.ts +17 -0
- package/dist/src/lib/model/maintenance/delete.d.ts.map +1 -0
- package/dist/src/lib/model/maintenance/detail.d.ts +128 -0
- package/dist/src/lib/model/maintenance/detail.d.ts.map +1 -0
- package/dist/src/lib/model/maintenance/filter.d.ts +39 -0
- package/dist/src/lib/model/maintenance/filter.d.ts.map +1 -0
- package/dist/src/lib/model/maintenance/member.d.ts +61 -0
- package/dist/src/lib/model/maintenance/member.d.ts.map +1 -0
- package/dist/src/lib/model/maintenance/preview.d.ts +32 -0
- package/dist/src/lib/model/maintenance/preview.d.ts.map +1 -0
- package/dist/src/lib/model/maintenance/schedule.d.ts +30 -0
- package/dist/src/lib/model/maintenance/schedule.d.ts.map +1 -0
- package/dist/src/lib/model/maintenance/search.d.ts +67 -0
- package/dist/src/lib/model/maintenance/search.d.ts.map +1 -0
- package/dist/src/lib/services/maintenance.service.d.ts +51 -0
- package/dist/src/lib/services/maintenance.service.d.ts.map +1 -0
- package/dist/src/lib/services/service-monolith.d.ts +2 -0
- package/dist/src/lib/services/service-monolith.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -45894,6 +45894,308 @@ exports.LogQuery = void 0;
|
|
|
45894
45894
|
LogQuery.createLogQueryRequestBody = createLogQueryRequestBody;
|
|
45895
45895
|
})(exports.LogQuery || (exports.LogQuery = {}));
|
|
45896
45896
|
|
|
45897
|
+
/**
|
|
45898
|
+
* One leaf match condition inside a maintenance target filter, e.g.
|
|
45899
|
+
* `{ field: "alarm_name", condition: "starts_with", value: "Rabbit" }`.
|
|
45900
|
+
*/
|
|
45901
|
+
const MaintenanceFilterLeafSchema = v4.z.looseObject({
|
|
45902
|
+
field: v4.z.string().describe('Wire field to match, e.g. "agent", "type", "alarm_name", "name"'),
|
|
45903
|
+
fieldDescription: v4.z
|
|
45904
|
+
.string()
|
|
45905
|
+
.optional()
|
|
45906
|
+
.describe('Human label for the field, e.g. "Agent", "Type", "Alert Name"'),
|
|
45907
|
+
condition: v4.z
|
|
45908
|
+
.string()
|
|
45909
|
+
.describe('Match operator: "regex", "equals", "contains", "starts_with", "ends_with"'),
|
|
45910
|
+
value: v4.z.string().describe('Value to match against the field'),
|
|
45911
|
+
});
|
|
45912
|
+
/**
|
|
45913
|
+
* A maintenance target filter — the nested `and(or(leaf…))` tree shared by
|
|
45914
|
+
* every `*Filter` field on a maintenance schedule (serviceFilter, agentFilter,
|
|
45915
|
+
* deviceFilter, groupFilter, metricPathFilter). Outer AND of inner ORs of leaves.
|
|
45916
|
+
*/
|
|
45917
|
+
const MaintenanceFilterSchema = v4.z.looseObject({
|
|
45918
|
+
and: v4.z.looseObject({
|
|
45919
|
+
expressions: v4.z
|
|
45920
|
+
.array(v4.z.looseObject({
|
|
45921
|
+
or: v4.z.looseObject({
|
|
45922
|
+
expressions: v4.z.array(MaintenanceFilterLeafSchema),
|
|
45923
|
+
}),
|
|
45924
|
+
}))
|
|
45925
|
+
.describe('AND-ed groups; each group is an OR of leaf conditions'),
|
|
45926
|
+
}),
|
|
45927
|
+
});
|
|
45928
|
+
/**
|
|
45929
|
+
* Builds a single-leaf {@link MaintenanceFilter} (the common case: one match
|
|
45930
|
+
* condition wrapped in the required `and(or(…))` envelope). Pass more leaves to
|
|
45931
|
+
* OR them together within the single AND group.
|
|
45932
|
+
*/
|
|
45933
|
+
function maintenanceFilter(...leaves) {
|
|
45934
|
+
return { and: { expressions: [{ or: { expressions: leaves } }] } };
|
|
45935
|
+
}
|
|
45936
|
+
|
|
45937
|
+
/** CI type of a maintenance target member. */
|
|
45938
|
+
const MaintenanceMemberTypeSchema = v4.z
|
|
45939
|
+
.enum(['SERVICE', 'Agent', 'Device', 'Group', 'Interface', 'Application'])
|
|
45940
|
+
.describe('Configuration-item type of the member');
|
|
45941
|
+
/** Source product a maintenance member originates from. */
|
|
45942
|
+
const MaintenanceMemberSourceSchema = v4.z
|
|
45943
|
+
.enum(['OI', 'APM', 'UIM', 'SPECTRUM', 'CAPM', 'CUSTOM', 'NFA', 'ADA'])
|
|
45944
|
+
.describe('Source product of the member');
|
|
45945
|
+
/**
|
|
45946
|
+
* An explicit maintenance target member (as opposed to a `*Filter`). For a
|
|
45947
|
+
* service this is `{ id: <service externalId>, name, type: "SERVICE",
|
|
45948
|
+
* source: "OI", parent: "Y" }`.
|
|
45949
|
+
*/
|
|
45950
|
+
const MaintenanceMemberSchema = v4.z.looseObject({
|
|
45951
|
+
id: v4.z
|
|
45952
|
+
.string()
|
|
45953
|
+
.describe('Resource identifier; for services this is the externalId (SA:<cohort>:<uuid>)'),
|
|
45954
|
+
name: v4.z.string().describe('Display name of the member'),
|
|
45955
|
+
type: MaintenanceMemberTypeSchema,
|
|
45956
|
+
source: MaintenanceMemberSourceSchema.optional(),
|
|
45957
|
+
parent: v4.z
|
|
45958
|
+
.string()
|
|
45959
|
+
.optional()
|
|
45960
|
+
.describe('"Y" when this member is a parent/root (services)'),
|
|
45961
|
+
ciUniqueId: v4.z.string().optional().describe('CI unique id, when applicable'),
|
|
45962
|
+
});
|
|
45963
|
+
/** A member to exclude from an otherwise-matched maintenance target set. */
|
|
45964
|
+
const MaintenanceExcludedMemberSchema = v4.z.looseObject({
|
|
45965
|
+
id: v4.z.string().describe('Excluded member id'),
|
|
45966
|
+
name: v4.z.string().optional().describe('Excluded member name'),
|
|
45967
|
+
type: v4.z.string().optional().describe('CI type of the excluded member'),
|
|
45968
|
+
});
|
|
45969
|
+
|
|
45970
|
+
/** Recurrence pattern code used in the **create** schedule body. */
|
|
45971
|
+
const RecurrencePattern = {
|
|
45972
|
+
Once: 1,
|
|
45973
|
+
Daily: 2,
|
|
45974
|
+
Weekly: 3,
|
|
45975
|
+
Monthly: 4,
|
|
45976
|
+
Yearly: 5,
|
|
45977
|
+
};
|
|
45978
|
+
/**
|
|
45979
|
+
* The `schedule` object of a maintenance create/preview request.
|
|
45980
|
+
*
|
|
45981
|
+
* Note the create-side encoding (differs from search/detail responses):
|
|
45982
|
+
* `recurrencePattern` is numeric (1–5), `startTime`/`endTime` are wall-clock
|
|
45983
|
+
* strings `"YYYY-M-D H:M:S"` interpreted in `timeZone`, and `duration` is minutes.
|
|
45984
|
+
*/
|
|
45985
|
+
const MaintenanceScheduleSchema = v4.z.looseObject({
|
|
45986
|
+
startTime: v4.z
|
|
45987
|
+
.string()
|
|
45988
|
+
.describe('Wall-clock start "YYYY-M-D H:M:S" interpreted in timeZone, e.g. "2026-6-27 6:47:0"'),
|
|
45989
|
+
duration: v4.z.number().describe('Window length in minutes'),
|
|
45990
|
+
endTime: v4.z
|
|
45991
|
+
.string()
|
|
45992
|
+
.nullable()
|
|
45993
|
+
.optional()
|
|
45994
|
+
.describe('Wall-clock end; null/absent = run forever'),
|
|
45995
|
+
timeZone: v4.z.string().describe('IANA timezone, e.g. "America/Los_Angeles"'),
|
|
45996
|
+
recurrencePattern: v4.z
|
|
45997
|
+
.number()
|
|
45998
|
+
.int()
|
|
45999
|
+
.describe('1 Once · 2 Daily · 3 Weekly · 4 Monthly · 5 Yearly'),
|
|
46000
|
+
recurrencePeriod: v4.z
|
|
46001
|
+
.number()
|
|
46002
|
+
.int()
|
|
46003
|
+
.optional()
|
|
46004
|
+
.describe('Repeat every N (daily: N days; monthly: N months)'),
|
|
46005
|
+
recurrenceDaysOfTheWeek: v4.z
|
|
46006
|
+
.string()
|
|
46007
|
+
.optional()
|
|
46008
|
+
.describe('Weekly days, comma-separated 1..7 where 1=Sun..7=Sat, e.g. "2,3"'),
|
|
46009
|
+
recurrenceDayOfTheMonth: v4.z
|
|
46010
|
+
.string()
|
|
46011
|
+
.optional()
|
|
46012
|
+
.describe('Monthly day-of-month (1..31) as a string'),
|
|
46013
|
+
recurrenceInstance: v4.z
|
|
46014
|
+
.number()
|
|
46015
|
+
.int()
|
|
46016
|
+
.optional()
|
|
46017
|
+
.describe('Monthly ordinal week 1..5 (first..last) for "4th Tuesday" style'),
|
|
46018
|
+
});
|
|
46019
|
+
|
|
46020
|
+
/**
|
|
46021
|
+
* Unified request body for `POST /oi/v2/api/maintenance` (create). A single
|
|
46022
|
+
* endpoint covers all target types — the per-target CLI commands each populate
|
|
46023
|
+
* exactly one targeting mechanism (members, or one of the `*Filter`s).
|
|
46024
|
+
*/
|
|
46025
|
+
const MaintenanceCreateRequestSchema = v4.z.looseObject({
|
|
46026
|
+
name: v4.z.string().describe('Schedule name; must be unique per tenant'),
|
|
46027
|
+
description: v4.z.string().optional().describe('Free-text description'),
|
|
46028
|
+
schedule: MaintenanceScheduleSchema,
|
|
46029
|
+
// ----- targeting (combine as needed; commands set one) -----
|
|
46030
|
+
members: v4.z
|
|
46031
|
+
.array(MaintenanceMemberSchema)
|
|
46032
|
+
.optional()
|
|
46033
|
+
.describe('Explicit target CIs (services use this, with externalId ids)'),
|
|
46034
|
+
excludedMembers: v4.z
|
|
46035
|
+
.array(MaintenanceExcludedMemberSchema)
|
|
46036
|
+
.optional()
|
|
46037
|
+
.describe('CIs to exclude from an otherwise-matched set'),
|
|
46038
|
+
serviceFilter: MaintenanceFilterSchema.optional().describe('Filter-based service targeting'),
|
|
46039
|
+
agentFilter: MaintenanceFilterSchema.optional().describe('Agent targeting (regex on field "agent")'),
|
|
46040
|
+
deviceFilter: MaintenanceFilterSchema.optional().describe('Device/entity targeting'),
|
|
46041
|
+
groupFilter: MaintenanceFilterSchema.optional().describe('Group targeting'),
|
|
46042
|
+
metricPathFilter: MaintenanceFilterSchema.optional().describe('Raw-alarm targeting (on field "alarm_name")'),
|
|
46043
|
+
includeSubservices: v4.z
|
|
46044
|
+
.boolean()
|
|
46045
|
+
.optional()
|
|
46046
|
+
.describe('Include child services of targeted services'),
|
|
46047
|
+
selectAllServices: v4.z.boolean().optional(),
|
|
46048
|
+
selectAllAgents: v4.z.boolean().optional(),
|
|
46049
|
+
selectAllGroups: v4.z.boolean().optional(),
|
|
46050
|
+
selectAllDevices: v4.z.boolean().optional(),
|
|
46051
|
+
// ----- behavior -----
|
|
46052
|
+
muteOldAlarms: v4.z
|
|
46053
|
+
.boolean()
|
|
46054
|
+
.optional()
|
|
46055
|
+
.describe('Mute alarms that were already open when the window starts'),
|
|
46056
|
+
alarmsExitOnEnd: v4.z
|
|
46057
|
+
.boolean()
|
|
46058
|
+
.optional()
|
|
46059
|
+
.describe('Clear alarm state when the window ends'),
|
|
46060
|
+
restrictSLOOnMaintenance: v4.z
|
|
46061
|
+
.boolean()
|
|
46062
|
+
.optional()
|
|
46063
|
+
.describe('Exclude the window from SLO calculations'),
|
|
46064
|
+
forceStop: v4.z.boolean().optional(),
|
|
46065
|
+
});
|
|
46066
|
+
/** Response from `POST /oi/v2/api/maintenance`. */
|
|
46067
|
+
const MaintenanceCreateResponseSchema = v4.z.looseObject({
|
|
46068
|
+
message: v4.z.string().describe('Confirmation message'),
|
|
46069
|
+
scheduleId: v4.z.string().describe('UUID of the created schedule'),
|
|
46070
|
+
});
|
|
46071
|
+
|
|
46072
|
+
/** Request body for `POST /oi/v2/api/maintenance/delete?forceStop=…` (bulk). */
|
|
46073
|
+
const MaintenanceDeleteRequestSchema = v4.z.looseObject({
|
|
46074
|
+
scheduleIds: v4.z
|
|
46075
|
+
.array(v4.z.string())
|
|
46076
|
+
.describe('Schedule ids to delete (bulk-capable)'),
|
|
46077
|
+
});
|
|
46078
|
+
/**
|
|
46079
|
+
* Response from the bulk delete endpoint (modeled loosely). Named with a
|
|
46080
|
+
* `BulkDelete` prefix to avoid clashing with the ASM client's generated
|
|
46081
|
+
* `MaintenanceDeleteResponse` in the flattened `@dx-do/client` barrel.
|
|
46082
|
+
*/
|
|
46083
|
+
const MaintenanceBulkDeleteResponseSchema = v4.z.looseObject({
|
|
46084
|
+
message: v4.z.union([v4.z.string(), v4.z.array(v4.z.string())]).optional(),
|
|
46085
|
+
status: v4.z.string().optional(),
|
|
46086
|
+
});
|
|
46087
|
+
|
|
46088
|
+
/**
|
|
46089
|
+
* A single schedule from `GET /oi/v2/api/maintenance/{id}` (detail). Read-side
|
|
46090
|
+
* encoding: `recurrencePattern` numeric, `startTime` a wall-clock string with
|
|
46091
|
+
* `startTimeInMillis`/`endTimeInMillis` epoch companions, plus whichever
|
|
46092
|
+
* `*Filter`/`members` targeting it was created with.
|
|
46093
|
+
*/
|
|
46094
|
+
const MaintenanceDetailSchema = v4.z.looseObject({
|
|
46095
|
+
scheduleId: v4.z.string(),
|
|
46096
|
+
name: v4.z.string().nullable().optional().describe('null for a non-existent id (the GET echoes the id with null fields)'),
|
|
46097
|
+
description: v4.z.string().nullable().optional(),
|
|
46098
|
+
status: v4.z.string().optional().describe('e.g. "SCHEDULED"'),
|
|
46099
|
+
startTime: v4.z.string().optional().describe('Wall-clock start, e.g. "2026-12-25 00:00:00.0"'),
|
|
46100
|
+
startTimeInMillis: v4.z.number().optional(),
|
|
46101
|
+
endTimeInMillis: v4.z.number().nullable().optional(),
|
|
46102
|
+
duration: v4.z.number().optional().describe('Minutes'),
|
|
46103
|
+
timeZone: v4.z.string().optional(),
|
|
46104
|
+
recurrencePattern: v4.z
|
|
46105
|
+
.union([v4.z.number(), v4.z.string()])
|
|
46106
|
+
.optional()
|
|
46107
|
+
.describe('Numeric recurrence code on detail (1..5)'),
|
|
46108
|
+
recurrencePeriod: v4.z.number().optional(),
|
|
46109
|
+
recurrenceDaysOfTheWeek: v4.z.string().optional(),
|
|
46110
|
+
recurrenceDayOfTheMonth: v4.z.string().optional(),
|
|
46111
|
+
recurrenceInstance: v4.z.number().optional(),
|
|
46112
|
+
members: v4.z.array(MaintenanceMemberSchema).optional(),
|
|
46113
|
+
excludedMembers: v4.z.array(MaintenanceExcludedMemberSchema).optional(),
|
|
46114
|
+
serviceFilter: MaintenanceFilterSchema.nullable().optional(),
|
|
46115
|
+
agentFilter: MaintenanceFilterSchema.nullable().optional(),
|
|
46116
|
+
deviceFilter: MaintenanceFilterSchema.nullable().optional(),
|
|
46117
|
+
groupFilter: MaintenanceFilterSchema.nullable().optional(),
|
|
46118
|
+
metricPathFilter: MaintenanceFilterSchema.nullable().optional(),
|
|
46119
|
+
includeSubservices: v4.z.boolean().optional(),
|
|
46120
|
+
muteOldAlarms: v4.z.boolean().optional(),
|
|
46121
|
+
alarmsExitOnEnd: v4.z.boolean().optional(),
|
|
46122
|
+
restrictSLOOnMaintenance: v4.z.boolean().optional(),
|
|
46123
|
+
});
|
|
46124
|
+
|
|
46125
|
+
/**
|
|
46126
|
+
* Request body for `POST /oi/v2/api/maintenance/get-next-windows-preview` —
|
|
46127
|
+
* a (proposed or existing) schedule; the server returns its upcoming windows.
|
|
46128
|
+
*/
|
|
46129
|
+
const MaintenancePreviewRequestSchema = v4.z.looseObject({
|
|
46130
|
+
name: v4.z.string().optional(),
|
|
46131
|
+
description: v4.z.string().optional(),
|
|
46132
|
+
schedule: MaintenanceScheduleSchema,
|
|
46133
|
+
});
|
|
46134
|
+
/**
|
|
46135
|
+
* Response from `get-next-windows-preview`: `startTime` is an array of upcoming
|
|
46136
|
+
* window-start wall-clock strings ("yyyy-MM-dd HH:mm:ss.S") in the schedule's
|
|
46137
|
+
* timezone; each window runs for `schedule.duration` minutes.
|
|
46138
|
+
*/
|
|
46139
|
+
const MaintenancePreviewResponseSchema = v4.z.looseObject({
|
|
46140
|
+
scheduleId: v4.z.string().nullable().optional(),
|
|
46141
|
+
startTime: v4.z
|
|
46142
|
+
.array(v4.z.string())
|
|
46143
|
+
.optional()
|
|
46144
|
+
.describe('Upcoming window start times (wall-clock, in the schedule timezone)'),
|
|
46145
|
+
});
|
|
46146
|
+
|
|
46147
|
+
/** Request body for `POST /oi/v2/api/maintenance/_search` (list). */
|
|
46148
|
+
const MaintenanceSearchRequestSchema = v4.z.looseObject({
|
|
46149
|
+
pageNumber: v4.z.number().int().describe('Zero-based page index'),
|
|
46150
|
+
pageSize: v4.z.number().int().describe('Page size'),
|
|
46151
|
+
sortColDir: v4.z
|
|
46152
|
+
.array(v4.z.string())
|
|
46153
|
+
.optional()
|
|
46154
|
+
.describe('Sort spec, e.g. ["creationDate;desc"]'),
|
|
46155
|
+
includeCompletedSchedules: v4.z
|
|
46156
|
+
.boolean()
|
|
46157
|
+
.optional()
|
|
46158
|
+
.describe('Include schedules whose windows have all passed'),
|
|
46159
|
+
customFilter: v4.z.array(v4.z.unknown()).optional().describe('Optional server-side filters'),
|
|
46160
|
+
});
|
|
46161
|
+
/**
|
|
46162
|
+
* One schedule as summarized by `_search`. Note the response-side encoding:
|
|
46163
|
+
* `recurrencePattern` is a label string ("Daily"), `recurrencePattern_1` the
|
|
46164
|
+
* numeric code, and times are epoch ms (contrast the create body).
|
|
46165
|
+
*/
|
|
46166
|
+
const MaintenanceSummarySchema = v4.z.looseObject({
|
|
46167
|
+
scheduleId: v4.z.string(),
|
|
46168
|
+
scheduleName: v4.z.string().describe('Schedule name (may be padded with spaces)'),
|
|
46169
|
+
description: v4.z.string().nullable().optional(),
|
|
46170
|
+
startTime: v4.z.number().optional().describe('Start, epoch ms'),
|
|
46171
|
+
duration: v4.z.number().optional().describe('Window length, minutes'),
|
|
46172
|
+
recurrencePattern: v4.z.string().optional().describe('Recurrence label, e.g. "Daily"'),
|
|
46173
|
+
recurrencePattern_1: v4.z.number().optional().describe('Numeric recurrence code (1..5)'),
|
|
46174
|
+
recurrencePeriod: v4.z.number().optional(),
|
|
46175
|
+
timezone: v4.z.string().optional(),
|
|
46176
|
+
status: v4.z.string().optional().describe('e.g. "SCHEDULED"'),
|
|
46177
|
+
createdBy: v4.z.string().nullable().optional(),
|
|
46178
|
+
creationDate: v4.z.number().optional(),
|
|
46179
|
+
lastUpdatedBy: v4.z.string().nullable().optional(),
|
|
46180
|
+
lastUpdateDate: v4.z.number().optional(),
|
|
46181
|
+
windowTime: v4.z
|
|
46182
|
+
.looseObject({
|
|
46183
|
+
startTime: v4.z.number().optional(),
|
|
46184
|
+
endTime: v4.z.number().optional(),
|
|
46185
|
+
})
|
|
46186
|
+
.optional()
|
|
46187
|
+
.describe('Next/active window bounds, epoch ms'),
|
|
46188
|
+
deleted: v4.z.string().optional().describe('"Y"/"N"'),
|
|
46189
|
+
});
|
|
46190
|
+
/** Response from `POST /oi/v2/api/maintenance/_search`. */
|
|
46191
|
+
const MaintenanceSearchResponseSchema = v4.z.looseObject({
|
|
46192
|
+
schedules: v4.z.array(MaintenanceSummarySchema).describe('The matched schedules'),
|
|
46193
|
+
totalCount: v4.z.number().optional(),
|
|
46194
|
+
scheduleCount: v4.z.number().optional(),
|
|
46195
|
+
pageNumber: v4.z.number().optional(),
|
|
46196
|
+
pageSize: v4.z.number().optional(),
|
|
46197
|
+
});
|
|
46198
|
+
|
|
45897
46199
|
exports.NASS = void 0;
|
|
45898
46200
|
(function (NASS) {
|
|
45899
46201
|
function getAgentMetricCountQueryBody(agent) {
|
|
@@ -67011,46 +67313,55 @@ const coerce$1 = (version, options) => {
|
|
|
67011
67313
|
};
|
|
67012
67314
|
var coerce_1 = coerce$1;
|
|
67013
67315
|
|
|
67014
|
-
|
|
67015
|
-
|
|
67016
|
-
this.max = 1000;
|
|
67017
|
-
this.map = new Map();
|
|
67018
|
-
}
|
|
67316
|
+
var lrucache;
|
|
67317
|
+
var hasRequiredLrucache;
|
|
67019
67318
|
|
|
67020
|
-
|
|
67021
|
-
|
|
67022
|
-
|
|
67023
|
-
return undefined
|
|
67024
|
-
} else {
|
|
67025
|
-
// Remove the key from the map and add it to the end
|
|
67026
|
-
this.map.delete(key);
|
|
67027
|
-
this.map.set(key, value);
|
|
67028
|
-
return value
|
|
67029
|
-
}
|
|
67030
|
-
}
|
|
67319
|
+
function requireLrucache () {
|
|
67320
|
+
if (hasRequiredLrucache) return lrucache;
|
|
67321
|
+
hasRequiredLrucache = 1;
|
|
67031
67322
|
|
|
67032
|
-
|
|
67033
|
-
|
|
67034
|
-
|
|
67323
|
+
class LRUCache {
|
|
67324
|
+
constructor () {
|
|
67325
|
+
this.max = 1000;
|
|
67326
|
+
this.map = new Map();
|
|
67327
|
+
}
|
|
67035
67328
|
|
|
67036
|
-
|
|
67037
|
-
|
|
67329
|
+
get (key) {
|
|
67330
|
+
const value = this.map.get(key);
|
|
67331
|
+
if (value === undefined) {
|
|
67332
|
+
return undefined
|
|
67333
|
+
} else {
|
|
67334
|
+
// Remove the key from the map and add it to the end
|
|
67335
|
+
this.map.delete(key);
|
|
67336
|
+
this.map.set(key, value);
|
|
67337
|
+
return value
|
|
67338
|
+
}
|
|
67339
|
+
}
|
|
67038
67340
|
|
|
67039
|
-
|
|
67040
|
-
|
|
67041
|
-
|
|
67042
|
-
const firstKey = this.map.keys().next().value;
|
|
67043
|
-
this.delete(firstKey);
|
|
67044
|
-
}
|
|
67341
|
+
delete (key) {
|
|
67342
|
+
return this.map.delete(key)
|
|
67343
|
+
}
|
|
67045
67344
|
|
|
67046
|
-
|
|
67047
|
-
|
|
67345
|
+
set (key, value) {
|
|
67346
|
+
const deleted = this.delete(key);
|
|
67048
67347
|
|
|
67049
|
-
|
|
67050
|
-
|
|
67051
|
-
|
|
67348
|
+
if (!deleted && value !== undefined) {
|
|
67349
|
+
// If cache is full, delete the least recently used item
|
|
67350
|
+
if (this.map.size >= this.max) {
|
|
67351
|
+
const firstKey = this.map.keys().next().value;
|
|
67352
|
+
this.delete(firstKey);
|
|
67353
|
+
}
|
|
67354
|
+
|
|
67355
|
+
this.map.set(key, value);
|
|
67356
|
+
}
|
|
67052
67357
|
|
|
67053
|
-
|
|
67358
|
+
return this
|
|
67359
|
+
}
|
|
67360
|
+
}
|
|
67361
|
+
|
|
67362
|
+
lrucache = LRUCache;
|
|
67363
|
+
return lrucache;
|
|
67364
|
+
}
|
|
67054
67365
|
|
|
67055
67366
|
var range;
|
|
67056
67367
|
var hasRequiredRange;
|
|
@@ -67273,7 +67584,7 @@ function requireRange () {
|
|
|
67273
67584
|
|
|
67274
67585
|
range = Range;
|
|
67275
67586
|
|
|
67276
|
-
const LRU =
|
|
67587
|
+
const LRU = requireLrucache();
|
|
67277
67588
|
const cache = new LRU();
|
|
67278
67589
|
|
|
67279
67590
|
const parseOptions = parseOptions_1;
|
|
@@ -74335,6 +74646,97 @@ class LogsService {
|
|
|
74335
74646
|
}
|
|
74336
74647
|
}
|
|
74337
74648
|
|
|
74649
|
+
/**
|
|
74650
|
+
* Service for DXO2 maintenance windows (schedules) under
|
|
74651
|
+
* `oi/v2/api/maintenance/*`. A maintenance window suppresses alarms/SLOs for
|
|
74652
|
+
* its targets (services, agents, devices/entities, or raw alarms) over a fixed
|
|
74653
|
+
* or recurring schedule. Backs the `maintenance` CLI command group.
|
|
74654
|
+
*
|
|
74655
|
+
* Uses `oiPost`/`oiGet` (OI namespace). Requests are validated with `parse`
|
|
74656
|
+
* (throws); responses with `safeParse` (warn + return raw on mismatch).
|
|
74657
|
+
*/
|
|
74658
|
+
class MaintenanceService {
|
|
74659
|
+
dxSaasService;
|
|
74660
|
+
log;
|
|
74661
|
+
constructor(dxSaasService, log) {
|
|
74662
|
+
this.dxSaasService = dxSaasService;
|
|
74663
|
+
this.log = log;
|
|
74664
|
+
}
|
|
74665
|
+
/** Lists maintenance schedules via `POST …/_search`. Defaults to one large page, newest first. */
|
|
74666
|
+
async search(request) {
|
|
74667
|
+
const body = {
|
|
74668
|
+
pageNumber: 0,
|
|
74669
|
+
pageSize: 1000,
|
|
74670
|
+
sortColDir: ['creationDate;desc'],
|
|
74671
|
+
includeCompletedSchedules: false,
|
|
74672
|
+
customFilter: [],
|
|
74673
|
+
...request,
|
|
74674
|
+
};
|
|
74675
|
+
const raw = await this.dxSaasService.oiPost('oi/v2/api/maintenance/_search', body);
|
|
74676
|
+
const result = MaintenanceSearchResponseSchema.safeParse(raw);
|
|
74677
|
+
if (!result.success) {
|
|
74678
|
+
this.log.warn('MaintenanceSearchResponse validation warning:', result.error.message);
|
|
74679
|
+
}
|
|
74680
|
+
return raw;
|
|
74681
|
+
}
|
|
74682
|
+
/** Retrieves a single schedule via `GET …/{id}`. */
|
|
74683
|
+
async get(scheduleId) {
|
|
74684
|
+
const raw = await this.dxSaasService.oiGet(`oi/v2/api/maintenance/${scheduleId}`);
|
|
74685
|
+
const result = MaintenanceDetailSchema.safeParse(raw);
|
|
74686
|
+
if (!result.success) {
|
|
74687
|
+
this.log.warn('MaintenanceDetail validation warning:', result.error.message);
|
|
74688
|
+
}
|
|
74689
|
+
return raw;
|
|
74690
|
+
}
|
|
74691
|
+
/**
|
|
74692
|
+
* Previews the upcoming windows for a (proposed or existing) schedule via
|
|
74693
|
+
* `POST …/get-next-windows-preview`.
|
|
74694
|
+
*
|
|
74695
|
+
* @throws ZodError if the request fails schema validation.
|
|
74696
|
+
*/
|
|
74697
|
+
async getNextWindows(request) {
|
|
74698
|
+
MaintenancePreviewRequestSchema.parse(request);
|
|
74699
|
+
return this.dxSaasService.oiPost('oi/v2/api/maintenance/get-next-windows-preview', request);
|
|
74700
|
+
}
|
|
74701
|
+
/**
|
|
74702
|
+
* Checks a schedule name via `GET …/validateScheduleName`. Returns the
|
|
74703
|
+
* server's bare boolean (semantics confirmed empirically by the caller).
|
|
74704
|
+
*/
|
|
74705
|
+
async validateName(name) {
|
|
74706
|
+
const raw = await this.dxSaasService.oiGet('oi/v2/api/maintenance/validateScheduleName', { scheduleName: name });
|
|
74707
|
+
const result = v4.z.boolean().safeParse(raw);
|
|
74708
|
+
if (!result.success) {
|
|
74709
|
+
this.log.warn('validateScheduleName returned a non-boolean:', JSON.stringify(raw));
|
|
74710
|
+
}
|
|
74711
|
+
return Boolean(raw);
|
|
74712
|
+
}
|
|
74713
|
+
/**
|
|
74714
|
+
* Creates a maintenance schedule via `POST …`.
|
|
74715
|
+
*
|
|
74716
|
+
* @throws ZodError if the request fails schema validation.
|
|
74717
|
+
*/
|
|
74718
|
+
async create(body) {
|
|
74719
|
+
MaintenanceCreateRequestSchema.parse(body);
|
|
74720
|
+
const raw = await this.dxSaasService.oiPost('oi/v2/api/maintenance', body);
|
|
74721
|
+
const result = MaintenanceCreateResponseSchema.safeParse(raw);
|
|
74722
|
+
if (!result.success) {
|
|
74723
|
+
this.log.warn('MaintenanceCreateResponse validation warning:', result.error.message);
|
|
74724
|
+
}
|
|
74725
|
+
return raw;
|
|
74726
|
+
}
|
|
74727
|
+
/**
|
|
74728
|
+
* Deletes one or more schedules via `POST …/delete?forceStop=…` (bulk).
|
|
74729
|
+
*/
|
|
74730
|
+
async delete(scheduleIds, options = {}) {
|
|
74731
|
+
const raw = await this.dxSaasService.oiPost('oi/v2/api/maintenance/delete', { scheduleIds }, { forceStop: options.forceStop ?? true });
|
|
74732
|
+
const result = MaintenanceBulkDeleteResponseSchema.safeParse(raw);
|
|
74733
|
+
if (!result.success) {
|
|
74734
|
+
this.log.warn('MaintenanceBulkDeleteResponse validation warning:', result.error.message);
|
|
74735
|
+
}
|
|
74736
|
+
return raw;
|
|
74737
|
+
}
|
|
74738
|
+
}
|
|
74739
|
+
|
|
74338
74740
|
/**
|
|
74339
74741
|
* Service for management modules (and their calculators): list, create, update,
|
|
74340
74742
|
* copy, import, delete, and query by ID.
|
|
@@ -78328,6 +78730,7 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
|
|
|
78328
78730
|
dxInventoryService: new InventoryService(dxSaaSService, dxNASSService, dxTASService, log),
|
|
78329
78731
|
dxJSExtensionService: new JsExtensionService(dxSaaSService),
|
|
78330
78732
|
dxLogsService: new LogsService(dxSaaSService),
|
|
78733
|
+
dxMaintenanceService: new MaintenanceService(dxSaaSService, log),
|
|
78331
78734
|
dxManagementModuleService: dxManagementModuleService,
|
|
78332
78735
|
dxMetricBatchService: new MetricBatchService(dxSaaSService),
|
|
78333
78736
|
dxMetricGroupingService: new MetricGroupingService(dxSaaSService, dxManagementModuleService),
|
|
@@ -78451,6 +78854,24 @@ exports.LogsService = LogsService;
|
|
|
78451
78854
|
exports.METRIC_TYPE_ENUM = METRIC_TYPE_ENUM;
|
|
78452
78855
|
exports.METRIC_TYPE_ENUM_NAMES = METRIC_TYPE_ENUM_NAMES;
|
|
78453
78856
|
exports.METRIC_TYPE_REGION = METRIC_TYPE_REGION;
|
|
78857
|
+
exports.MaintenanceBulkDeleteResponseSchema = MaintenanceBulkDeleteResponseSchema;
|
|
78858
|
+
exports.MaintenanceCreateRequestSchema = MaintenanceCreateRequestSchema;
|
|
78859
|
+
exports.MaintenanceCreateResponseSchema = MaintenanceCreateResponseSchema;
|
|
78860
|
+
exports.MaintenanceDeleteRequestSchema = MaintenanceDeleteRequestSchema;
|
|
78861
|
+
exports.MaintenanceDetailSchema = MaintenanceDetailSchema;
|
|
78862
|
+
exports.MaintenanceExcludedMemberSchema = MaintenanceExcludedMemberSchema;
|
|
78863
|
+
exports.MaintenanceFilterLeafSchema = MaintenanceFilterLeafSchema;
|
|
78864
|
+
exports.MaintenanceFilterSchema = MaintenanceFilterSchema;
|
|
78865
|
+
exports.MaintenanceMemberSchema = MaintenanceMemberSchema;
|
|
78866
|
+
exports.MaintenanceMemberSourceSchema = MaintenanceMemberSourceSchema;
|
|
78867
|
+
exports.MaintenanceMemberTypeSchema = MaintenanceMemberTypeSchema;
|
|
78868
|
+
exports.MaintenancePreviewRequestSchema = MaintenancePreviewRequestSchema;
|
|
78869
|
+
exports.MaintenancePreviewResponseSchema = MaintenancePreviewResponseSchema;
|
|
78870
|
+
exports.MaintenanceScheduleSchema = MaintenanceScheduleSchema;
|
|
78871
|
+
exports.MaintenanceSearchRequestSchema = MaintenanceSearchRequestSchema;
|
|
78872
|
+
exports.MaintenanceSearchResponseSchema = MaintenanceSearchResponseSchema;
|
|
78873
|
+
exports.MaintenanceService = MaintenanceService;
|
|
78874
|
+
exports.MaintenanceSummarySchema = MaintenanceSummarySchema;
|
|
78454
78875
|
exports.ManagementModuleIdSchema = ManagementModuleIdSchema;
|
|
78455
78876
|
exports.ManagementModuleService = ManagementModuleService;
|
|
78456
78877
|
exports.MetadataMetricQueryResponseV2Schema = MetadataMetricQueryResponseV2Schema;
|
|
@@ -78501,6 +78922,7 @@ exports.QueryRequestSchema = QueryRequestSchema;
|
|
|
78501
78922
|
exports.QueryResultSchema = QueryResultSchema;
|
|
78502
78923
|
exports.QuerySpecSpecifierSchema = QuerySpecSpecifierSchema;
|
|
78503
78924
|
exports.QuerySpecifierSchema = QuerySpecifierSchema;
|
|
78925
|
+
exports.RecurrencePattern = RecurrencePattern;
|
|
78504
78926
|
exports.SLIService = SLIService;
|
|
78505
78927
|
exports.SQLService = SQLService;
|
|
78506
78928
|
exports.ServiceFilterSpecifierSchema = ServiceFilterSpecifierSchema;
|
|
@@ -78655,6 +79077,7 @@ exports.logGet = logGet;
|
|
|
78655
79077
|
exports.logGetEvent = logGetEvent;
|
|
78656
79078
|
exports.maintenanceDelete = maintenanceDelete;
|
|
78657
79079
|
exports.maintenanceDeleteWindows = maintenanceDeleteWindows;
|
|
79080
|
+
exports.maintenanceFilter = maintenanceFilter;
|
|
78658
79081
|
exports.maintenanceGet = maintenanceGet;
|
|
78659
79082
|
exports.maintenanceGetDetail = maintenanceGetDetail;
|
|
78660
79083
|
exports.maintenanceGetWindows = maintenanceGetWindows;
|