@dx-do/client 6.3.2 → 6.3.4

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 (31) hide show
  1. package/dist/index.cjs.js +497 -35
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +478 -36
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/src/index.d.ts +9 -0
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/lib/model/datastore/nassql/operations.d.ts +28 -18
  8. package/dist/src/lib/model/datastore/nassql/operations.d.ts.map +1 -1
  9. package/dist/src/lib/model/datastore/nassql/query.d.ts +25 -15
  10. package/dist/src/lib/model/datastore/nassql/query.d.ts.map +1 -1
  11. package/dist/src/lib/model/maintenance/create.d.ts +137 -0
  12. package/dist/src/lib/model/maintenance/create.d.ts.map +1 -0
  13. package/dist/src/lib/model/maintenance/delete.d.ts +17 -0
  14. package/dist/src/lib/model/maintenance/delete.d.ts.map +1 -0
  15. package/dist/src/lib/model/maintenance/detail.d.ts +128 -0
  16. package/dist/src/lib/model/maintenance/detail.d.ts.map +1 -0
  17. package/dist/src/lib/model/maintenance/filter.d.ts +39 -0
  18. package/dist/src/lib/model/maintenance/filter.d.ts.map +1 -0
  19. package/dist/src/lib/model/maintenance/member.d.ts +61 -0
  20. package/dist/src/lib/model/maintenance/member.d.ts.map +1 -0
  21. package/dist/src/lib/model/maintenance/preview.d.ts +32 -0
  22. package/dist/src/lib/model/maintenance/preview.d.ts.map +1 -0
  23. package/dist/src/lib/model/maintenance/schedule.d.ts +30 -0
  24. package/dist/src/lib/model/maintenance/schedule.d.ts.map +1 -0
  25. package/dist/src/lib/model/maintenance/search.d.ts +67 -0
  26. package/dist/src/lib/model/maintenance/search.d.ts.map +1 -0
  27. package/dist/src/lib/services/maintenance.service.d.ts +51 -0
  28. package/dist/src/lib/services/maintenance.service.d.ts.map +1 -0
  29. package/dist/src/lib/services/service-monolith.d.ts +2 -0
  30. package/dist/src/lib/services/service-monolith.d.ts.map +1 -1
  31. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -29322,12 +29322,15 @@ const QueryFilterPredicateSpecSchema = v4.z.union([
29322
29322
  const QueryRangeSpecSchema = v4.z.looseObject({
29323
29323
  endTime: v4.z
29324
29324
  .number()
29325
- .describe('Absolute end time in ms since epoch; default `now`'),
29325
+ .optional()
29326
+ .describe('Absolute end time in ms since epoch; omit (or 0) for `now`'),
29326
29327
  rangeSize: v4.z
29327
29328
  .number()
29329
+ .optional()
29328
29330
  .describe('Window length in ms; `startTime = endTime - rangeSize`. Default 8 minutes'),
29329
29331
  frequency: v4.z
29330
29332
  .number()
29333
+ .optional()
29331
29334
  .describe('Initial NASS aggregation interval in ms; default 15s. Aggregator picked per metric type'),
29332
29335
  });
29333
29336
  /**
@@ -29978,6 +29981,41 @@ const QueryFromDataSpecSchema = v4.z.looseObject({
29978
29981
  queryRange: QueryRangeSpecSchema.optional().describe('Time-window to fetch; defaults to pipeline range'),
29979
29982
  alias: v4.z.string().optional().describe('Column namespace for output rows'),
29980
29983
  });
29984
+ /**
29985
+ * `WQL` — source op that selects time-series via a single **WQL** expression
29986
+ * instead of a Metrics Metadata `querySpecifier`. Like `FROM`, it produces
29987
+ * data rows and is typically the first op in the pipeline.
29988
+ *
29989
+ * The `wql` string is parsed server-side (ANTLR `DXQueryCompiler`); we treat
29990
+ * it as opaque here — no client-side grammar validation. Grammar:
29991
+ *
29992
+ * `ts(<metric-name>[, <predicates>])`
29993
+ *
29994
+ * `<metric-name>` may be quoted or unquoted. `<predicates>` combine
29995
+ * `attr=value` terms with `and` / `or` / `not`, grouping `( … )`, single- or
29996
+ * double-quoted values, and `*` wildcards. Example:
29997
+ *
29998
+ * `ts("CPU Time (ms)" and source="web-server-01" and not env="staging")`
29999
+ *
30000
+ * **Tenant gating**: requires the `DXDASHBOARDS_WQL_FEATURE` toggle; tenants
30001
+ * without it return an error at run time.
30002
+ */
30003
+ const QueryWqlSpecSchema = v4.z.looseObject({
30004
+ op: v4.z.literal('WQL'),
30005
+ wql: v4.z
30006
+ .string()
30007
+ .min(1)
30008
+ .describe('WQL expression selecting time-series. Grammar: `ts(<metric-name>[, <predicates>])` — name quoted or unquoted; predicates combine `attr=value` with `and`/`or`/`not`, grouping `( )`, quoted values, and `*` wildcards. E.g. `ts("CPU Time (ms)" and source="web-server-01")`. Server-parsed (ANTLR); required and non-empty.'),
30009
+ clamp: v4.z
30010
+ .union([v4.z.number(), v4.z.string()])
30011
+ .optional()
30012
+ .describe('Cap on results; `0` = unlimited (default). Semantically an int, but the platform emits it on the wire as a numeric string (e.g. `"10000"`) — both forms accepted.'),
30013
+ useAttributes: v4.z
30014
+ .boolean()
30015
+ .optional()
30016
+ .describe('When true, use metadata attributes in the WQL metadata query; omit to fall back to the tenant config default (`isMetadataQueryUsingAttributes`).'),
30017
+ queryRange: QueryRangeSpecSchema.optional().describe('Time-window spec; defaults to the last 8 minutes ending now'),
30018
+ });
29981
30019
  /**
29982
30020
  * `JOIN_METADATA` — for each upstream row, look up zero or one
29983
30021
  * `MetricDescriptor` by the external ID in `externalIdColumn` and
@@ -30131,6 +30169,7 @@ const QueryFunctionSpecSchema = v4.z.discriminatedUnion('op', [
30131
30169
  QueryFromMetadataSpecSchema,
30132
30170
  QueryFromTopologySpecSchema,
30133
30171
  QueryFromDataSpecSchema,
30172
+ QueryWqlSpecSchema,
30134
30173
  QueryJoinMetadataSpecSchema,
30135
30174
  QueryJoinTopologySpecSchema,
30136
30175
  QueryLogSpecSchema,
@@ -45894,6 +45933,308 @@ exports.LogQuery = void 0;
45894
45933
  LogQuery.createLogQueryRequestBody = createLogQueryRequestBody;
45895
45934
  })(exports.LogQuery || (exports.LogQuery = {}));
45896
45935
 
45936
+ /**
45937
+ * One leaf match condition inside a maintenance target filter, e.g.
45938
+ * `{ field: "alarm_name", condition: "starts_with", value: "Rabbit" }`.
45939
+ */
45940
+ const MaintenanceFilterLeafSchema = v4.z.looseObject({
45941
+ field: v4.z.string().describe('Wire field to match, e.g. "agent", "type", "alarm_name", "name"'),
45942
+ fieldDescription: v4.z
45943
+ .string()
45944
+ .optional()
45945
+ .describe('Human label for the field, e.g. "Agent", "Type", "Alert Name"'),
45946
+ condition: v4.z
45947
+ .string()
45948
+ .describe('Match operator: "regex", "equals", "contains", "starts_with", "ends_with"'),
45949
+ value: v4.z.string().describe('Value to match against the field'),
45950
+ });
45951
+ /**
45952
+ * A maintenance target filter — the nested `and(or(leaf…))` tree shared by
45953
+ * every `*Filter` field on a maintenance schedule (serviceFilter, agentFilter,
45954
+ * deviceFilter, groupFilter, metricPathFilter). Outer AND of inner ORs of leaves.
45955
+ */
45956
+ const MaintenanceFilterSchema = v4.z.looseObject({
45957
+ and: v4.z.looseObject({
45958
+ expressions: v4.z
45959
+ .array(v4.z.looseObject({
45960
+ or: v4.z.looseObject({
45961
+ expressions: v4.z.array(MaintenanceFilterLeafSchema),
45962
+ }),
45963
+ }))
45964
+ .describe('AND-ed groups; each group is an OR of leaf conditions'),
45965
+ }),
45966
+ });
45967
+ /**
45968
+ * Builds a single-leaf {@link MaintenanceFilter} (the common case: one match
45969
+ * condition wrapped in the required `and(or(…))` envelope). Pass more leaves to
45970
+ * OR them together within the single AND group.
45971
+ */
45972
+ function maintenanceFilter(...leaves) {
45973
+ return { and: { expressions: [{ or: { expressions: leaves } }] } };
45974
+ }
45975
+
45976
+ /** CI type of a maintenance target member. */
45977
+ const MaintenanceMemberTypeSchema = v4.z
45978
+ .enum(['SERVICE', 'Agent', 'Device', 'Group', 'Interface', 'Application'])
45979
+ .describe('Configuration-item type of the member');
45980
+ /** Source product a maintenance member originates from. */
45981
+ const MaintenanceMemberSourceSchema = v4.z
45982
+ .enum(['OI', 'APM', 'UIM', 'SPECTRUM', 'CAPM', 'CUSTOM', 'NFA', 'ADA'])
45983
+ .describe('Source product of the member');
45984
+ /**
45985
+ * An explicit maintenance target member (as opposed to a `*Filter`). For a
45986
+ * service this is `{ id: <service externalId>, name, type: "SERVICE",
45987
+ * source: "OI", parent: "Y" }`.
45988
+ */
45989
+ const MaintenanceMemberSchema = v4.z.looseObject({
45990
+ id: v4.z
45991
+ .string()
45992
+ .describe('Resource identifier; for services this is the externalId (SA:<cohort>:<uuid>)'),
45993
+ name: v4.z.string().describe('Display name of the member'),
45994
+ type: MaintenanceMemberTypeSchema,
45995
+ source: MaintenanceMemberSourceSchema.optional(),
45996
+ parent: v4.z
45997
+ .string()
45998
+ .optional()
45999
+ .describe('"Y" when this member is a parent/root (services)'),
46000
+ ciUniqueId: v4.z.string().optional().describe('CI unique id, when applicable'),
46001
+ });
46002
+ /** A member to exclude from an otherwise-matched maintenance target set. */
46003
+ const MaintenanceExcludedMemberSchema = v4.z.looseObject({
46004
+ id: v4.z.string().describe('Excluded member id'),
46005
+ name: v4.z.string().optional().describe('Excluded member name'),
46006
+ type: v4.z.string().optional().describe('CI type of the excluded member'),
46007
+ });
46008
+
46009
+ /** Recurrence pattern code used in the **create** schedule body. */
46010
+ const RecurrencePattern = {
46011
+ Once: 1,
46012
+ Daily: 2,
46013
+ Weekly: 3,
46014
+ Monthly: 4,
46015
+ Yearly: 5,
46016
+ };
46017
+ /**
46018
+ * The `schedule` object of a maintenance create/preview request.
46019
+ *
46020
+ * Note the create-side encoding (differs from search/detail responses):
46021
+ * `recurrencePattern` is numeric (1–5), `startTime`/`endTime` are wall-clock
46022
+ * strings `"YYYY-M-D H:M:S"` interpreted in `timeZone`, and `duration` is minutes.
46023
+ */
46024
+ const MaintenanceScheduleSchema = v4.z.looseObject({
46025
+ startTime: v4.z
46026
+ .string()
46027
+ .describe('Wall-clock start "YYYY-M-D H:M:S" interpreted in timeZone, e.g. "2026-6-27 6:47:0"'),
46028
+ duration: v4.z.number().describe('Window length in minutes'),
46029
+ endTime: v4.z
46030
+ .string()
46031
+ .nullable()
46032
+ .optional()
46033
+ .describe('Wall-clock end; null/absent = run forever'),
46034
+ timeZone: v4.z.string().describe('IANA timezone, e.g. "America/Los_Angeles"'),
46035
+ recurrencePattern: v4.z
46036
+ .number()
46037
+ .int()
46038
+ .describe('1 Once · 2 Daily · 3 Weekly · 4 Monthly · 5 Yearly'),
46039
+ recurrencePeriod: v4.z
46040
+ .number()
46041
+ .int()
46042
+ .optional()
46043
+ .describe('Repeat every N (daily: N days; monthly: N months)'),
46044
+ recurrenceDaysOfTheWeek: v4.z
46045
+ .string()
46046
+ .optional()
46047
+ .describe('Weekly days, comma-separated 1..7 where 1=Sun..7=Sat, e.g. "2,3"'),
46048
+ recurrenceDayOfTheMonth: v4.z
46049
+ .string()
46050
+ .optional()
46051
+ .describe('Monthly day-of-month (1..31) as a string'),
46052
+ recurrenceInstance: v4.z
46053
+ .number()
46054
+ .int()
46055
+ .optional()
46056
+ .describe('Monthly ordinal week 1..5 (first..last) for "4th Tuesday" style'),
46057
+ });
46058
+
46059
+ /**
46060
+ * Unified request body for `POST /oi/v2/api/maintenance` (create). A single
46061
+ * endpoint covers all target types — the per-target CLI commands each populate
46062
+ * exactly one targeting mechanism (members, or one of the `*Filter`s).
46063
+ */
46064
+ const MaintenanceCreateRequestSchema = v4.z.looseObject({
46065
+ name: v4.z.string().describe('Schedule name; must be unique per tenant'),
46066
+ description: v4.z.string().optional().describe('Free-text description'),
46067
+ schedule: MaintenanceScheduleSchema,
46068
+ // ----- targeting (combine as needed; commands set one) -----
46069
+ members: v4.z
46070
+ .array(MaintenanceMemberSchema)
46071
+ .optional()
46072
+ .describe('Explicit target CIs (services use this, with externalId ids)'),
46073
+ excludedMembers: v4.z
46074
+ .array(MaintenanceExcludedMemberSchema)
46075
+ .optional()
46076
+ .describe('CIs to exclude from an otherwise-matched set'),
46077
+ serviceFilter: MaintenanceFilterSchema.optional().describe('Filter-based service targeting'),
46078
+ agentFilter: MaintenanceFilterSchema.optional().describe('Agent targeting (regex on field "agent")'),
46079
+ deviceFilter: MaintenanceFilterSchema.optional().describe('Device/entity targeting'),
46080
+ groupFilter: MaintenanceFilterSchema.optional().describe('Group targeting'),
46081
+ metricPathFilter: MaintenanceFilterSchema.optional().describe('Raw-alarm targeting (on field "alarm_name")'),
46082
+ includeSubservices: v4.z
46083
+ .boolean()
46084
+ .optional()
46085
+ .describe('Include child services of targeted services'),
46086
+ selectAllServices: v4.z.boolean().optional(),
46087
+ selectAllAgents: v4.z.boolean().optional(),
46088
+ selectAllGroups: v4.z.boolean().optional(),
46089
+ selectAllDevices: v4.z.boolean().optional(),
46090
+ // ----- behavior -----
46091
+ muteOldAlarms: v4.z
46092
+ .boolean()
46093
+ .optional()
46094
+ .describe('Mute alarms that were already open when the window starts'),
46095
+ alarmsExitOnEnd: v4.z
46096
+ .boolean()
46097
+ .optional()
46098
+ .describe('Clear alarm state when the window ends'),
46099
+ restrictSLOOnMaintenance: v4.z
46100
+ .boolean()
46101
+ .optional()
46102
+ .describe('Exclude the window from SLO calculations'),
46103
+ forceStop: v4.z.boolean().optional(),
46104
+ });
46105
+ /** Response from `POST /oi/v2/api/maintenance`. */
46106
+ const MaintenanceCreateResponseSchema = v4.z.looseObject({
46107
+ message: v4.z.string().describe('Confirmation message'),
46108
+ scheduleId: v4.z.string().describe('UUID of the created schedule'),
46109
+ });
46110
+
46111
+ /** Request body for `POST /oi/v2/api/maintenance/delete?forceStop=…` (bulk). */
46112
+ const MaintenanceDeleteRequestSchema = v4.z.looseObject({
46113
+ scheduleIds: v4.z
46114
+ .array(v4.z.string())
46115
+ .describe('Schedule ids to delete (bulk-capable)'),
46116
+ });
46117
+ /**
46118
+ * Response from the bulk delete endpoint (modeled loosely). Named with a
46119
+ * `BulkDelete` prefix to avoid clashing with the ASM client's generated
46120
+ * `MaintenanceDeleteResponse` in the flattened `@dx-do/client` barrel.
46121
+ */
46122
+ const MaintenanceBulkDeleteResponseSchema = v4.z.looseObject({
46123
+ message: v4.z.union([v4.z.string(), v4.z.array(v4.z.string())]).optional(),
46124
+ status: v4.z.string().optional(),
46125
+ });
46126
+
46127
+ /**
46128
+ * A single schedule from `GET /oi/v2/api/maintenance/{id}` (detail). Read-side
46129
+ * encoding: `recurrencePattern` numeric, `startTime` a wall-clock string with
46130
+ * `startTimeInMillis`/`endTimeInMillis` epoch companions, plus whichever
46131
+ * `*Filter`/`members` targeting it was created with.
46132
+ */
46133
+ const MaintenanceDetailSchema = v4.z.looseObject({
46134
+ scheduleId: v4.z.string(),
46135
+ name: v4.z.string().nullable().optional().describe('null for a non-existent id (the GET echoes the id with null fields)'),
46136
+ description: v4.z.string().nullable().optional(),
46137
+ status: v4.z.string().optional().describe('e.g. "SCHEDULED"'),
46138
+ startTime: v4.z.string().optional().describe('Wall-clock start, e.g. "2026-12-25 00:00:00.0"'),
46139
+ startTimeInMillis: v4.z.number().optional(),
46140
+ endTimeInMillis: v4.z.number().nullable().optional(),
46141
+ duration: v4.z.number().optional().describe('Minutes'),
46142
+ timeZone: v4.z.string().optional(),
46143
+ recurrencePattern: v4.z
46144
+ .union([v4.z.number(), v4.z.string()])
46145
+ .optional()
46146
+ .describe('Numeric recurrence code on detail (1..5)'),
46147
+ recurrencePeriod: v4.z.number().optional(),
46148
+ recurrenceDaysOfTheWeek: v4.z.string().optional(),
46149
+ recurrenceDayOfTheMonth: v4.z.string().optional(),
46150
+ recurrenceInstance: v4.z.number().optional(),
46151
+ members: v4.z.array(MaintenanceMemberSchema).optional(),
46152
+ excludedMembers: v4.z.array(MaintenanceExcludedMemberSchema).optional(),
46153
+ serviceFilter: MaintenanceFilterSchema.nullable().optional(),
46154
+ agentFilter: MaintenanceFilterSchema.nullable().optional(),
46155
+ deviceFilter: MaintenanceFilterSchema.nullable().optional(),
46156
+ groupFilter: MaintenanceFilterSchema.nullable().optional(),
46157
+ metricPathFilter: MaintenanceFilterSchema.nullable().optional(),
46158
+ includeSubservices: v4.z.boolean().optional(),
46159
+ muteOldAlarms: v4.z.boolean().optional(),
46160
+ alarmsExitOnEnd: v4.z.boolean().optional(),
46161
+ restrictSLOOnMaintenance: v4.z.boolean().optional(),
46162
+ });
46163
+
46164
+ /**
46165
+ * Request body for `POST /oi/v2/api/maintenance/get-next-windows-preview` —
46166
+ * a (proposed or existing) schedule; the server returns its upcoming windows.
46167
+ */
46168
+ const MaintenancePreviewRequestSchema = v4.z.looseObject({
46169
+ name: v4.z.string().optional(),
46170
+ description: v4.z.string().optional(),
46171
+ schedule: MaintenanceScheduleSchema,
46172
+ });
46173
+ /**
46174
+ * Response from `get-next-windows-preview`: `startTime` is an array of upcoming
46175
+ * window-start wall-clock strings ("yyyy-MM-dd HH:mm:ss.S") in the schedule's
46176
+ * timezone; each window runs for `schedule.duration` minutes.
46177
+ */
46178
+ const MaintenancePreviewResponseSchema = v4.z.looseObject({
46179
+ scheduleId: v4.z.string().nullable().optional(),
46180
+ startTime: v4.z
46181
+ .array(v4.z.string())
46182
+ .optional()
46183
+ .describe('Upcoming window start times (wall-clock, in the schedule timezone)'),
46184
+ });
46185
+
46186
+ /** Request body for `POST /oi/v2/api/maintenance/_search` (list). */
46187
+ const MaintenanceSearchRequestSchema = v4.z.looseObject({
46188
+ pageNumber: v4.z.number().int().describe('Zero-based page index'),
46189
+ pageSize: v4.z.number().int().describe('Page size'),
46190
+ sortColDir: v4.z
46191
+ .array(v4.z.string())
46192
+ .optional()
46193
+ .describe('Sort spec, e.g. ["creationDate;desc"]'),
46194
+ includeCompletedSchedules: v4.z
46195
+ .boolean()
46196
+ .optional()
46197
+ .describe('Include schedules whose windows have all passed'),
46198
+ customFilter: v4.z.array(v4.z.unknown()).optional().describe('Optional server-side filters'),
46199
+ });
46200
+ /**
46201
+ * One schedule as summarized by `_search`. Note the response-side encoding:
46202
+ * `recurrencePattern` is a label string ("Daily"), `recurrencePattern_1` the
46203
+ * numeric code, and times are epoch ms (contrast the create body).
46204
+ */
46205
+ const MaintenanceSummarySchema = v4.z.looseObject({
46206
+ scheduleId: v4.z.string(),
46207
+ scheduleName: v4.z.string().describe('Schedule name (may be padded with spaces)'),
46208
+ description: v4.z.string().nullable().optional(),
46209
+ startTime: v4.z.number().optional().describe('Start, epoch ms'),
46210
+ duration: v4.z.number().optional().describe('Window length, minutes'),
46211
+ recurrencePattern: v4.z.string().optional().describe('Recurrence label, e.g. "Daily"'),
46212
+ recurrencePattern_1: v4.z.number().optional().describe('Numeric recurrence code (1..5)'),
46213
+ recurrencePeriod: v4.z.number().optional(),
46214
+ timezone: v4.z.string().optional(),
46215
+ status: v4.z.string().optional().describe('e.g. "SCHEDULED"'),
46216
+ createdBy: v4.z.string().nullable().optional(),
46217
+ creationDate: v4.z.number().optional(),
46218
+ lastUpdatedBy: v4.z.string().nullable().optional(),
46219
+ lastUpdateDate: v4.z.number().optional(),
46220
+ windowTime: v4.z
46221
+ .looseObject({
46222
+ startTime: v4.z.number().optional(),
46223
+ endTime: v4.z.number().optional(),
46224
+ })
46225
+ .optional()
46226
+ .describe('Next/active window bounds, epoch ms'),
46227
+ deleted: v4.z.string().optional().describe('"Y"/"N"'),
46228
+ });
46229
+ /** Response from `POST /oi/v2/api/maintenance/_search`. */
46230
+ const MaintenanceSearchResponseSchema = v4.z.looseObject({
46231
+ schedules: v4.z.array(MaintenanceSummarySchema).describe('The matched schedules'),
46232
+ totalCount: v4.z.number().optional(),
46233
+ scheduleCount: v4.z.number().optional(),
46234
+ pageNumber: v4.z.number().optional(),
46235
+ pageSize: v4.z.number().optional(),
46236
+ });
46237
+
45897
46238
  exports.NASS = void 0;
45898
46239
  (function (NASS) {
45899
46240
  function getAgentMetricCountQueryBody(agent) {
@@ -67011,46 +67352,55 @@ const coerce$1 = (version, options) => {
67011
67352
  };
67012
67353
  var coerce_1 = coerce$1;
67013
67354
 
67014
- class LRUCache {
67015
- constructor () {
67016
- this.max = 1000;
67017
- this.map = new Map();
67018
- }
67355
+ var lrucache;
67356
+ var hasRequiredLrucache;
67019
67357
 
67020
- get (key) {
67021
- const value = this.map.get(key);
67022
- if (value === undefined) {
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
- }
67358
+ function requireLrucache () {
67359
+ if (hasRequiredLrucache) return lrucache;
67360
+ hasRequiredLrucache = 1;
67031
67361
 
67032
- delete (key) {
67033
- return this.map.delete(key)
67034
- }
67362
+ class LRUCache {
67363
+ constructor () {
67364
+ this.max = 1000;
67365
+ this.map = new Map();
67366
+ }
67035
67367
 
67036
- set (key, value) {
67037
- const deleted = this.delete(key);
67368
+ get (key) {
67369
+ const value = this.map.get(key);
67370
+ if (value === undefined) {
67371
+ return undefined
67372
+ } else {
67373
+ // Remove the key from the map and add it to the end
67374
+ this.map.delete(key);
67375
+ this.map.set(key, value);
67376
+ return value
67377
+ }
67378
+ }
67038
67379
 
67039
- if (!deleted && value !== undefined) {
67040
- // If cache is full, delete the least recently used item
67041
- if (this.map.size >= this.max) {
67042
- const firstKey = this.map.keys().next().value;
67043
- this.delete(firstKey);
67044
- }
67380
+ delete (key) {
67381
+ return this.map.delete(key)
67382
+ }
67045
67383
 
67046
- this.map.set(key, value);
67047
- }
67384
+ set (key, value) {
67385
+ const deleted = this.delete(key);
67048
67386
 
67049
- return this
67050
- }
67051
- }
67387
+ if (!deleted && value !== undefined) {
67388
+ // If cache is full, delete the least recently used item
67389
+ if (this.map.size >= this.max) {
67390
+ const firstKey = this.map.keys().next().value;
67391
+ this.delete(firstKey);
67392
+ }
67052
67393
 
67053
- var lrucache = LRUCache;
67394
+ this.map.set(key, value);
67395
+ }
67396
+
67397
+ return this
67398
+ }
67399
+ }
67400
+
67401
+ lrucache = LRUCache;
67402
+ return lrucache;
67403
+ }
67054
67404
 
67055
67405
  var range;
67056
67406
  var hasRequiredRange;
@@ -67273,7 +67623,7 @@ function requireRange () {
67273
67623
 
67274
67624
  range = Range;
67275
67625
 
67276
- const LRU = lrucache;
67626
+ const LRU = requireLrucache();
67277
67627
  const cache = new LRU();
67278
67628
 
67279
67629
  const parseOptions = parseOptions_1;
@@ -74335,6 +74685,97 @@ class LogsService {
74335
74685
  }
74336
74686
  }
74337
74687
 
74688
+ /**
74689
+ * Service for DXO2 maintenance windows (schedules) under
74690
+ * `oi/v2/api/maintenance/*`. A maintenance window suppresses alarms/SLOs for
74691
+ * its targets (services, agents, devices/entities, or raw alarms) over a fixed
74692
+ * or recurring schedule. Backs the `maintenance` CLI command group.
74693
+ *
74694
+ * Uses `oiPost`/`oiGet` (OI namespace). Requests are validated with `parse`
74695
+ * (throws); responses with `safeParse` (warn + return raw on mismatch).
74696
+ */
74697
+ class MaintenanceService {
74698
+ dxSaasService;
74699
+ log;
74700
+ constructor(dxSaasService, log) {
74701
+ this.dxSaasService = dxSaasService;
74702
+ this.log = log;
74703
+ }
74704
+ /** Lists maintenance schedules via `POST …/_search`. Defaults to one large page, newest first. */
74705
+ async search(request) {
74706
+ const body = {
74707
+ pageNumber: 0,
74708
+ pageSize: 1000,
74709
+ sortColDir: ['creationDate;desc'],
74710
+ includeCompletedSchedules: false,
74711
+ customFilter: [],
74712
+ ...request,
74713
+ };
74714
+ const raw = await this.dxSaasService.oiPost('oi/v2/api/maintenance/_search', body);
74715
+ const result = MaintenanceSearchResponseSchema.safeParse(raw);
74716
+ if (!result.success) {
74717
+ this.log.warn('MaintenanceSearchResponse validation warning:', result.error.message);
74718
+ }
74719
+ return raw;
74720
+ }
74721
+ /** Retrieves a single schedule via `GET …/{id}`. */
74722
+ async get(scheduleId) {
74723
+ const raw = await this.dxSaasService.oiGet(`oi/v2/api/maintenance/${scheduleId}`);
74724
+ const result = MaintenanceDetailSchema.safeParse(raw);
74725
+ if (!result.success) {
74726
+ this.log.warn('MaintenanceDetail validation warning:', result.error.message);
74727
+ }
74728
+ return raw;
74729
+ }
74730
+ /**
74731
+ * Previews the upcoming windows for a (proposed or existing) schedule via
74732
+ * `POST …/get-next-windows-preview`.
74733
+ *
74734
+ * @throws ZodError if the request fails schema validation.
74735
+ */
74736
+ async getNextWindows(request) {
74737
+ MaintenancePreviewRequestSchema.parse(request);
74738
+ return this.dxSaasService.oiPost('oi/v2/api/maintenance/get-next-windows-preview', request);
74739
+ }
74740
+ /**
74741
+ * Checks a schedule name via `GET …/validateScheduleName`. Returns the
74742
+ * server's bare boolean (semantics confirmed empirically by the caller).
74743
+ */
74744
+ async validateName(name) {
74745
+ const raw = await this.dxSaasService.oiGet('oi/v2/api/maintenance/validateScheduleName', { scheduleName: name });
74746
+ const result = v4.z.boolean().safeParse(raw);
74747
+ if (!result.success) {
74748
+ this.log.warn('validateScheduleName returned a non-boolean:', JSON.stringify(raw));
74749
+ }
74750
+ return Boolean(raw);
74751
+ }
74752
+ /**
74753
+ * Creates a maintenance schedule via `POST …`.
74754
+ *
74755
+ * @throws ZodError if the request fails schema validation.
74756
+ */
74757
+ async create(body) {
74758
+ MaintenanceCreateRequestSchema.parse(body);
74759
+ const raw = await this.dxSaasService.oiPost('oi/v2/api/maintenance', body);
74760
+ const result = MaintenanceCreateResponseSchema.safeParse(raw);
74761
+ if (!result.success) {
74762
+ this.log.warn('MaintenanceCreateResponse validation warning:', result.error.message);
74763
+ }
74764
+ return raw;
74765
+ }
74766
+ /**
74767
+ * Deletes one or more schedules via `POST …/delete?forceStop=…` (bulk).
74768
+ */
74769
+ async delete(scheduleIds, options = {}) {
74770
+ const raw = await this.dxSaasService.oiPost('oi/v2/api/maintenance/delete', { scheduleIds }, { forceStop: options.forceStop ?? true });
74771
+ const result = MaintenanceBulkDeleteResponseSchema.safeParse(raw);
74772
+ if (!result.success) {
74773
+ this.log.warn('MaintenanceBulkDeleteResponse validation warning:', result.error.message);
74774
+ }
74775
+ return raw;
74776
+ }
74777
+ }
74778
+
74338
74779
  /**
74339
74780
  * Service for management modules (and their calculators): list, create, update,
74340
74781
  * copy, import, delete, and query by ID.
@@ -78328,6 +78769,7 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
78328
78769
  dxInventoryService: new InventoryService(dxSaaSService, dxNASSService, dxTASService, log),
78329
78770
  dxJSExtensionService: new JsExtensionService(dxSaaSService),
78330
78771
  dxLogsService: new LogsService(dxSaaSService),
78772
+ dxMaintenanceService: new MaintenanceService(dxSaaSService, log),
78331
78773
  dxManagementModuleService: dxManagementModuleService,
78332
78774
  dxMetricBatchService: new MetricBatchService(dxSaaSService),
78333
78775
  dxMetricGroupingService: new MetricGroupingService(dxSaaSService, dxManagementModuleService),
@@ -78451,6 +78893,24 @@ exports.LogsService = LogsService;
78451
78893
  exports.METRIC_TYPE_ENUM = METRIC_TYPE_ENUM;
78452
78894
  exports.METRIC_TYPE_ENUM_NAMES = METRIC_TYPE_ENUM_NAMES;
78453
78895
  exports.METRIC_TYPE_REGION = METRIC_TYPE_REGION;
78896
+ exports.MaintenanceBulkDeleteResponseSchema = MaintenanceBulkDeleteResponseSchema;
78897
+ exports.MaintenanceCreateRequestSchema = MaintenanceCreateRequestSchema;
78898
+ exports.MaintenanceCreateResponseSchema = MaintenanceCreateResponseSchema;
78899
+ exports.MaintenanceDeleteRequestSchema = MaintenanceDeleteRequestSchema;
78900
+ exports.MaintenanceDetailSchema = MaintenanceDetailSchema;
78901
+ exports.MaintenanceExcludedMemberSchema = MaintenanceExcludedMemberSchema;
78902
+ exports.MaintenanceFilterLeafSchema = MaintenanceFilterLeafSchema;
78903
+ exports.MaintenanceFilterSchema = MaintenanceFilterSchema;
78904
+ exports.MaintenanceMemberSchema = MaintenanceMemberSchema;
78905
+ exports.MaintenanceMemberSourceSchema = MaintenanceMemberSourceSchema;
78906
+ exports.MaintenanceMemberTypeSchema = MaintenanceMemberTypeSchema;
78907
+ exports.MaintenancePreviewRequestSchema = MaintenancePreviewRequestSchema;
78908
+ exports.MaintenancePreviewResponseSchema = MaintenancePreviewResponseSchema;
78909
+ exports.MaintenanceScheduleSchema = MaintenanceScheduleSchema;
78910
+ exports.MaintenanceSearchRequestSchema = MaintenanceSearchRequestSchema;
78911
+ exports.MaintenanceSearchResponseSchema = MaintenanceSearchResponseSchema;
78912
+ exports.MaintenanceService = MaintenanceService;
78913
+ exports.MaintenanceSummarySchema = MaintenanceSummarySchema;
78454
78914
  exports.ManagementModuleIdSchema = ManagementModuleIdSchema;
78455
78915
  exports.ManagementModuleService = ManagementModuleService;
78456
78916
  exports.MetadataMetricQueryResponseV2Schema = MetadataMetricQueryResponseV2Schema;
@@ -78501,6 +78961,7 @@ exports.QueryRequestSchema = QueryRequestSchema;
78501
78961
  exports.QueryResultSchema = QueryResultSchema;
78502
78962
  exports.QuerySpecSpecifierSchema = QuerySpecSpecifierSchema;
78503
78963
  exports.QuerySpecifierSchema = QuerySpecifierSchema;
78964
+ exports.RecurrencePattern = RecurrencePattern;
78504
78965
  exports.SLIService = SLIService;
78505
78966
  exports.SQLService = SQLService;
78506
78967
  exports.ServiceFilterSpecifierSchema = ServiceFilterSpecifierSchema;
@@ -78655,6 +79116,7 @@ exports.logGet = logGet;
78655
79116
  exports.logGetEvent = logGetEvent;
78656
79117
  exports.maintenanceDelete = maintenanceDelete;
78657
79118
  exports.maintenanceDeleteWindows = maintenanceDeleteWindows;
79119
+ exports.maintenanceFilter = maintenanceFilter;
78658
79120
  exports.maintenanceGet = maintenanceGet;
78659
79121
  exports.maintenanceGetDetail = maintenanceGetDetail;
78660
79122
  exports.maintenanceGetWindows = maintenanceGetWindows;