@dx-do/client 6.3.1 → 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.
Files changed (35) hide show
  1. package/dist/index.cjs.js +673 -0
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +646 -1
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/src/index.d.ts +13 -0
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/lib/model/maintenance/create.d.ts +137 -0
  8. package/dist/src/lib/model/maintenance/create.d.ts.map +1 -0
  9. package/dist/src/lib/model/maintenance/delete.d.ts +17 -0
  10. package/dist/src/lib/model/maintenance/delete.d.ts.map +1 -0
  11. package/dist/src/lib/model/maintenance/detail.d.ts +128 -0
  12. package/dist/src/lib/model/maintenance/detail.d.ts.map +1 -0
  13. package/dist/src/lib/model/maintenance/filter.d.ts +39 -0
  14. package/dist/src/lib/model/maintenance/filter.d.ts.map +1 -0
  15. package/dist/src/lib/model/maintenance/member.d.ts +61 -0
  16. package/dist/src/lib/model/maintenance/member.d.ts.map +1 -0
  17. package/dist/src/lib/model/maintenance/preview.d.ts +32 -0
  18. package/dist/src/lib/model/maintenance/preview.d.ts.map +1 -0
  19. package/dist/src/lib/model/maintenance/schedule.d.ts +30 -0
  20. package/dist/src/lib/model/maintenance/schedule.d.ts.map +1 -0
  21. package/dist/src/lib/model/maintenance/search.d.ts +67 -0
  22. package/dist/src/lib/model/maintenance/search.d.ts.map +1 -0
  23. package/dist/src/lib/model/sli/group.d.ts +59 -0
  24. package/dist/src/lib/model/sli/group.d.ts.map +1 -0
  25. package/dist/src/lib/model/sli/save.d.ts +54 -0
  26. package/dist/src/lib/model/sli/save.d.ts.map +1 -0
  27. package/dist/src/lib/model/sli/search.d.ts +58 -0
  28. package/dist/src/lib/model/sli/search.d.ts.map +1 -0
  29. package/dist/src/lib/services/maintenance.service.d.ts +51 -0
  30. package/dist/src/lib/services/maintenance.service.d.ts.map +1 -0
  31. package/dist/src/lib/services/service-monolith.d.ts +4 -0
  32. package/dist/src/lib/services/service-monolith.d.ts.map +1 -1
  33. package/dist/src/lib/services/sli.service.d.ts +53 -0
  34. package/dist/src/lib/services/sli.service.d.ts.map +1 -0
  35. 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) {
@@ -48650,6 +48952,182 @@ exports.Situations = void 0;
48650
48952
  (function (Situations) {
48651
48953
  })(exports.Situations || (exports.Situations = {}));
48652
48954
 
48955
+ /**
48956
+ * One row of an SLI's match criteria. SLIs select the metrics they watch by a
48957
+ * list of these AND-ed filters (e.g. "Source contains bd605" AND "Metric ends
48958
+ * with Web Agent Status").
48959
+ */
48960
+ const SliFilterSchema = v4.z.looseObject({
48961
+ fieldDescription: v4.z
48962
+ .string()
48963
+ .describe('Human label for the field, e.g. "Source" or "Metric"'),
48964
+ field: v4.z
48965
+ .string()
48966
+ .describe('Wire field the filter matches on, e.g. "sourceName" or "attributeName"'),
48967
+ value: v4.z.string().describe('Value to match against the field'),
48968
+ condition: v4.z
48969
+ .string()
48970
+ .describe('Match operator, e.g. "contains", "ends_with", "regex"'),
48971
+ });
48972
+ /**
48973
+ * A full SLI "group" as returned by `groups/search` (per `sliGroups[]` entry)
48974
+ * and `groups?groupId=<id>` (single object). This is the **raw** shape that
48975
+ * `sli export` writes to disk and `sli import` reads back.
48976
+ *
48977
+ * The wire terms are `groupName` / `groupId`; the CLI surfaces these to users
48978
+ * as `sliName` / `sliId`. The deeply-nested `sliDefinition` / `sloDefinition` /
48979
+ * `alertDefinition` blocks are kept **opaque** (loose passthrough) so they
48980
+ * round-trip untouched — we model the envelope, not the SLI/SLO math.
48981
+ */
48982
+ const SliGroupSchema = v4.z.looseObject({
48983
+ groupName: v4.z.string().describe('SLI name (surfaced to users as `sliName`)'),
48984
+ groupId: v4.z
48985
+ .number()
48986
+ .describe('Server-assigned SLI id (surfaced to users as `sliId`)'),
48987
+ type: v4.z
48988
+ .string()
48989
+ .nullable()
48990
+ .optional()
48991
+ .describe('Group type; "sli" for SLIs. Save bodies set it; the GET-by-id response returns null'),
48992
+ description: v4.z
48993
+ .string()
48994
+ .nullable()
48995
+ .optional()
48996
+ .describe('Free-text description; may be null or empty'),
48997
+ mgId: v4.z
48998
+ .unknown()
48999
+ .nullable()
49000
+ .optional()
49001
+ .describe('Management-group id; null for SLIs'),
49002
+ filters: v4.z
49003
+ .array(SliFilterSchema)
49004
+ .describe('AND-ed metric match criteria selecting the SLI source metrics'),
49005
+ serviceNames: v4.z
49006
+ .array(v4.z.string())
49007
+ .describe('Service names this SLI is bound to. `sli import` overwrites this with the passed serviceName'),
49008
+ sliDefinition: v4.z
49009
+ .looseObject({ functions: v4.z.array(v4.z.unknown()).optional() })
49010
+ .optional()
49011
+ .describe('Opaque SLI computation spec ({ functions: [...] }); round-tripped verbatim'),
49012
+ sloDefinition: v4.z
49013
+ .looseObject({ functions: v4.z.array(v4.z.unknown()).optional() })
49014
+ .optional()
49015
+ .describe('Opaque SLO computation spec ({ functions: [...] }); round-tripped verbatim'),
49016
+ alertDefinition: v4.z
49017
+ .unknown()
49018
+ .optional()
49019
+ .describe('Opaque alert spec; null or an array. Normalized to [] on import when null'),
49020
+ // Read-only server-managed fields (present on reads, ignored on save).
49021
+ creationTime: v4.z.number().optional().describe('Epoch seconds the SLI was created'),
49022
+ lastModifiedTime: v4.z.number().optional().describe('Epoch seconds the SLI was last modified'),
49023
+ createdBy: v4.z.string().nullable().optional().describe('User that created the SLI'),
49024
+ lastUpdatedBy: v4.z.string().nullable().optional().describe('User that last updated the SLI'),
49025
+ totalMetrics: v4.z.number().optional().describe('Count of metrics currently matched by the SLI'),
49026
+ breached: v4.z.boolean().optional().describe('Whether the SLO is currently breached'),
49027
+ product: v4.z.unknown().nullable().optional().describe('Owning product; usually null'),
49028
+ enabled: v4.z.boolean().optional().describe('Whether the SLI is active'),
49029
+ sliStatusCode: v4.z.number().optional().describe('Registration status code; 0 = healthy'),
49030
+ sliStatusMessage: v4.z.string().optional().describe('Human-readable registration status'),
49031
+ fixRequired: v4.z.boolean().optional().describe('Whether the SLI needs attention to register'),
49032
+ pipelineErrors: v4.z.array(v4.z.unknown()).optional().describe('Per-pipeline error details, if any'),
49033
+ defaultGroup: v4.z.boolean().optional().describe('Whether this is a system default group'),
49034
+ });
49035
+
49036
+ /**
49037
+ * Request body for `POST oi/v2/metricconfig/groups/save`. Mirrors the writable
49038
+ * subset of {@link SliGroupSchema} — read-only server fields (creationTime,
49039
+ * createdBy, totalMetrics, …) are not sent.
49040
+ *
49041
+ * `groupId` is the create/update discriminator: present → update that group;
49042
+ * absent → create a new one. `sli import` always omits it so import is
49043
+ * create-only and can never overwrite an existing SLI.
49044
+ */
49045
+ const SliSaveRequestSchema = v4.z.looseObject({
49046
+ type: v4.z.string().describe('Always "sli" for SLIs'),
49047
+ groupName: v4.z.string().describe('SLI name'),
49048
+ description: v4.z.string().nullable().optional().describe('Free-text description'),
49049
+ mgId: v4.z.unknown().nullable().optional().describe('Management-group id; null for SLIs'),
49050
+ filters: v4.z.array(SliFilterSchema).describe('AND-ed metric match criteria'),
49051
+ serviceNames: v4.z.array(v4.z.string()).describe('Service names the SLI binds to'),
49052
+ sliDefinition: v4.z.unknown().describe('Opaque SLI computation spec, round-tripped from the export'),
49053
+ sloDefinition: v4.z.unknown().describe('Opaque SLO computation spec, round-tripped from the export'),
49054
+ alertDefinition: v4.z.unknown().optional().describe('Opaque alert spec; [] when none'),
49055
+ groupId: v4.z
49056
+ .number()
49057
+ .optional()
49058
+ .describe('Omit to create a new SLI; include to update an existing one'),
49059
+ });
49060
+ /**
49061
+ * Response from `POST oi/v2/metricconfig/groups/save`.
49062
+ */
49063
+ const SliSaveResponseSchema = v4.z.looseObject({
49064
+ groupId: v4.z.number().describe('Id of the created/updated SLI'),
49065
+ message: v4.z.array(v4.z.string()).describe('Server status messages'),
49066
+ status: v4.z.string().describe('"Success" on success'),
49067
+ });
49068
+ /**
49069
+ * Projects a read-model {@link SliGroup} onto the writable {@link SliSaveRequest}
49070
+ * subset — dropping the read-only server fields (creationTime, createdBy,
49071
+ * totalMetrics, …) and normalizing `type` (default `'sli'`) and
49072
+ * `alertDefinition` (`null` → `[]`).
49073
+ *
49074
+ * @param group - The source SLI (e.g. from `getSli` or a raw export file).
49075
+ * @param opts.serviceNames - Override the bound services; defaults to the group's.
49076
+ * @param opts.create - When true, omit `groupId` so the save *creates* a new SLI;
49077
+ * otherwise `groupId` is carried through and the save *updates* in place.
49078
+ */
49079
+ function toSliSaveRequest(group, opts = {}) {
49080
+ const body = {
49081
+ type: group.type ?? 'sli',
49082
+ groupName: group.groupName,
49083
+ description: group.description ?? '',
49084
+ mgId: group.mgId ?? null,
49085
+ filters: group.filters,
49086
+ serviceNames: opts.serviceNames ?? group.serviceNames,
49087
+ sliDefinition: group.sliDefinition,
49088
+ sloDefinition: group.sloDefinition,
49089
+ alertDefinition: group.alertDefinition ?? [],
49090
+ };
49091
+ if (!opts.create) {
49092
+ body.groupId = group.groupId;
49093
+ }
49094
+ return body;
49095
+ }
49096
+
49097
+ /**
49098
+ * Request body for `POST oi/v2/metricconfig/groups/search`. Listing SLIs is a
49099
+ * search scoped to `type: "sli"` with a large `pageSize` (the server returns
49100
+ * all matching groups up to that cap).
49101
+ */
49102
+ const SliSearchRequestSchema = v4.z.looseObject({
49103
+ pageSize: v4.z
49104
+ .number()
49105
+ .describe('Max groups to return. Use a large value (e.g. 5000) to list all SLIs'),
49106
+ type: v4.z
49107
+ .string()
49108
+ .describe('Group type to search; "sli" for SLIs'),
49109
+ });
49110
+ /**
49111
+ * Response from `POST oi/v2/metricconfig/groups/search`. The SLIs are in
49112
+ * `sliGroups`; the surrounding fields are tenant-wide metric-config limits.
49113
+ */
49114
+ const SliSearchResponseSchema = v4.z.looseObject({
49115
+ totalGroups: v4.z.number().optional().describe('Number of groups returned in `sliGroups`'),
49116
+ pageSize: v4.z.number().optional().describe('Effective page size applied by the server'),
49117
+ enabledMetrics: v4.z.number().optional().describe('Total metrics enabled across all SLIs'),
49118
+ allowedMetricGroupsPerService: v4.z
49119
+ .number()
49120
+ .optional()
49121
+ .describe('Tenant cap on SLI groups per service'),
49122
+ allowedMetricsPerGroup: v4.z
49123
+ .number()
49124
+ .optional()
49125
+ .describe('Tenant cap on metrics per SLI group'),
49126
+ sliGroups: v4.z
49127
+ .array(SliGroupSchema)
49128
+ .describe('The SLI groups matching the search'),
49129
+ });
49130
+
48653
49131
  exports.TAS = void 0;
48654
49132
  (function (TAS) {
48655
49133
  /** @internal */
@@ -74168,6 +74646,97 @@ class LogsService {
74168
74646
  }
74169
74647
  }
74170
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
+
74171
74740
  /**
74172
74741
  * Service for management modules (and their calculators): list, create, update,
74173
74742
  * copy, import, delete, and query by ID.
@@ -76119,6 +76688,80 @@ class ServiceService {
76119
76688
  }
76120
76689
  }
76121
76690
 
76691
+ /**
76692
+ * Service for SLIs (Service Level Indicators), modeled by the OI metricconfig
76693
+ * API as metric "groups" of `type: "sli"` under `oi/v2/metricconfig/groups/*`.
76694
+ *
76695
+ * These endpoints require the `x-authorizationview: VIEWALL` header, so this
76696
+ * service uses {@link DxSaasService.oiPost} / {@link DxSaasService.oiGet}
76697
+ * (which inject it) rather than the plain `tenant*` methods.
76698
+ *
76699
+ * Requests are validated against their input schema (throws `ZodError`);
76700
+ * responses are `safeParse`-validated (warn-on-mismatch, raw still returned).
76701
+ * Backs the `sli list` / `sli export` / `sli import` CLI commands.
76702
+ */
76703
+ class SLIService {
76704
+ dxSaasService;
76705
+ log;
76706
+ /**
76707
+ * @param dxSaasService - An authenticated {@link DxSaasService} for the target tenant.
76708
+ * @param log - Logger conforming to {@link SimpleLog} from `@dx-do/util`.
76709
+ */
76710
+ constructor(dxSaasService, log) {
76711
+ this.dxSaasService = dxSaasService;
76712
+ this.log = log;
76713
+ }
76714
+ /**
76715
+ * Lists SLIs via `POST oi/v2/metricconfig/groups/search`.
76716
+ *
76717
+ * @remarks Defaults to `{ pageSize: 5000, type: 'sli' }`; pass a partial
76718
+ * override to change the cap. Response is validated but returned raw on
76719
+ * mismatch.
76720
+ * @throws ZodError if the (merged) request fails schema validation.
76721
+ */
76722
+ async searchSlis(request) {
76723
+ const body = { pageSize: 5000, type: 'sli', ...request };
76724
+ SliSearchRequestSchema.parse(body);
76725
+ const raw = await this.dxSaasService.oiPost('oi/v2/metricconfig/groups/search', body);
76726
+ const result = SliSearchResponseSchema.safeParse(raw);
76727
+ if (!result.success) {
76728
+ this.log.warn('SliSearchResponse validation warning:', result.error.message);
76729
+ }
76730
+ return raw;
76731
+ }
76732
+ /**
76733
+ * Retrieves a single SLI by id via `GET oi/v2/metricconfig/groups?groupId=<id>`.
76734
+ * The returned object is the **raw** group `sli export` writes to disk.
76735
+ *
76736
+ * @remarks Response is validated but returned raw on mismatch.
76737
+ */
76738
+ async getSli(sliId) {
76739
+ const raw = await this.dxSaasService.oiGet('oi/v2/metricconfig/groups', { groupId: sliId });
76740
+ const result = SliGroupSchema.safeParse(raw);
76741
+ if (!result.success) {
76742
+ this.log.warn('SliGroup validation warning:', result.error.message);
76743
+ }
76744
+ return raw;
76745
+ }
76746
+ /**
76747
+ * Creates or updates an SLI via `POST oi/v2/metricconfig/groups/save`. Omit
76748
+ * `groupId` on the body to create; include it to update.
76749
+ *
76750
+ * @remarks Request is validated against {@link SliSaveRequestSchema}
76751
+ * (throws on bad input); response validated but returned raw on mismatch.
76752
+ * @throws ZodError if the request fails schema validation.
76753
+ */
76754
+ async saveSli(body) {
76755
+ SliSaveRequestSchema.parse(body);
76756
+ const raw = await this.dxSaasService.oiPost('oi/v2/metricconfig/groups/save', body);
76757
+ const result = SliSaveResponseSchema.safeParse(raw);
76758
+ if (!result.success) {
76759
+ this.log.warn('SliSaveResponse validation warning:', result.error.message);
76760
+ }
76761
+ return raw;
76762
+ }
76763
+ }
76764
+
76122
76765
  /**
76123
76766
  * Service for cluster/situation alarms: search, overview, lifecycle, inspection,
76124
76767
  * and triggering notifications for situations.
@@ -78087,6 +78730,7 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
78087
78730
  dxInventoryService: new InventoryService(dxSaaSService, dxNASSService, dxTASService, log),
78088
78731
  dxJSExtensionService: new JsExtensionService(dxSaaSService),
78089
78732
  dxLogsService: new LogsService(dxSaaSService),
78733
+ dxMaintenanceService: new MaintenanceService(dxSaaSService, log),
78090
78734
  dxManagementModuleService: dxManagementModuleService,
78091
78735
  dxMetricBatchService: new MetricBatchService(dxSaaSService),
78092
78736
  dxMetricGroupingService: new MetricGroupingService(dxSaaSService, dxManagementModuleService),
@@ -78103,6 +78747,7 @@ function createServiceMonolith(dxDoConfiguration, log = new NullSimpleLog()) {
78103
78747
  dxServiceService: new ServiceService(dxSaaSService, log),
78104
78748
  dxSessionService: new SessionService(dxSaaSService),
78105
78749
  dxSituationService: new SituationService(dxSaaSService, log),
78750
+ dxSLIService: new SLIService(dxSaaSService, log),
78106
78751
  dxSQLService: new SQLService(dxSaaSService),
78107
78752
  dxStatesService: new DataStoreStatesService(dxSaaSService, log),
78108
78753
  dxTASService,
@@ -78209,6 +78854,24 @@ exports.LogsService = LogsService;
78209
78854
  exports.METRIC_TYPE_ENUM = METRIC_TYPE_ENUM;
78210
78855
  exports.METRIC_TYPE_ENUM_NAMES = METRIC_TYPE_ENUM_NAMES;
78211
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;
78212
78875
  exports.ManagementModuleIdSchema = ManagementModuleIdSchema;
78213
78876
  exports.ManagementModuleService = ManagementModuleService;
78214
78877
  exports.MetadataMetricQueryResponseV2Schema = MetadataMetricQueryResponseV2Schema;
@@ -78259,12 +78922,20 @@ exports.QueryRequestSchema = QueryRequestSchema;
78259
78922
  exports.QueryResultSchema = QueryResultSchema;
78260
78923
  exports.QuerySpecSpecifierSchema = QuerySpecSpecifierSchema;
78261
78924
  exports.QuerySpecifierSchema = QuerySpecifierSchema;
78925
+ exports.RecurrencePattern = RecurrencePattern;
78926
+ exports.SLIService = SLIService;
78262
78927
  exports.SQLService = SQLService;
78263
78928
  exports.ServiceFilterSpecifierSchema = ServiceFilterSpecifierSchema;
78264
78929
  exports.ServiceService = ServiceService;
78265
78930
  exports.SessionService = SessionService;
78266
78931
  exports.SimpleHTTPError = SimpleHTTPError;
78267
78932
  exports.SituationService = SituationService;
78933
+ exports.SliFilterSchema = SliFilterSchema;
78934
+ exports.SliGroupSchema = SliGroupSchema;
78935
+ exports.SliSaveRequestSchema = SliSaveRequestSchema;
78936
+ exports.SliSaveResponseSchema = SliSaveResponseSchema;
78937
+ exports.SliSearchRequestSchema = SliSearchRequestSchema;
78938
+ exports.SliSearchResponseSchema = SliSearchResponseSchema;
78268
78939
  exports.SourceNameAllSpecifierSchema = SourceNameAllSpecifierSchema;
78269
78940
  exports.SourceNameAndSpecifierSchema = SourceNameAndSpecifierSchema;
78270
78941
  exports.SourceNameExactSpecifierSchema = SourceNameExactSpecifierSchema;
@@ -78406,6 +79077,7 @@ exports.logGet = logGet;
78406
79077
  exports.logGetEvent = logGetEvent;
78407
79078
  exports.maintenanceDelete = maintenanceDelete;
78408
79079
  exports.maintenanceDeleteWindows = maintenanceDeleteWindows;
79080
+ exports.maintenanceFilter = maintenanceFilter;
78409
79081
  exports.maintenanceGet = maintenanceGet;
78410
79082
  exports.maintenanceGetDetail = maintenanceGetDetail;
78411
79083
  exports.maintenanceGetWindows = maintenanceGetWindows;
@@ -78462,6 +79134,7 @@ exports.statistic = statistic;
78462
79134
  exports.summarizeDataStoreSchema = summarizeDataStoreSchema;
78463
79135
  exports.tagsGetAll = tagsGetAll;
78464
79136
  exports.timezonesList = timezonesList;
79137
+ exports.toSliSaveRequest = toSliSaveRequest;
78465
79138
  exports.userBlockDelete = userBlockDelete;
78466
79139
  exports.userBlockPut = userBlockPut;
78467
79140
  exports.userDelete = userDelete;