|
| 1 | +import type { |
| 2 | + LeaseRequestInput, |
| 3 | + LeaseRequestStatus, |
| 4 | + ManagedIdentityRef, |
| 5 | + ManagedLease, |
| 6 | + ManagedShapeRequest, |
| 7 | +} from '@agent-device/contracts/managed-device-allocation'; |
| 8 | + |
| 9 | +/** |
| 10 | + * The grant shapes the daemon-side managed admission is written against, stated in contract terms |
| 11 | + * only. `@agent-device/managed-allocation` keeps its own copy for the package's tests |
| 12 | + * (`packages/managed-allocation/src/__tests__/fixtures.ts`), the same way both sides keep their own |
| 13 | + * `managed-device-allocator.fixtures.ts`: neither tree reaches past the other's exported surface |
| 14 | + * for test data. |
| 15 | + */ |
| 16 | +const ALLOCATION_SHAPE: ManagedShapeRequest = { |
| 17 | + platform: 'ios', |
| 18 | + deviceType: 'iPhone 16', |
| 19 | + osVersion: '18.2', |
| 20 | +}; |
| 21 | + |
| 22 | +const ALLOCATION_IDENTITY: ManagedIdentityRef = { |
| 23 | + deviceId: 'device-1', |
| 24 | + identityIncarnationId: 'incarnation-1', |
| 25 | +}; |
| 26 | + |
| 27 | +export const ALLOCATION_LEASE: ManagedLease = { |
| 28 | + id: 'lease-1', |
| 29 | + ttlDeadline: 1_700_000_900_000, |
| 30 | + device: { address: ALLOCATION_IDENTITY.deviceId }, |
| 31 | + environment: { SIMLOCK_IOS_DEVICE_SET: '/managed/set' }, |
| 32 | +}; |
| 33 | + |
| 34 | +export const ALLOCATION_REQUEST: LeaseRequestInput = { |
| 35 | + requesterId: 'requester-a', |
| 36 | + requestGeneration: 1, |
| 37 | + attemptKey: 'attempt-1', |
| 38 | + shape: ALLOCATION_SHAPE, |
| 39 | + deadlineAtMs: 1_700_000_600_000, |
| 40 | + admission: 'fail-fast', |
| 41 | + activation: 'direct', |
| 42 | + attribution: { tenantId: 'tenant-a' }, |
| 43 | +}; |
| 44 | + |
| 45 | +export const ALLOCATION_GRANTED_STATUS: LeaseRequestStatus = { |
| 46 | + requesterId: ALLOCATION_REQUEST.requesterId, |
| 47 | + requestGeneration: ALLOCATION_REQUEST.requestGeneration, |
| 48 | + attemptKey: ALLOCATION_REQUEST.attemptKey, |
| 49 | + identityIncarnationId: ALLOCATION_IDENTITY.identityIncarnationId, |
| 50 | + state: 'granted', |
| 51 | + lease: ALLOCATION_LEASE, |
| 52 | +}; |
0 commit comments