Skip to content

Commit c0df0fb

Browse files
authored
Update to latest API event types (#325)
1 parent 70a520c commit c0df0fb

11 files changed

Lines changed: 196 additions & 4 deletions

libs/i18n/locales/en/translation.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,14 @@
328328
"{{ resourceType }} could not be deleted": "{{ resourceType }} could not be deleted",
329329
"{{ resourceType }} was updated successfully": "{{ resourceType }} was updated successfully",
330330
"{{ resourceType }} could not be updated": "{{ resourceType }} could not be updated",
331+
"Git resource change detected": "Git resource change detected",
331332
"Device decommissioned successfully": "Device decommissioned successfully",
332333
"Device could not be decommissioned": "Device could not be decommissioned",
333334
"CPU utilization has returned to normal": "CPU utilization has returned to normal",
334335
"CPU utilization has reached a warning level": "CPU utilization has reached a warning level",
335336
"CPU utilization has reached a critical level": "CPU utilization has reached a critical level",
336337
"Memory utilization has returned to normal": "Memory utilization has returned to normal",
337-
"Memory utilization has reached a warning level ": "Memory utilization has reached a warning level ",
338+
"Memory utilization has reached a warning level": "Memory utilization has reached a warning level",
338339
"Memory utilization has reached a critical level": "Memory utilization has reached a critical level",
339340
"Disk utilization has returned to normal": "Disk utilization has returned to normal",
340341
"Disk utilization has reached a warning level": "Disk utilization has reached a warning level",
@@ -347,6 +348,19 @@
347348
"Device returned to being up-to-date": "Device returned to being up-to-date",
348349
"Device is updating": "Device is updating",
349350
"Device is out-of-date": "Device is out-of-date",
351+
"Detected device ownership conflict": "Detected device ownership conflict",
352+
"Device ownership conflict has been resolved": "Device ownership conflict has been resolved",
353+
"Device specification has returned to a valid state": "Device specification has returned to a valid state",
354+
"Device specification is invalid": "Device specification is invalid",
355+
"Device ownership changed": "Device ownership changed",
356+
"Enrollment request was approved": "Enrollment request was approved",
357+
"Enrollment request approval failed": "Enrollment request approval failed",
358+
"Internal task failed": "Internal task failed",
359+
"Repository is accessible": "Repository is accessible",
360+
"Repository is inaccessible": "Repository is inaccessible",
361+
"Fleet selector processing completed": "Fleet selector processing completed",
362+
"Fleet reconciled": "Fleet reconciled",
363+
"Fleet reconciliation failed": "Fleet reconciliation failed",
350364
"Resource": "Resource",
351365
"Review": "Review",
352366
"Review and create": "Review and create",

libs/types/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ export { DeviceLifecycleHookType } from './models/DeviceLifecycleHookType';
4040
export type { DeviceLifecycleStatus } from './models/DeviceLifecycleStatus';
4141
export { DeviceLifecycleStatusType } from './models/DeviceLifecycleStatusType';
4242
export type { DeviceList } from './models/DeviceList';
43+
export type { DeviceMultipleOwnersDetectedDetails } from './models/DeviceMultipleOwnersDetectedDetails';
44+
export { DeviceMultipleOwnersResolvedDetails } from './models/DeviceMultipleOwnersResolvedDetails';
4345
export type { DeviceOsSpec } from './models/DeviceOsSpec';
4446
export type { DeviceOsStatus } from './models/DeviceOsStatus';
47+
export type { DeviceOwnershipChangedDetails } from './models/DeviceOwnershipChangedDetails';
4548
export type { DeviceResourceStatus } from './models/DeviceResourceStatus';
4649
export { DeviceResourceStatusType } from './models/DeviceResourceStatusType';
4750
export type { DeviceSpec } from './models/DeviceSpec';
@@ -78,6 +81,7 @@ export type { FileSpec } from './models/FileSpec';
7881
export type { Fleet } from './models/Fleet';
7982
export type { FleetList } from './models/FleetList';
8083
export type { FleetRolloutStatus } from './models/FleetRolloutStatus';
84+
export { FleetSelectorProcessingCompletedDetails } from './models/FleetSelectorProcessingCompletedDetails';
8185
export type { FleetSpec } from './models/FleetSpec';
8286
export type { FleetStatus } from './models/FleetStatus';
8387
export type { GenericRepoSpec } from './models/GenericRepoSpec';
@@ -96,6 +100,7 @@ export type { ImageVolumeProviderSpec } from './models/ImageVolumeProviderSpec';
96100
export type { ImageVolumeSource } from './models/ImageVolumeSource';
97101
export type { InlineApplicationProviderSpec } from './models/InlineApplicationProviderSpec';
98102
export type { InlineConfigProviderSpec } from './models/InlineConfigProviderSpec';
103+
export type { InternalTaskFailedDetails } from './models/InternalTaskFailedDetails';
99104
export type { KubernetesSecretProviderSpec } from './models/KubernetesSecretProviderSpec';
100105
export type { LabelList } from './models/LabelList';
101106
export type { LabelSelector } from './models/LabelSelector';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
export type DeviceMultipleOwnersDetectedDetails = {
6+
/**
7+
* The type of detail for discriminator purposes.
8+
*/
9+
detailType: 'DeviceMultipleOwnersDetected';
10+
/**
11+
* List of fleet names that match the device.
12+
*/
13+
matchingFleets: Array<string>;
14+
};
15+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
export type DeviceMultipleOwnersResolvedDetails = {
6+
/**
7+
* The type of detail for discriminator purposes.
8+
*/
9+
detailType: 'DeviceMultipleOwnersResolved';
10+
/**
11+
* How the conflict was resolved.
12+
*/
13+
resolutionType: DeviceMultipleOwnersResolvedDetails.resolutionType;
14+
/**
15+
* The fleet assigned as owner (null if no owner).
16+
*/
17+
assignedOwner?: string | null;
18+
/**
19+
* List of fleets that previously matched the device.
20+
*/
21+
previousMatchingFleets?: Array<string>;
22+
};
23+
export namespace DeviceMultipleOwnersResolvedDetails {
24+
/**
25+
* How the conflict was resolved.
26+
*/
27+
export enum resolutionType {
28+
SINGLE_MATCH = 'SingleMatch',
29+
NO_MATCH = 'NoMatch',
30+
FLEET_DELETED = 'FleetDeleted',
31+
}
32+
}
33+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
export type DeviceOwnershipChangedDetails = {
6+
/**
7+
* The type of detail for discriminator purposes.
8+
*/
9+
detailType: 'DeviceOwnershipChanged';
10+
/**
11+
* The previous owner fleet (null if none).
12+
*/
13+
previousOwner?: string | null;
14+
/**
15+
* The new owner fleet (null if removed).
16+
*/
17+
newOwner?: string | null;
18+
};
19+

libs/types/models/Event.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export namespace Event {
4747
RESOURCE_UPDATE_FAILED = 'ResourceUpdateFailed',
4848
RESOURCE_DELETED = 'ResourceDeleted',
4949
RESOURCE_DELETION_FAILED = 'ResourceDeletionFailed',
50+
GIT_RESOURCE_CHANGE_DETECTED = 'GitResourceChangeDetected',
5051
DEVICE_DECOMMISSIONED = 'DeviceDecommissioned',
5152
DEVICE_DECOMMISSION_FAILED = 'DeviceDecommissionFailed',
5253
DEVICE_CPUCRITICAL = 'DeviceCPUCritical',
@@ -66,6 +67,19 @@ export namespace Event {
6667
DEVICE_CONTENT_UP_TO_DATE = 'DeviceContentUpToDate',
6768
DEVICE_CONTENT_OUT_OF_DATE = 'DeviceContentOutOfDate',
6869
DEVICE_CONTENT_UPDATING = 'DeviceContentUpdating',
70+
ENROLLMENT_REQUEST_APPROVED = 'EnrollmentRequestApproved',
71+
ENROLLMENT_REQUEST_APPROVAL_FAILED = 'EnrollmentRequestApprovalFailed',
72+
DEVICE_OWNERSHIP_CHANGED = 'DeviceOwnershipChanged',
73+
DEVICE_MULTIPLE_OWNERS_DETECTED = 'DeviceMultipleOwnersDetected',
74+
DEVICE_MULTIPLE_OWNERS_RESOLVED = 'DeviceMultipleOwnersResolved',
75+
DEVICE_SPEC_VALID = 'DeviceSpecValid',
76+
DEVICE_SPEC_INVALID = 'DeviceSpecInvalid',
77+
INTERNAL_TASK_FAILED = 'InternalTaskFailed',
78+
FLEET_SELECTOR_PROCESSING_COMPLETED = 'FleetSelectorProcessingCompleted',
79+
FLEET_RECONCILED = 'FleetReconciled',
80+
FLEET_RECONCILE_FAILED = 'FleetReconcileFailed',
81+
REPOSITORY_ACCESSIBLE = 'RepositoryAccessible',
82+
REPOSITORY_INACCESSIBLE = 'RepositoryInaccessible',
6983
}
7084
/**
7185
* The type of the event. One of Normal, Warning.
@@ -75,4 +89,3 @@ export namespace Event {
7589
WARNING = 'Warning',
7690
}
7791
}
78-

libs/types/models/EventDetails.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
/* istanbul ignore file */
33
/* tslint:disable */
44
/* eslint-disable */
5+
import type { DeviceMultipleOwnersDetectedDetails } from './DeviceMultipleOwnersDetectedDetails';
6+
import type { DeviceMultipleOwnersResolvedDetails } from './DeviceMultipleOwnersResolvedDetails';
7+
import type { DeviceOwnershipChangedDetails } from './DeviceOwnershipChangedDetails';
8+
import type { FleetSelectorProcessingCompletedDetails } from './FleetSelectorProcessingCompletedDetails';
9+
import type { InternalTaskFailedDetails } from './InternalTaskFailedDetails';
510
import type { ResourceUpdatedDetails } from './ResourceUpdatedDetails';
611
/**
712
* Event-specific details, structured based on event type.
813
*/
9-
export type EventDetails = ResourceUpdatedDetails;
14+
export type EventDetails = (ResourceUpdatedDetails | DeviceOwnershipChangedDetails | DeviceMultipleOwnersDetectedDetails | DeviceMultipleOwnersResolvedDetails | InternalTaskFailedDetails | FleetSelectorProcessingCompletedDetails);
1015

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
export type FleetSelectorProcessingCompletedDetails = {
6+
/**
7+
* The type of detail for discriminator purposes.
8+
*/
9+
detailType: 'FleetSelectorProcessingCompleted';
10+
/**
11+
* The type of processing that was completed.
12+
*/
13+
processingType: FleetSelectorProcessingCompletedDetails.processingType;
14+
/**
15+
* Number of devices processed.
16+
*/
17+
devicesProcessed: number;
18+
/**
19+
* Number of devices that had processing errors.
20+
*/
21+
devicesWithErrors?: number;
22+
/**
23+
* Duration of the processing operation.
24+
*/
25+
processingDuration?: string;
26+
};
27+
export namespace FleetSelectorProcessingCompletedDetails {
28+
/**
29+
* The type of processing that was completed.
30+
*/
31+
export enum processingType {
32+
SELECTOR_UPDATED = 'SelectorUpdated',
33+
FLEET_DELETED = 'FleetDeleted',
34+
DEVICE_LABELS_UPDATED = 'DeviceLabelsUpdated',
35+
}
36+
}
37+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* generated using openapi-typescript-codegen -- do no edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
export type InternalTaskFailedDetails = {
6+
/**
7+
* The type of detail for discriminator purposes.
8+
*/
9+
detailType: 'InternalTaskFailed';
10+
/**
11+
* The type of internal task that failed.
12+
*/
13+
taskType: string;
14+
/**
15+
* The error message describing the failure.
16+
*/
17+
errorMessage: string;
18+
/**
19+
* Number of times the task has been retried.
20+
*/
21+
retryCount?: number;
22+
/**
23+
* Parameters needed to retry the task.
24+
*/
25+
taskParameters?: Record<string, string>;
26+
};
27+

libs/types/models/ResourceUpdatedDetails.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
/* tslint:disable */
44
/* eslint-disable */
55
export type ResourceUpdatedDetails = {
6+
/**
7+
* The type of detail for discriminator purposes.
8+
*/
9+
detailType: 'ResourceUpdated';
610
/**
711
* List of fields that were updated in the resource.
812
*/

0 commit comments

Comments
 (0)