@devhelm/sdk 0.6.3 → 0.7.2

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.d.ts CHANGED
@@ -2,7 +2,7 @@ export { Devhelm } from './client.js';
2
2
  export type { DevhelmConfig, Page, CursorPage } from './types.js';
3
3
  export { DevhelmApiError, DevhelmAuthError, DevhelmConflictError, DevhelmError, DevhelmNotFoundError, DevhelmRateLimitError, DevhelmServerError, DevhelmTransportError, DevhelmValidationError, } from './errors.js';
4
4
  export type { DevhelmApiErrorOptions, ValidationIssue } from './errors.js';
5
- export type { MonitorDto, IncidentDto, IncidentDetailDto, AlertChannelDto, NotificationPolicyDto, EnvironmentDto, SecretDto, TagDto, ResourceGroupDto, WebhookEndpointDto, ApiKeyDto, ApiKeyCreateResponse, ServiceSubscriptionDto, MonitorVersionDto, CheckResultDto, DashboardOverviewDto, DeployLockDto, AssertionTestResultDto, MonitorTestResultDto, IncidentTimelineDto, CheckTraceDto, PolicySnapshotDto, RuleEvaluationDto, IncidentStateTransitionDto, CreateMonitorRequest, UpdateMonitorRequest, CreateManualIncidentRequest, ResolveIncidentRequest, CreateAlertChannelRequest, UpdateAlertChannelRequest, CreateNotificationPolicyRequest, UpdateNotificationPolicyRequest, CreateEnvironmentRequest, UpdateEnvironmentRequest, CreateSecretRequest, UpdateSecretRequest, CreateTagRequest, UpdateTagRequest, CreateResourceGroupRequest, UpdateResourceGroupRequest, AddResourceGroupMemberRequest, CreateWebhookEndpointRequest, UpdateWebhookEndpointRequest, CreateApiKeyRequest, AcquireDeployLockRequest, StatusPageDto, StatusPageComponentDto, StatusPageComponentGroupDto, StatusPageIncidentDto, StatusPageIncidentUpdateDto, StatusPageIncidentComponentDto, StatusPageSubscriberDto, StatusPageCustomDomainDto, StatusPageBranding, CreateStatusPageRequest, UpdateStatusPageRequest, CreateStatusPageComponentRequest, UpdateStatusPageComponentRequest, CreateStatusPageComponentGroupRequest, UpdateStatusPageComponentGroupRequest, CreateStatusPageIncidentRequest, UpdateStatusPageIncidentRequest, CreateStatusPageIncidentUpdateRequest, AddCustomDomainRequest, AdminAddSubscriberRequest, PublishStatusPageIncidentRequest, ReorderComponentsRequest, ReorderPageLayoutRequest, ComponentPosition, AffectedComponent, TestChannelResult, WebhookTestResult, } from './types.js';
5
+ export type { MonitorDto, IncidentDto, IncidentDetailDto, AlertChannelDto, NotificationPolicyDto, EnvironmentDto, SecretDto, TagDto, ResourceGroupDto, WebhookEndpointDto, ApiKeyDto, ApiKeyCreateResponse, ServiceSubscriptionDto, MonitorVersionDto, CheckResultDto, DashboardOverviewDto, DeployLockDto, AssertionTestResultDto, MonitorTestResultDto, MaintenanceWindowDto, IncidentTimelineDto, CheckTraceDto, PolicySnapshotDto, RuleEvaluationDto, IncidentStateTransitionDto, CreateMonitorRequest, UpdateMonitorRequest, CreateManualIncidentRequest, ResolveIncidentRequest, CreateAlertChannelRequest, UpdateAlertChannelRequest, CreateNotificationPolicyRequest, UpdateNotificationPolicyRequest, CreateEnvironmentRequest, UpdateEnvironmentRequest, CreateSecretRequest, UpdateSecretRequest, CreateTagRequest, UpdateTagRequest, CreateResourceGroupRequest, UpdateResourceGroupRequest, AddResourceGroupMemberRequest, CreateWebhookEndpointRequest, UpdateWebhookEndpointRequest, CreateApiKeyRequest, AcquireDeployLockRequest, CreateMaintenanceWindowRequest, UpdateMaintenanceWindowRequest, StatusPageDto, StatusPageComponentDto, StatusPageComponentGroupDto, StatusPageIncidentDto, StatusPageIncidentUpdateDto, StatusPageIncidentComponentDto, StatusPageSubscriberDto, StatusPageCustomDomainDto, StatusPageBranding, CreateStatusPageRequest, UpdateStatusPageRequest, CreateStatusPageComponentRequest, UpdateStatusPageComponentRequest, CreateStatusPageComponentGroupRequest, UpdateStatusPageComponentGroupRequest, CreateStatusPageIncidentRequest, UpdateStatusPageIncidentRequest, CreateStatusPageIncidentUpdateRequest, AddCustomDomainRequest, AdminAddSubscriberRequest, PublishStatusPageIncidentRequest, ReorderComponentsRequest, ReorderPageLayoutRequest, ComponentPosition, AffectedComponent, TestChannelResult, WebhookTestResult, } from './types.js';
6
6
  export * as schemas from './schemas.js';
7
7
  export { Monitors } from './resources/monitors.js';
8
8
  export { Incidents } from './resources/incidents.js';
@@ -20,4 +20,6 @@ export { Dependencies } from './resources/dependencies.js';
20
20
  export { DeployLock } from './resources/deploy-lock.js';
21
21
  export { Status } from './resources/status.js';
22
22
  export { StatusPages } from './resources/status-pages.js';
23
+ export { MaintenanceWindows } from './resources/maintenance-windows.js';
24
+ export type { MaintenanceWindowFilters } from './resources/maintenance-windows.js';
23
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAA;AACnC,YAAY,EAAC,aAAa,EAAE,IAAI,EAAE,UAAU,EAAC,MAAM,YAAY,CAAA;AAC/D,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAC,sBAAsB,EAAE,eAAe,EAAC,MAAM,aAAa,CAAA;AAGxE,YAAY,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,E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AC,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAA;AACrE,YAAY,EAAC,wBAAwB,EAAC,MAAM,oCAAoC,CAAA"}
package/dist/index.js CHANGED
@@ -18,4 +18,5 @@ export { Dependencies } from './resources/dependencies.js';
18
18
  export { DeployLock } from './resources/deploy-lock.js';
19
19
  export { Status } from './resources/status.js';
20
20
  export { StatusPages } from './resources/status-pages.js';
21
+ export { MaintenanceWindows } from './resources/maintenance-windows.js';
21
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAA;AAEnC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,aAAa,CAAA;AA+EpB,kEAAkE;AAClE,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC,qEAAqE;AACrE,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAA;AAElD,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,sCAAsC,CAAA;AACzE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,C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O,EAAC,cAAc,EAAC,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAC,OAAO,EAAC,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAC,WAAW,EAAC,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAA"}
@@ -0,0 +1,94 @@
1
+ import type { ApiClient } from '../http.js';
2
+ import type { MaintenanceWindowDto, CreateMaintenanceWindowRequest, UpdateMaintenanceWindowRequest, Page } from '../types.js';
3
+ /**
4
+ * Filters for listing maintenance windows.
5
+ *
6
+ * - `monitorId` scopes results to a single monitor.
7
+ * - `filter` is a server-side status bucket: `"active"` for windows currently
8
+ * in progress, `"upcoming"` for windows whose `startsAt` is in the future.
9
+ * Omit to return every window in the org regardless of status.
10
+ */
11
+ export interface MaintenanceWindowFilters {
12
+ monitorId?: string;
13
+ filter?: 'active' | 'upcoming';
14
+ }
15
+ /**
16
+ * Schedule planned downtime so DevHelm suppresses alerts during the window.
17
+ *
18
+ * Maintenance windows are scoped to a single monitor (set `monitorId`) or
19
+ * org-wide (leave `monitorId` unset / `null`). Recurring windows are
20
+ * expressed via an iCal RRULE in `repeatRule`.
21
+ */
22
+ export declare class MaintenanceWindows {
23
+ private readonly client;
24
+ constructor(client: ApiClient);
25
+ /**
26
+ * List maintenance windows for the calling org. Auto-paginates through
27
+ * every page so callers receive the full set in a single array.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const windows = await client.maintenanceWindows.list({filter: 'upcoming'})
32
+ * ```
33
+ */
34
+ list(filters?: MaintenanceWindowFilters): Promise<MaintenanceWindowDto[]>;
35
+ /**
36
+ * List maintenance windows with manual page control. Useful for callers
37
+ * that render large windows in a paginated UI.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const page = await client.maintenanceWindows.listPage(0, 50)
42
+ * ```
43
+ */
44
+ listPage(page: number, size: number, filters?: MaintenanceWindowFilters): Promise<Page<MaintenanceWindowDto>>;
45
+ /**
46
+ * Fetch a single maintenance window by UUID.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const window = await client.maintenanceWindows.get(id)
51
+ * ```
52
+ */
53
+ get(id: string): Promise<MaintenanceWindowDto>;
54
+ /**
55
+ * Schedule a new maintenance window. Set `monitorId` to `null` (or omit it)
56
+ * to create an org-wide window that suppresses every monitor's alerts.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const window = await client.maintenanceWindows.create({
61
+ * monitorId: '6f1a...',
62
+ * startsAt: '2026-06-01T03:00:00Z',
63
+ * endsAt: '2026-06-01T04:00:00Z',
64
+ * reason: 'Quarterly db migration',
65
+ * })
66
+ * ```
67
+ */
68
+ create(body: CreateMaintenanceWindowRequest): Promise<MaintenanceWindowDto>;
69
+ /**
70
+ * Update an existing maintenance window — adjust the start/end, swap the
71
+ * monitor it covers, or change the recurrence rule.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * await client.maintenanceWindows.update(id, {
76
+ * startsAt: '2026-06-01T04:00:00Z',
77
+ * endsAt: '2026-06-01T05:00:00Z',
78
+ * })
79
+ * ```
80
+ */
81
+ update(id: string, body: UpdateMaintenanceWindowRequest): Promise<MaintenanceWindowDto>;
82
+ /**
83
+ * Cancel (delete) a maintenance window. After this call, alerts will fire
84
+ * normally for the affected monitor — even if the window's `endsAt` is
85
+ * still in the future.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * await client.maintenanceWindows.cancel(id)
90
+ * ```
91
+ */
92
+ cancel(id: string): Promise<void>;
93
+ }
94
+ //# sourceMappingURL=maintenance-windows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maintenance-windows.d.ts","sourceRoot":"","sources":["../../src/resources/maintenance-windows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EACV,oBAAoB,EACpB,8BAA8B,EAC9B,8BAA8B,EAC9B,IAAI,EACL,MAAM,aAAa,CAAA;AASpB;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;CAC/B;AAED;;;;;;GAMG;AACH,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,SAAS;IAE9C;;;;;;;;OAQG;IACG,IAAI,CAAC,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAmBnF;;;;;;;;OAQG;IACG,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAgBtC;;;;;;;OAOG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIpD;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAKjF;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAK7F;;;;;;;;;OASG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
@@ -0,0 +1,130 @@
1
+ import { MaintenanceWindowDtoSchema, CreateMaintenanceWindowRequestSchema, UpdateMaintenanceWindowRequestSchema, } from '../schemas.js';
2
+ import { apiGet, fetchSingle, fetchVoid } from '../http.js';
3
+ import { parsePage, validateRequest } from '../validation.js';
4
+ /**
5
+ * Schedule planned downtime so DevHelm suppresses alerts during the window.
6
+ *
7
+ * Maintenance windows are scoped to a single monitor (set `monitorId`) or
8
+ * org-wide (leave `monitorId` unset / `null`). Recurring windows are
9
+ * expressed via an iCal RRULE in `repeatRule`.
10
+ */
11
+ export class MaintenanceWindows {
12
+ client;
13
+ constructor(client) {
14
+ this.client = client;
15
+ }
16
+ /**
17
+ * List maintenance windows for the calling org. Auto-paginates through
18
+ * every page so callers receive the full set in a single array.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const windows = await client.maintenanceWindows.list({filter: 'upcoming'})
23
+ * ```
24
+ */
25
+ async list(filters = {}) {
26
+ const path = '/api/v1/maintenance-windows';
27
+ const baseQuery = {};
28
+ if (filters.monitorId !== undefined)
29
+ baseQuery['monitorId'] = filters.monitorId;
30
+ if (filters.filter !== undefined)
31
+ baseQuery['filter'] = filters.filter;
32
+ const all = [];
33
+ let page = 0;
34
+ const size = 200;
35
+ while (true) {
36
+ const raw = await apiGet(this.client, path, { ...baseQuery, page, size });
37
+ const validated = parsePage(MaintenanceWindowDtoSchema, raw, path);
38
+ all.push(...validated.data);
39
+ if (!validated.hasNext)
40
+ break;
41
+ page++;
42
+ }
43
+ return all;
44
+ }
45
+ /**
46
+ * List maintenance windows with manual page control. Useful for callers
47
+ * that render large windows in a paginated UI.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const page = await client.maintenanceWindows.listPage(0, 50)
52
+ * ```
53
+ */
54
+ async listPage(page, size, filters = {}) {
55
+ const path = '/api/v1/maintenance-windows';
56
+ const query = { page, size };
57
+ if (filters.monitorId !== undefined)
58
+ query['monitorId'] = filters.monitorId;
59
+ if (filters.filter !== undefined)
60
+ query['filter'] = filters.filter;
61
+ const raw = await apiGet(this.client, path, query);
62
+ const validated = parsePage(MaintenanceWindowDtoSchema, raw, path);
63
+ return {
64
+ data: validated.data,
65
+ hasNext: validated.hasNext,
66
+ hasPrev: validated.hasPrev,
67
+ totalElements: validated.totalElements ?? null,
68
+ totalPages: validated.totalPages ?? null,
69
+ };
70
+ }
71
+ /**
72
+ * Fetch a single maintenance window by UUID.
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * const window = await client.maintenanceWindows.get(id)
77
+ * ```
78
+ */
79
+ async get(id) {
80
+ return fetchSingle(this.client, 'GET', `/api/v1/maintenance-windows/${id}`, MaintenanceWindowDtoSchema);
81
+ }
82
+ /**
83
+ * Schedule a new maintenance window. Set `monitorId` to `null` (or omit it)
84
+ * to create an org-wide window that suppresses every monitor's alerts.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const window = await client.maintenanceWindows.create({
89
+ * monitorId: '6f1a...',
90
+ * startsAt: '2026-06-01T03:00:00Z',
91
+ * endsAt: '2026-06-01T04:00:00Z',
92
+ * reason: 'Quarterly db migration',
93
+ * })
94
+ * ```
95
+ */
96
+ async create(body) {
97
+ validateRequest(CreateMaintenanceWindowRequestSchema, body, 'maintenanceWindows.create');
98
+ return fetchSingle(this.client, 'POST', '/api/v1/maintenance-windows', MaintenanceWindowDtoSchema, body);
99
+ }
100
+ /**
101
+ * Update an existing maintenance window — adjust the start/end, swap the
102
+ * monitor it covers, or change the recurrence rule.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * await client.maintenanceWindows.update(id, {
107
+ * startsAt: '2026-06-01T04:00:00Z',
108
+ * endsAt: '2026-06-01T05:00:00Z',
109
+ * })
110
+ * ```
111
+ */
112
+ async update(id, body) {
113
+ validateRequest(UpdateMaintenanceWindowRequestSchema, body, 'maintenanceWindows.update');
114
+ return fetchSingle(this.client, 'PUT', `/api/v1/maintenance-windows/${id}`, MaintenanceWindowDtoSchema, body);
115
+ }
116
+ /**
117
+ * Cancel (delete) a maintenance window. After this call, alerts will fire
118
+ * normally for the affected monitor — even if the window's `endsAt` is
119
+ * still in the future.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * await client.maintenanceWindows.cancel(id)
124
+ * ```
125
+ */
126
+ async cancel(id) {
127
+ return fetchVoid(this.client, `/api/v1/maintenance-windows/${id}`);
128
+ }
129
+ }
130
+ //# sourceMappingURL=maintenance-windows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maintenance-windows.js","sourceRoot":"","sources":["../../src/resources/maintenance-windows.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,oCAAoC,GACrC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,YAAY,CAAA;AACzD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAA;AAe3D;;;;;;GAMG;AACH,MAAM,OAAO,kBAAkB;IACA;IAA7B,YAA6B,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;IAAG,CAAC;IAElD;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CAAC,UAAoC,EAAE;QAC/C,MAAM,IAAI,GAAG,6BAA6B,CAAA;QAC1C,MAAM,SAAS,GAA4B,EAAE,CAAA;QAC7C,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;YAAE,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,SAAS,CAAA;QAC/E,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;YAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAA;QAEtE,MAAM,GAAG,GAA2B,EAAE,CAAA;QACtC,IAAI,IAAI,GAAG,CAAC,CAAA;QACZ,MAAM,IAAI,GAAG,GAAG,CAAA;QAChB,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,EAAC,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAA;YACvE,MAAM,SAAS,GAAG,SAAS,CAAC,0BAA0B,EAAE,GAAG,EAAE,IAA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