feat(contracts,automation): add multi-group scopes, SMS macros and operator registry

- Allow scheduled operations to resolve multiple device groups.

- Add reusable SMS time and random-value macros.

- Add China operator PLMN metadata shared by API and UI.
This commit is contained in:
chick
2026-09-07 00:44:33 +08:00
parent 8b7df8cb65
commit 8406f14469
9 changed files with 276 additions and 3 deletions
+5
View File
@@ -34,6 +34,7 @@ export type ScheduleTargetSelector =
| { readonly mode: 'fixed'; readonly instanceIds: readonly string[] }
| { readonly mode: 'tags'; readonly match: 'any' | 'all'; readonly tags: readonly string[] }
| { readonly mode: 'group'; readonly groupId: string }
| { readonly mode: 'groups'; readonly groupIds: readonly string[] }
| { readonly mode: 'all' };
/**
@@ -244,6 +245,10 @@ function targetSelector(value: unknown): ScheduleTargetSelector {
exactKeys(source, new Set(['mode', 'groupId']));
return { mode: 'group', groupId: string(source.groupId, 'groupId', 120) };
}
if (source.mode === 'groups') {
exactKeys(source, new Set(['mode', 'groupIds']));
return { mode: 'groups', groupIds: strings(source.groupIds, 'groupIds', 200) };
}
if (source.mode === 'all') {
exactKeys(source, new Set(['mode']));
return { mode: 'all' };