@aeolus-fleet/core 0.33.0 → 0.35.0
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/README.md +29 -4
- package/dist/adapters/cli/fleet-api.d.ts +33 -0
- package/dist/adapters/cli/fleet-api.js +64 -0
- package/dist/adapters/cli/fleet-api.js.map +1 -0
- package/dist/adapters/cli/fleet-recover-keys.d.ts +22 -0
- package/dist/adapters/cli/fleet-recover-keys.js +81 -0
- package/dist/adapters/cli/fleet-recover-keys.js.map +1 -0
- package/dist/adapters/cli/run.js +1 -1
- package/dist/adapters/cli/run.js.map +1 -1
- package/dist/adapters/crypto/age-recovery-identity.d.ts +9 -0
- package/dist/adapters/crypto/age-recovery-identity.js +45 -0
- package/dist/adapters/crypto/age-recovery-identity.js.map +1 -0
- package/dist/adapters/crypto/age-recovery-keys.d.ts +2 -0
- package/dist/adapters/crypto/age-recovery-keys.js +36 -0
- package/dist/adapters/crypto/age-recovery-keys.js.map +1 -0
- package/dist/adapters/crypto/payload-sealer.d.ts +2 -0
- package/dist/adapters/crypto/payload-sealer.js +48 -0
- package/dist/adapters/crypto/payload-sealer.js.map +1 -0
- package/dist/adapters/kms/aws-kms-key-vault.d.ts +13 -0
- package/dist/adapters/kms/aws-kms-key-vault.js +98 -0
- package/dist/adapters/kms/aws-kms-key-vault.js.map +1 -0
- package/dist/adapters/kms/company-key-vault.d.ts +9 -0
- package/dist/adapters/kms/company-key-vault.js +14 -0
- package/dist/adapters/kms/company-key-vault.js.map +1 -0
- package/dist/adapters/kms/no-key-vault.d.ts +7 -0
- package/dist/adapters/kms/no-key-vault.js +11 -0
- package/dist/adapters/kms/no-key-vault.js.map +1 -0
- package/dist/adapters/prisma/alerts.d.ts +21 -0
- package/dist/adapters/prisma/alerts.js +61 -0
- package/dist/adapters/prisma/alerts.js.map +1 -0
- package/dist/adapters/prisma/expectations.d.ts +19 -0
- package/dist/adapters/prisma/expectations.js +46 -0
- package/dist/adapters/prisma/expectations.js.map +1 -0
- package/dist/adapters/prisma/feature-flags.d.ts +7 -0
- package/dist/adapters/prisma/feature-flags.js +29 -0
- package/dist/adapters/prisma/feature-flags.js.map +1 -0
- package/dist/adapters/prisma/generated/browser.d.ts +34 -2
- package/dist/adapters/prisma/generated/client.d.ts +34 -2
- package/dist/adapters/prisma/generated/commonInputTypes.d.ts +217 -97
- package/dist/adapters/prisma/generated/enums.d.ts +12 -0
- package/dist/adapters/prisma/generated/enums.js +10 -0
- package/dist/adapters/prisma/generated/enums.js.map +1 -1
- package/dist/adapters/prisma/generated/internal/class.d.ts +44 -0
- package/dist/adapters/prisma/generated/internal/class.js +4 -4
- package/dist/adapters/prisma/generated/internal/class.js.map +1 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespace.d.ts +399 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespace.js +72 -2
- package/dist/adapters/prisma/generated/internal/prismaNamespace.js.map +1 -1
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.d.ts +74 -0
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js +72 -2
- package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js.map +1 -1
- package/dist/adapters/prisma/generated/models/Alert.d.ts +1527 -0
- package/dist/adapters/prisma/generated/models/Alert.js +2 -0
- package/dist/adapters/prisma/generated/models/Alert.js.map +1 -0
- package/dist/adapters/prisma/generated/models/DataKey.d.ts +1503 -0
- package/dist/adapters/prisma/generated/models/DataKey.js +2 -0
- package/dist/adapters/prisma/generated/models/DataKey.js.map +1 -0
- package/dist/adapters/prisma/generated/models/Fleet.d.ts +3644 -221
- package/dist/adapters/prisma/generated/models/FleetFeatureFlag.d.ts +1117 -0
- package/dist/adapters/prisma/generated/models/FleetFeatureFlag.js +2 -0
- package/dist/adapters/prisma/generated/models/FleetFeatureFlag.js.map +1 -0
- package/dist/adapters/prisma/generated/models/Lease.d.ts +509 -9
- package/dist/adapters/prisma/generated/models/Message.d.ts +729 -63
- package/dist/adapters/prisma/generated/models/MessageDay.d.ts +1 -5
- package/dist/adapters/prisma/generated/models/Schedule.d.ts +657 -50
- package/dist/adapters/prisma/generated/models/Ship.d.ts +939 -4
- package/dist/adapters/prisma/generated/models/ShipExpectations.d.ts +1468 -0
- package/dist/adapters/prisma/generated/models/ShipExpectations.js +2 -0
- package/dist/adapters/prisma/generated/models/ShipExpectations.js.map +1 -0
- package/dist/adapters/prisma/generated/models.d.ts +4 -0
- package/dist/adapters/prisma/history-pruner.js +27 -4
- package/dist/adapters/prisma/history-pruner.js.map +1 -1
- package/dist/adapters/prisma/history.d.ts +2 -2
- package/dist/adapters/prisma/history.js +14 -9
- package/dist/adapters/prisma/history.js.map +1 -1
- package/dist/adapters/prisma/installation.js +14 -3
- package/dist/adapters/prisma/installation.js.map +1 -1
- package/dist/adapters/prisma/messaging.js +5 -3
- package/dist/adapters/prisma/messaging.js.map +1 -1
- package/dist/adapters/prisma/overdue.js +1 -1
- package/dist/adapters/prisma/registry.d.ts +2 -1
- package/dist/adapters/prisma/registry.js +68 -14
- package/dist/adapters/prisma/registry.js.map +1 -1
- package/dist/adapters/prisma/rows.d.ts +14 -0
- package/dist/adapters/prisma/rows.js +65 -6
- package/dist/adapters/prisma/rows.js.map +1 -1
- package/dist/adapters/prisma/schedules.d.ts +3 -0
- package/dist/adapters/prisma/schedules.js +5 -4
- package/dist/adapters/prisma/schedules.js.map +1 -1
- package/dist/adapters/prisma/sealings.d.ts +4 -0
- package/dist/adapters/prisma/sealings.js +211 -0
- package/dist/adapters/prisma/sealings.js.map +1 -0
- package/dist/adapters/prisma/unit-of-work.d.ts +6 -2
- package/dist/adapters/prisma/unit-of-work.js +8 -0
- package/dist/adapters/prisma/unit-of-work.js.map +1 -1
- package/dist/adapters/trpc/alert-output.d.ts +4 -0
- package/dist/adapters/trpc/alert-output.js +15 -0
- package/dist/adapters/trpc/alert-output.js.map +1 -0
- package/dist/adapters/trpc/console.d.ts +13 -1
- package/dist/adapters/trpc/console.js +6 -3
- package/dist/adapters/trpc/console.js.map +1 -1
- package/dist/adapters/trpc/context.d.ts +28 -0
- package/dist/adapters/trpc/fleet.d.ts +626 -5
- package/dist/adapters/trpc/fleet.js +235 -20
- package/dist/adapters/trpc/fleet.js.map +1 -1
- package/dist/adapters/trpc/installation.d.ts +138 -2
- package/dist/adapters/trpc/installation.js +19 -3
- package/dist/adapters/trpc/installation.js.map +1 -1
- package/dist/adapters/trpc/listed-payload.d.ts +9 -0
- package/dist/adapters/trpc/listed-payload.js +8 -0
- package/dist/adapters/trpc/listed-payload.js.map +1 -0
- package/dist/adapters/trpc/router.d.ts +793 -4
- package/dist/adapters/trpc/ship-contract.js +6 -0
- package/dist/adapters/trpc/ship-contract.js.map +1 -1
- package/dist/adapters/trpc/ship-protocol.js +1 -1
- package/dist/adapters/trpc/ship-protocol.js.map +1 -1
- package/dist/adapters/trpc/ship.d.ts +49 -3
- package/dist/adapters/trpc/ship.js +13 -8
- package/dist/adapters/trpc/ship.js.map +1 -1
- package/dist/adapters/trpc/starting-prompt-text.js +2 -1
- package/dist/adapters/trpc/starting-prompt-text.js.map +1 -1
- package/dist/adapters/trpc/system.d.ts +10 -0
- package/dist/adapters/trpc/trpc.d.ts +15 -3
- package/dist/adapters/trpc/trpc.js +35 -6
- package/dist/adapters/trpc/trpc.js.map +1 -1
- package/dist/app.d.ts +3 -0
- package/dist/app.js +11 -1
- package/dist/app.js.map +1 -1
- package/dist/bin/aeolus-core.js +8 -1
- package/dist/bin/aeolus-core.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.js +8 -2
- package/dist/config.js.map +1 -1
- package/dist/domain/messaging/add-to-meeting.d.ts +6 -2
- package/dist/domain/messaging/add-to-meeting.js +7 -4
- package/dist/domain/messaging/add-to-meeting.js.map +1 -1
- package/dist/domain/messaging/change-company-key.d.ts +46 -0
- package/dist/domain/messaging/change-company-key.js +74 -0
- package/dist/domain/messaging/change-company-key.js.map +1 -0
- package/dist/domain/messaging/change-meeting.d.ts +6 -2
- package/dist/domain/messaging/change-meeting.js +6 -4
- package/dist/domain/messaging/change-meeting.js.map +1 -1
- package/dist/domain/messaging/change-mic.d.ts +6 -1
- package/dist/domain/messaging/change-mic.js +6 -3
- package/dist/domain/messaging/change-mic.js.map +1 -1
- package/dist/domain/messaging/change-recovery-key.d.ts +45 -0
- package/dist/domain/messaging/change-recovery-key.js +68 -0
- package/dist/domain/messaging/change-recovery-key.js.map +1 -0
- package/dist/domain/messaging/company-key-check.d.ts +20 -0
- package/dist/domain/messaging/company-key-check.js +31 -0
- package/dist/domain/messaging/company-key-check.js.map +1 -0
- package/dist/domain/messaging/data-keys.d.ts +165 -0
- package/dist/domain/messaging/data-keys.js +275 -0
- package/dist/domain/messaging/data-keys.js.map +1 -0
- package/dist/domain/messaging/fleet-sealing.d.ts +75 -0
- package/dist/domain/messaging/fleet-sealing.js +21 -0
- package/dist/domain/messaging/fleet-sealing.js.map +1 -0
- package/dist/domain/messaging/key-unavailable.d.ts +5 -0
- package/dist/domain/messaging/key-unavailable.js +14 -0
- package/dist/domain/messaging/key-unavailable.js.map +1 -0
- package/dist/domain/messaging/key-vault.d.ts +61 -0
- package/dist/domain/messaging/key-vault.js +2 -0
- package/dist/domain/messaging/key-vault.js.map +1 -0
- package/dist/domain/messaging/meeting-notice.d.ts +15 -13
- package/dist/domain/messaging/meeting-notice.js +12 -3
- package/dist/domain/messaging/meeting-notice.js.map +1 -1
- package/dist/domain/messaging/message.d.ts +22 -5
- package/dist/domain/messaging/message.js +19 -5
- package/dist/domain/messaging/message.js.map +1 -1
- package/dist/domain/messaging/open-meeting.d.ts +8 -2
- package/dist/domain/messaging/open-meeting.js +6 -1
- package/dist/domain/messaging/open-meeting.js.map +1 -1
- package/dist/domain/messaging/overdue.d.ts +4 -1
- package/dist/domain/messaging/overdue.js +3 -3
- package/dist/domain/messaging/overdue.js.map +1 -1
- package/dist/domain/messaging/payload-sealer.d.ts +39 -0
- package/dist/domain/messaging/payload-sealer.js +2 -0
- package/dist/domain/messaging/payload-sealer.js.map +1 -0
- package/dist/domain/messaging/payload.d.ts +1 -1
- package/dist/domain/messaging/payload.js +2 -2
- package/dist/domain/messaging/payload.js.map +1 -1
- package/dist/domain/messaging/ping-ship.d.ts +4 -1
- package/dist/domain/messaging/ping-ship.js +6 -4
- package/dist/domain/messaging/ping-ship.js.map +1 -1
- package/dist/domain/messaging/ports.d.ts +98 -1
- package/dist/domain/messaging/public.d.ts +4 -1
- package/dist/domain/messaging/public.js +2 -0
- package/dist/domain/messaging/public.js.map +1 -1
- package/dist/domain/messaging/push-receive-deliveries.d.ts +4 -0
- package/dist/domain/messaging/push-receive-deliveries.js +8 -2
- package/dist/domain/messaging/push-receive-deliveries.js.map +1 -1
- package/dist/domain/messaging/read-delivery.d.ts +6 -2
- package/dist/domain/messaging/read-delivery.js +7 -4
- package/dist/domain/messaging/read-delivery.js.map +1 -1
- package/dist/domain/messaging/read-meeting.d.ts +9 -3
- package/dist/domain/messaging/read-meeting.js +11 -4
- package/dist/domain/messaging/read-meeting.js.map +1 -1
- package/dist/domain/messaging/read-recovery-set.d.ts +34 -0
- package/dist/domain/messaging/read-recovery-set.js +43 -0
- package/dist/domain/messaging/read-recovery-set.js.map +1 -0
- package/dist/domain/messaging/read-sealing.d.ts +30 -0
- package/dist/domain/messaging/read-sealing.js +28 -0
- package/dist/domain/messaging/read-sealing.js.map +1 -0
- package/dist/domain/messaging/receive-deliveries.d.ts +18 -6
- package/dist/domain/messaging/receive-deliveries.js +18 -6
- package/dist/domain/messaging/receive-deliveries.js.map +1 -1
- package/dist/domain/messaging/receive-reply.d.ts +2 -0
- package/dist/domain/messaging/receive-reply.js +2 -1
- package/dist/domain/messaging/receive-reply.js.map +1 -1
- package/dist/domain/messaging/recover-keys.d.ts +56 -0
- package/dist/domain/messaging/recover-keys.js +83 -0
- package/dist/domain/messaging/recover-keys.js.map +1 -0
- package/dist/domain/messaging/recovery-key.d.ts +25 -0
- package/dist/domain/messaging/recovery-key.js +14 -0
- package/dist/domain/messaging/recovery-key.js.map +1 -0
- package/dist/domain/messaging/reply-to-message.d.ts +2 -0
- package/dist/domain/messaging/reply-to-message.js +4 -3
- package/dist/domain/messaging/reply-to-message.js.map +1 -1
- package/dist/domain/messaging/resend-delivery.d.ts +9 -2
- package/dist/domain/messaging/resend-delivery.js +26 -6
- package/dist/domain/messaging/resend-delivery.js.map +1 -1
- package/dist/domain/messaging/retired-participant.d.ts +5 -2
- package/dist/domain/messaging/retired-participant.js +2 -1
- package/dist/domain/messaging/retired-participant.js.map +1 -1
- package/dist/domain/messaging/rotate-data-keys.d.ts +33 -0
- package/dist/domain/messaging/rotate-data-keys.js +52 -0
- package/dist/domain/messaging/rotate-data-keys.js.map +1 -0
- package/dist/domain/messaging/schedule-message.d.ts +10 -2
- package/dist/domain/messaging/schedule-message.js +43 -15
- package/dist/domain/messaging/schedule-message.js.map +1 -1
- package/dist/domain/messaging/schedule.d.ts +18 -1
- package/dist/domain/messaging/schedule.js +15 -0
- package/dist/domain/messaging/schedule.js.map +1 -1
- package/dist/domain/messaging/seal-stored-payloads.d.ts +45 -0
- package/dist/domain/messaging/seal-stored-payloads.js +122 -0
- package/dist/domain/messaging/seal-stored-payloads.js.map +1 -0
- package/dist/domain/messaging/sealed-payload.d.ts +9 -0
- package/dist/domain/messaging/sealed-payload.js +15 -0
- package/dist/domain/messaging/sealed-payload.js.map +1 -0
- package/dist/domain/messaging/send-due-schedules.d.ts +6 -0
- package/dist/domain/messaging/send-due-schedules.js +63 -16
- package/dist/domain/messaging/send-due-schedules.js.map +1 -1
- package/dist/domain/messaging/send-message.d.ts +21 -7
- package/dist/domain/messaging/send-message.js +52 -19
- package/dist/domain/messaging/send-message.js.map +1 -1
- package/dist/domain/messaging/send-request.d.ts +4 -2
- package/dist/domain/messaging/send-request.js +3 -2
- package/dist/domain/messaging/send-request.js.map +1 -1
- package/dist/domain/messaging/turn-on-sealing.d.ts +61 -0
- package/dist/domain/messaging/turn-on-sealing.js +76 -0
- package/dist/domain/messaging/turn-on-sealing.js.map +1 -0
- package/dist/domain/registry/alert.d.ts +75 -0
- package/dist/domain/registry/alert.js +71 -0
- package/dist/domain/registry/alert.js.map +1 -0
- package/dist/domain/registry/claim-ship.d.ts +2 -1
- package/dist/domain/registry/claim-ship.js +1 -1
- package/dist/domain/registry/claim-ship.js.map +1 -1
- package/dist/domain/registry/clear-alert.d.ts +32 -0
- package/dist/domain/registry/clear-alert.js +40 -0
- package/dist/domain/registry/clear-alert.js.map +1 -0
- package/dist/domain/registry/create-fleet.d.ts +7 -3
- package/dist/domain/registry/create-fleet.js +9 -2
- package/dist/domain/registry/create-fleet.js.map +1 -1
- package/dist/domain/registry/crew-request.d.ts +9 -0
- package/dist/domain/registry/crew-request.js +7 -0
- package/dist/domain/registry/crew-request.js.map +1 -1
- package/dist/domain/registry/expectations.d.ts +68 -0
- package/dist/domain/registry/expectations.js +84 -0
- package/dist/domain/registry/expectations.js.map +1 -0
- package/dist/domain/registry/feature-flag.d.ts +66 -0
- package/dist/domain/registry/feature-flag.js +56 -0
- package/dist/domain/registry/feature-flag.js.map +1 -0
- package/dist/domain/registry/get-ship.d.ts +11 -1
- package/dist/domain/registry/get-ship.js +11 -2
- package/dist/domain/registry/get-ship.js.map +1 -1
- package/dist/domain/registry/installation-fleet.d.ts +3 -1
- package/dist/domain/registry/installation-fleet.js +3 -1
- package/dist/domain/registry/installation-fleet.js.map +1 -1
- package/dist/domain/registry/lease-activity.d.ts +15 -0
- package/dist/domain/registry/lease-activity.js +2 -0
- package/dist/domain/registry/lease-activity.js.map +1 -0
- package/dist/domain/registry/lease.d.ts +2 -2
- package/dist/domain/registry/lease.js +1 -1
- package/dist/domain/registry/list-fleet.d.ts +6 -1
- package/dist/domain/registry/list-fleet.js +5 -3
- package/dist/domain/registry/list-fleet.js.map +1 -1
- package/dist/domain/registry/ports.d.ts +75 -1
- package/dist/domain/registry/public.d.ts +4 -0
- package/dist/domain/registry/public.js +2 -0
- package/dist/domain/registry/public.js.map +1 -1
- package/dist/domain/registry/raise-alert.d.ts +31 -0
- package/dist/domain/registry/raise-alert.js +43 -0
- package/dist/domain/registry/raise-alert.js.map +1 -0
- package/dist/domain/registry/read-feature-flags.d.ts +16 -0
- package/dist/domain/registry/read-feature-flags.js +11 -0
- package/dist/domain/registry/read-feature-flags.js.map +1 -0
- package/dist/domain/registry/read-open-alerts.d.ts +23 -0
- package/dist/domain/registry/read-open-alerts.js +21 -0
- package/dist/domain/registry/read-open-alerts.js.map +1 -0
- package/dist/domain/registry/report-activity.d.ts +41 -0
- package/dist/domain/registry/report-activity.js +43 -0
- package/dist/domain/registry/report-activity.js.map +1 -0
- package/dist/domain/registry/report-step.d.ts +8 -0
- package/dist/domain/registry/report-step.js +16 -0
- package/dist/domain/registry/report-step.js.map +1 -0
- package/dist/domain/registry/report-task.d.ts +14 -0
- package/dist/domain/registry/report-task.js +39 -0
- package/dist/domain/registry/report-task.js.map +1 -0
- package/dist/domain/registry/report.d.ts +2 -2
- package/dist/domain/registry/report.js.map +1 -1
- package/dist/domain/registry/retire-ship.d.ts +12 -4
- package/dist/domain/registry/retire-ship.js +19 -5
- package/dist/domain/registry/retire-ship.js.map +1 -1
- package/dist/domain/registry/set-expectations.d.ts +33 -0
- package/dist/domain/registry/set-expectations.js +47 -0
- package/dist/domain/registry/set-expectations.js.map +1 -0
- package/dist/domain/registry/set-feature-flag.d.ts +34 -0
- package/dist/domain/registry/set-feature-flag.js +37 -0
- package/dist/domain/registry/set-feature-flag.js.map +1 -0
- package/dist/domain/registry/ship-report.d.ts +24 -7
- package/dist/domain/registry/ship-report.js +41 -5
- package/dist/domain/registry/ship-report.js.map +1 -1
- package/dist/domain/registry/ship.d.ts +7 -1
- package/dist/domain/registry/ship.js +3 -0
- package/dist/domain/registry/ship.js.map +1 -1
- package/dist/domain/shared/errors.d.ts +1 -1
- package/dist/domain/shared/errors.js.map +1 -1
- package/dist/domain/shared/history-pruning.d.ts +19 -2
- package/dist/domain/shared/history-pruning.js +1 -1
- package/dist/domain/shared/history-pruning.js.map +1 -1
- package/dist/domain/shared/history.d.ts +24 -22
- package/dist/domain/shared/history.js.map +1 -1
- package/dist/domain/shared/plain-history.d.ts +45 -0
- package/dist/domain/shared/plain-history.js +35 -0
- package/dist/domain/shared/plain-history.js.map +1 -0
- package/dist/domain/shared/prune-history.d.ts +2 -1
- package/dist/domain/shared/prune-history.js +8 -6
- package/dist/domain/shared/prune-history.js.map +1 -1
- package/dist/domain/shared/read-health.d.ts +14 -3
- package/dist/domain/shared/read-health.js +8 -4
- package/dist/domain/shared/read-health.js.map +1 -1
- package/dist/domain/shared/read-inbox-message.d.ts +7 -2
- package/dist/domain/shared/read-inbox-message.js +5 -1
- package/dist/domain/shared/read-inbox-message.js.map +1 -1
- package/dist/domain/shared/read-inbox-withdrawals.d.ts +9 -3
- package/dist/domain/shared/read-inbox-withdrawals.js +7 -3
- package/dist/domain/shared/read-inbox-withdrawals.js.map +1 -1
- package/dist/domain/shared/read-inbox.d.ts +14 -4
- package/dist/domain/shared/read-inbox.js +7 -3
- package/dist/domain/shared/read-inbox.js.map +1 -1
- package/dist/domain/shared/read-message-deliveries.d.ts +2 -1
- package/dist/domain/shared/read-message-deliveries.js +4 -3
- package/dist/domain/shared/read-message-deliveries.js.map +1 -1
- package/dist/domain/shared/read-message.d.ts +13 -3
- package/dist/domain/shared/read-message.js +12 -5
- package/dist/domain/shared/read-message.js.map +1 -1
- package/dist/domain/shared/read-needs-attention.d.ts +6 -2
- package/dist/domain/shared/read-needs-attention.js +7 -5
- package/dist/domain/shared/read-needs-attention.js.map +1 -1
- package/dist/domain/shared/read-report-tasks.d.ts +10 -0
- package/dist/domain/shared/read-report-tasks.js +24 -0
- package/dist/domain/shared/read-report-tasks.js.map +1 -0
- package/dist/domain/shared/read-ship-messages.d.ts +10 -1
- package/dist/domain/shared/read-ship-messages.js +9 -3
- package/dist/domain/shared/read-ship-messages.js.map +1 -1
- package/dist/start.js +2 -0
- package/dist/start.js.map +1 -1
- package/dist/testing/container-images.d.ts +13 -6
- package/dist/testing/container-images.js +14 -7
- package/dist/testing/container-images.js.map +1 -1
- package/dist/wiring.d.ts +38 -0
- package/dist/wiring.js +69 -20
- package/dist/wiring.js.map +1 -1
- package/package.json +4 -2
- package/src/adapters/prisma/migrations/20261029120000_data_keys/migration.sql +23 -0
- package/src/adapters/prisma/migrations/20261029180000_sealed_messages/migration.sql +42 -0
- package/src/adapters/prisma/migrations/20261029200000_sealed_schedules/migration.sql +20 -0
- package/src/adapters/prisma/migrations/20261030090000_key_availability/migration.sql +18 -0
- package/src/adapters/prisma/migrations/20261030120000_keys_scope/migration.sql +64 -0
- package/src/adapters/prisma/migrations/20261031090000_recovery_key/migration.sql +11 -0
- package/src/adapters/prisma/migrations/20261101090000_sealing_progress/migration.sql +16 -0
- package/src/adapters/prisma/migrations/20261102090000_feature_flags/migration.sql +17 -0
- package/src/adapters/prisma/migrations/20261103090000_removed_ships/migration.sql +21 -0
- package/src/adapters/prisma/migrations/20261104090000_report_task_step/migration.sql +10 -0
- package/src/adapters/prisma/migrations/20261105090000_payload_limit_256kb/migration.sql +15 -0
- package/src/adapters/prisma/migrations/20261106090000_lease_activity/migration.sql +11 -0
- package/src/adapters/prisma/migrations/20261107090000_alert_scope/migration.sql +64 -0
- package/src/adapters/prisma/migrations/20261107100000_alerts/migration.sql +33 -0
- package/src/adapters/prisma/migrations/20261108090000_ship_expectations/migration.sql +22 -0
- package/src/adapters/prisma/schema.prisma +210 -46
|
@@ -28,33 +28,49 @@ datasource db {
|
|
|
28
28
|
|
|
29
29
|
/// The tenant: one operator's ships, messages and history. Ids start with flt_.
|
|
30
30
|
model Fleet {
|
|
31
|
-
id String
|
|
31
|
+
id String @id
|
|
32
32
|
name String
|
|
33
|
-
createdAt DateTime
|
|
33
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
34
34
|
/// The sequence number of the fleet's last committed event. A unit of work
|
|
35
35
|
/// takes its numbers from it as its last statements, so the row lock orders
|
|
36
36
|
/// the numbers as the transactions commit.
|
|
37
|
-
lastEventSeq BigInt
|
|
37
|
+
lastEventSeq BigInt @default(0) @map("last_event_seq")
|
|
38
38
|
/// Whether the fleet sets its own ship limit (else it follows the installation
|
|
39
39
|
/// default), and that limit: null for no limit.
|
|
40
|
-
shipLimitSet Boolean
|
|
41
|
-
shipLimit Int?
|
|
40
|
+
shipLimitSet Boolean @default(false) @map("ship_limit_set")
|
|
41
|
+
shipLimit Int? @map("ship_limit")
|
|
42
42
|
/// The same for its daily message limit.
|
|
43
|
-
dailyMessageLimitSet Boolean
|
|
44
|
-
dailyMessageLimit Int?
|
|
43
|
+
dailyMessageLimitSet Boolean @default(false) @map("daily_message_limit_set")
|
|
44
|
+
dailyMessageLimit Int? @map("daily_message_limit")
|
|
45
45
|
/// The same for the schedules each of its ships may hold, and for the
|
|
46
46
|
/// minimum interval of a repeating schedule, in seconds (decision 0062).
|
|
47
|
-
schedulesPerShipLimitSet Boolean
|
|
48
|
-
schedulesPerShipLimit Int?
|
|
49
|
-
minimumScheduleIntervalSet Boolean
|
|
50
|
-
minimumScheduleInterval Int?
|
|
47
|
+
schedulesPerShipLimitSet Boolean @default(false) @map("schedules_per_ship_limit_set")
|
|
48
|
+
schedulesPerShipLimit Int? @map("schedules_per_ship_limit")
|
|
49
|
+
minimumScheduleIntervalSet Boolean @default(false) @map("minimum_schedule_interval_set")
|
|
50
|
+
minimumScheduleInterval Int? @map("minimum_schedule_interval")
|
|
51
51
|
/// The same for its retention in days (decision 0066): null for kept for good.
|
|
52
|
-
retentionSet Boolean
|
|
53
|
-
retentionDays Int?
|
|
52
|
+
retentionSet Boolean @default(false) @map("retention_set")
|
|
53
|
+
retentionDays Int? @map("retention_days")
|
|
54
54
|
/// When its last pruning pass ran, and from when it keeps its finished
|
|
55
55
|
/// history, as its last finished pass left it (decision 0066); null before any.
|
|
56
|
-
prunedAt DateTime?
|
|
57
|
-
keptFrom DateTime?
|
|
56
|
+
prunedAt DateTime? @map("pruned_at") @db.Timestamptz(3)
|
|
57
|
+
keptFrom DateTime? @map("kept_from") @db.Timestamptz(3)
|
|
58
|
+
/// Its sealing (decision 0068): null while it is not sealed; then sealing until no payload is stored plain, and sealed. The company key that wraps its data keys, by its reference.
|
|
59
|
+
sealingState SealingState? @map("sealing_state")
|
|
60
|
+
/// Since when it reads its sealing state: turned on, or the sealing pass left no payload plain.
|
|
61
|
+
sealingStateSince DateTime? @map("sealing_state_since") @db.Timestamptz(3)
|
|
62
|
+
/// The sealing pass's progress (decision 0068, B5): the payloads stored plain when it turned sealing on, and how many the pass sealed since.
|
|
63
|
+
payloadsToSeal Int @default(0) @map("payloads_to_seal")
|
|
64
|
+
payloadsSealed Int @default(0) @map("payloads_sealed")
|
|
65
|
+
companyKey String? @map("company_key")
|
|
66
|
+
/// Its recovery key (decision 0068, B6), when the company set one: the public half, an age X25519 recipient, and
|
|
67
|
+
/// its fingerprint (SHA256: and the unpadded base64 SHA-256 of the recipient). Each data key is wrapped to it too.
|
|
68
|
+
recoveryKey String? @map("recovery_key")
|
|
69
|
+
recoveryKeyFingerprint String? @map("recovery_key_fingerprint")
|
|
70
|
+
/// Whether its company key answered its last unwrap, and since when (decision 0068, B11): the key vault's reason
|
|
71
|
+
/// while it refuses (accessDenied, disabled, notFound, unreachable), null while it answers. Since when set with the sealing.
|
|
72
|
+
keyUnavailableReason String? @map("key_unavailable_reason")
|
|
73
|
+
keyAvailabilitySince DateTime? @map("key_availability_since") @db.Timestamptz(3)
|
|
58
74
|
|
|
59
75
|
ships Ship[]
|
|
60
76
|
leases Lease[]
|
|
@@ -71,6 +87,8 @@ model Fleet {
|
|
|
71
87
|
scopeNamespaces ScopeNamespace[]
|
|
72
88
|
definedScopes DefinedScope[]
|
|
73
89
|
verifiedFacts VerifiedFacts[]
|
|
90
|
+
alerts Alert[]
|
|
91
|
+
shipExpectations ShipExpectations[]
|
|
74
92
|
reachRefusals ReachRefusal[]
|
|
75
93
|
credentials Credential[]
|
|
76
94
|
messages Message[]
|
|
@@ -88,13 +106,21 @@ model Fleet {
|
|
|
88
106
|
healthSnapshots HealthSnapshot[]
|
|
89
107
|
healthSnapshotDeliveries HealthSnapshotDelivery[]
|
|
90
108
|
meetings Meeting[]
|
|
109
|
+
dataKeys DataKey[]
|
|
91
110
|
meetingParticipants MeetingParticipant[]
|
|
92
111
|
meetingMicRequests MeetingMicRequest[]
|
|
93
112
|
schedules Schedule[]
|
|
113
|
+
featureFlags FleetFeatureFlag[]
|
|
94
114
|
|
|
95
115
|
@@map("fleets")
|
|
96
116
|
}
|
|
97
117
|
|
|
118
|
+
/// A sealed fleet's sealing (decision 0068): payloads stored plain before still wait for the sealing pass, or none do.
|
|
119
|
+
enum SealingState {
|
|
120
|
+
sealing
|
|
121
|
+
sealed
|
|
122
|
+
}
|
|
123
|
+
|
|
98
124
|
/// What a ship is (decision 0044): argo the one operator, the viewer, an agent session, a person's ship or an app's.
|
|
99
125
|
enum ShipKind {
|
|
100
126
|
operator
|
|
@@ -119,6 +145,8 @@ model Ship {
|
|
|
119
145
|
note String?
|
|
120
146
|
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
121
147
|
retiredAt DateTime? @map("retired_at") @db.Timestamptz(3)
|
|
148
|
+
/// When the pruning pass removed it, past the fleet's retention (decision 0070): the row stays a remnant its kept history names.
|
|
149
|
+
removedAt DateTime? @map("removed_at") @db.Timestamptz(3)
|
|
122
150
|
/// The actor that commissioned it, its idempotency key and the request's hash; null for argo.
|
|
123
151
|
/// commissioned_by names the actor: a ship's id, an account's id, or `installation`.
|
|
124
152
|
commissionedByKind CommissionerKind? @map("commissioned_by_kind")
|
|
@@ -153,6 +181,8 @@ model Ship {
|
|
|
153
181
|
declaredNetworkRules DeclaredNetworkRules[]
|
|
154
182
|
declaredNamespace ScopeNamespace?
|
|
155
183
|
verifiedFacts VerifiedFacts[]
|
|
184
|
+
alerts Alert[]
|
|
185
|
+
shipExpectations ShipExpectations[]
|
|
156
186
|
ownedMeetings Meeting[] @relation("MeetingOwner")
|
|
157
187
|
moderatedMeetings Meeting[] @relation("MeetingModerator")
|
|
158
188
|
openedMeetings Meeting[] @relation("MeetingOpener")
|
|
@@ -173,6 +203,8 @@ model Ship {
|
|
|
173
203
|
@@index([fleetId, ownerShipId])
|
|
174
204
|
@@index([fleetId, type], map: "ships_type_listing_idx", where: { retiredAt: null })
|
|
175
205
|
@@index([fleetId, kind], map: "ships_kind_listing_idx", where: { retiredAt: null })
|
|
206
|
+
/// The pruning pass picks the oldest retired ships not removed yet (decision 0070).
|
|
207
|
+
@@index([fleetId, retiredAt, id], map: "ships_removal_idx", where: raw("((retired_at IS NOT NULL) AND (removed_at IS NULL))"))
|
|
176
208
|
@@map("ships")
|
|
177
209
|
}
|
|
178
210
|
|
|
@@ -203,6 +235,16 @@ enum TurnState {
|
|
|
203
235
|
@@map("turn_state")
|
|
204
236
|
}
|
|
205
237
|
|
|
238
|
+
/// The kind of a session's latest event as its trierarch observes it (headless design, H14).
|
|
239
|
+
enum ActivityKind {
|
|
240
|
+
text
|
|
241
|
+
tool
|
|
242
|
+
result
|
|
243
|
+
error
|
|
244
|
+
|
|
245
|
+
@@map("activity_kind")
|
|
246
|
+
}
|
|
247
|
+
|
|
206
248
|
enum LocationKind {
|
|
207
249
|
DEVICE
|
|
208
250
|
CLOUD
|
|
@@ -218,37 +260,51 @@ enum LocationKind {
|
|
|
218
260
|
/// finding a ship by its crew token is a lookup not scoped by fleet (ADR 0007). A
|
|
219
261
|
/// console session's lease on argo has none; the console session holds its token.
|
|
220
262
|
model Lease {
|
|
221
|
-
id
|
|
222
|
-
fleetId
|
|
223
|
-
shipId
|
|
224
|
-
location
|
|
225
|
-
locationDescription
|
|
263
|
+
id String @id
|
|
264
|
+
fleetId String @map("fleet_id")
|
|
265
|
+
shipId String @map("ship_id")
|
|
266
|
+
location LocationKind
|
|
267
|
+
locationDescription String? @map("location_description")
|
|
226
268
|
/// The harness the session stated when it claimed the ship; none for argo's console lease and for leases from before harnesses were stated.
|
|
227
|
-
harness
|
|
228
|
-
crewTokenHash
|
|
229
|
-
startedAt
|
|
269
|
+
harness String?
|
|
270
|
+
crewTokenHash String? @unique @map("crew_token_hash")
|
|
271
|
+
startedAt DateTime @map("started_at") @db.Timestamptz(3)
|
|
230
272
|
/// The last call by its crew: observation only, nothing acts on it (ADR 0016).
|
|
231
|
-
lastSeenAt
|
|
273
|
+
lastSeenAt DateTime? @map("last_seen_at") @db.Timestamptz(3)
|
|
232
274
|
/// The crew's last report: plain data, nothing acts on it. Null until it reports.
|
|
233
|
-
reportState
|
|
234
|
-
reportNote
|
|
235
|
-
reportedAt
|
|
275
|
+
reportState ReportState? @map("report_state")
|
|
276
|
+
reportNote String? @map("report_note")
|
|
277
|
+
reportedAt DateTime? @map("reported_at") @db.Timestamptz(3)
|
|
278
|
+
/// When the state, note, task or step last changed; details alone do not move it (decision 0028). Null until it reports.
|
|
279
|
+
reportChangedAt DateTime? @map("report_changed_at") @db.Timestamptz(3)
|
|
280
|
+
/// What the crew works on: a typed reference, a kind and its fields (decision 0028). Null when it names none.
|
|
281
|
+
reportTask Json? @map("report_task")
|
|
282
|
+
/// Where the crew is in its task, step at of of; both null when it gives none.
|
|
283
|
+
reportStepAt Int? @map("report_step_at")
|
|
284
|
+
reportStepOf Int? @map("report_step_of")
|
|
236
285
|
/// The report's details: one JSON object stored without meaning, at most 16 KB (decision 0028). Null when there are none.
|
|
237
|
-
reportDetails
|
|
286
|
+
reportDetails Json? @map("report_details")
|
|
238
287
|
/// Moves by one each time the details change; 0 before any.
|
|
239
|
-
reportDetailsVersion
|
|
240
|
-
/// The crew's statement: what its ship is and offers, at most
|
|
241
|
-
statement
|
|
288
|
+
reportDetailsVersion Int @default(0) @map("report_details_version")
|
|
289
|
+
/// The crew's statement: what its ship is and offers, at most 256 KB, its shape common's; null until it states one (decision 0047).
|
|
290
|
+
statement Json?
|
|
242
291
|
/// Moves by one each time the statement changes; 0 before any.
|
|
243
|
-
statementVersion
|
|
292
|
+
statementVersion Int @default(0) @map("statement_version")
|
|
244
293
|
/// From the lease's first push receive: the computer side takes its deliveries, and the agent's plain receive answers nothing (decision 0040).
|
|
245
|
-
pushedAt
|
|
294
|
+
pushedAt DateTime? @map("pushed_at") @db.Timestamptz(3)
|
|
246
295
|
/// What wakes the ship, as its first push receive stated it; null when it stated none (interop 5.1).
|
|
247
|
-
waker
|
|
296
|
+
waker LeaseWaker?
|
|
248
297
|
/// The session's turn as its hooks last reported it, and when they saw it change; null until they report (decision 0040).
|
|
249
|
-
turn
|
|
250
|
-
turnAt
|
|
251
|
-
|
|
298
|
+
turn TurnState?
|
|
299
|
+
turnAt DateTime? @map("turn_at") @db.Timestamptz(3)
|
|
300
|
+
/// What its assigned trierarch last observed of the session: the latest event's time, kind and tool, never content; null until it writes (docs/design/monitoring, 4.3).
|
|
301
|
+
activityAt DateTime? @map("activity_at") @db.Timestamptz(3)
|
|
302
|
+
activityKind ActivityKind? @map("activity_kind")
|
|
303
|
+
activityTool String? @map("activity_tool")
|
|
304
|
+
/// When the trierarch wrote it, and the report interval it stated: past twice that interval it reads unknown.
|
|
305
|
+
activityReportedAt DateTime? @map("activity_reported_at") @db.Timestamptz(3)
|
|
306
|
+
activityIntervalSeconds Int? @map("activity_interval_seconds")
|
|
307
|
+
endedAt DateTime? @map("ended_at") @db.Timestamptz(3)
|
|
252
308
|
|
|
253
309
|
fleet Fleet @relation(fields: [fleetId], references: [id])
|
|
254
310
|
ship Ship @relation(fields: [fleetId, shipId], references: [fleetId, id])
|
|
@@ -521,6 +577,57 @@ model VerifiedFacts {
|
|
|
521
577
|
@@map("verified_facts")
|
|
522
578
|
}
|
|
523
579
|
|
|
580
|
+
/// An alert on a ship (decision 0071): what the watch raised when a fact and
|
|
581
|
+
/// its signal parted, open until the watch clears it or the ship retires.
|
|
582
|
+
/// Ids start with alt_. One per ship, signal and occurrence, open or cleared,
|
|
583
|
+
/// so an occurrence is raised once. facts holds the signal's facts at raise,
|
|
584
|
+
/// as common's schema gives them.
|
|
585
|
+
model Alert {
|
|
586
|
+
id String @id
|
|
587
|
+
fleetId String @map("fleet_id")
|
|
588
|
+
shipId String @map("ship_id")
|
|
589
|
+
signal String
|
|
590
|
+
occurrenceKey String @map("occurrence_key")
|
|
591
|
+
facts Json
|
|
592
|
+
ownerShipId String? @map("owner_ship_id")
|
|
593
|
+
since DateTime @db.Timestamptz(3)
|
|
594
|
+
raisedAt DateTime @map("raised_at") @db.Timestamptz(3)
|
|
595
|
+
clearedAt DateTime? @map("cleared_at") @db.Timestamptz(3)
|
|
596
|
+
clearedWhy String? @map("cleared_why")
|
|
597
|
+
|
|
598
|
+
fleet Fleet @relation(fields: [fleetId], references: [id])
|
|
599
|
+
ship Ship @relation(fields: [fleetId, shipId], references: [fleetId, id])
|
|
600
|
+
|
|
601
|
+
@@unique([fleetId, shipId, signal, occurrenceKey])
|
|
602
|
+
/// The fleet's open alerts, newest first, a page at a time.
|
|
603
|
+
@@index([fleetId, id(sort: Desc)], map: "alerts_open_idx", where: { clearedAt: null })
|
|
604
|
+
/// A ship's open alerts, and how many it has.
|
|
605
|
+
@@index([fleetId, shipId], map: "alerts_open_on_ship_idx", where: { clearedAt: null })
|
|
606
|
+
@@map("alerts")
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/// The expectations on a ship (decision 0071): what its owner, or a ship
|
|
610
|
+
/// that manages it, expects of it, standing, at most one of each. Each keeps
|
|
611
|
+
/// who set it (JSON, as common's expectation setter) and when; its columns
|
|
612
|
+
/// are null while it is not set. No row while none holds; a retire removes it.
|
|
613
|
+
model ShipExpectations {
|
|
614
|
+
fleetId String @map("fleet_id")
|
|
615
|
+
shipId String @map("ship_id")
|
|
616
|
+
reportChangesWithinMinutes Int? @map("report_changes_within_minutes")
|
|
617
|
+
reportChangesWithinSetBy Json? @map("report_changes_within_set_by")
|
|
618
|
+
reportChangesWithinSetAt DateTime? @map("report_changes_within_set_at") @db.Timestamptz(3)
|
|
619
|
+
taskDoneByTask Json? @map("task_done_by_task")
|
|
620
|
+
taskDoneBy DateTime? @map("task_done_by") @db.Timestamptz(3)
|
|
621
|
+
taskDoneBySetBy Json? @map("task_done_by_set_by")
|
|
622
|
+
taskDoneBySetAt DateTime? @map("task_done_by_set_at") @db.Timestamptz(3)
|
|
623
|
+
|
|
624
|
+
fleet Fleet @relation(fields: [fleetId], references: [id])
|
|
625
|
+
ship Ship @relation(fields: [fleetId, shipId], references: [fleetId, id])
|
|
626
|
+
|
|
627
|
+
@@id([fleetId, shipId])
|
|
628
|
+
@@map("ship_expectations")
|
|
629
|
+
}
|
|
630
|
+
|
|
524
631
|
/// A send the network rules refused (decision 0034), recorded in the
|
|
525
632
|
/// transaction that refused it. Ids start with rfs_. Sender and recipient are
|
|
526
633
|
/// as they were then: ids, names and the label values they carried, as JSON,
|
|
@@ -582,6 +689,20 @@ enum SelectorKind {
|
|
|
582
689
|
/// statements, after the fleet's event numbers, so the row lock is held only
|
|
583
690
|
/// until commit. Storage is the sum of the days; the daily message limit
|
|
584
691
|
/// counts today's row.
|
|
692
|
+
/// A feature flag that is on for a fleet (decision 0069): a row per flag that
|
|
693
|
+
/// is on, none being off. The flag by its key in common's list, as text, so a
|
|
694
|
+
/// new flag needs no migration.
|
|
695
|
+
model FleetFeatureFlag {
|
|
696
|
+
fleetId String @map("fleet_id")
|
|
697
|
+
flag String
|
|
698
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
699
|
+
|
|
700
|
+
fleet Fleet @relation(fields: [fleetId], references: [id])
|
|
701
|
+
|
|
702
|
+
@@id([fleetId, flag])
|
|
703
|
+
@@map("fleet_feature_flags")
|
|
704
|
+
}
|
|
705
|
+
|
|
585
706
|
model MessageDay {
|
|
586
707
|
fleetId String @map("fleet_id")
|
|
587
708
|
day DateTime @db.Date
|
|
@@ -594,7 +715,7 @@ model MessageDay {
|
|
|
594
715
|
@@map("message_days")
|
|
595
716
|
}
|
|
596
717
|
|
|
597
|
-
/// An immutable envelope plus an opaque payload of at most
|
|
718
|
+
/// An immutable envelope plus an opaque payload of at most 256 KB, sent by one ship.
|
|
598
719
|
/// Ids start with msg_. The selector is stored as resolved at send time: a ship's
|
|
599
720
|
/// id, never its name, or a type. It can name the message it replies to, and a
|
|
600
721
|
/// resend names the message it resends (nothing sets that yet).
|
|
@@ -607,7 +728,15 @@ model Message {
|
|
|
607
728
|
selectorType String? @map("selector_type")
|
|
608
729
|
/// The label selection a send to a label was sent to, its value ids as sent (decision 0065); none for any other selector.
|
|
609
730
|
selectorValueIds String[] @default([]) @map("selector_value_ids")
|
|
610
|
-
payload
|
|
731
|
+
/// Null in a sealed fleet (decision 0068): the sealed payload is the data key, nonce and ciphertext with its tag,
|
|
732
|
+
/// beside the plain payload's UTF-8 byte count.
|
|
733
|
+
payload String?
|
|
734
|
+
sealedDataKeyId String? @map("sealed_data_key_id")
|
|
735
|
+
sealedNonce Bytes? @map("sealed_nonce")
|
|
736
|
+
sealedCiphertext Bytes? @map("sealed_ciphertext")
|
|
737
|
+
sealedPayloadBytes Int? @map("sealed_payload_bytes")
|
|
738
|
+
/// The question uuid a withdrawal or a replacement names, read at send (decision 0068, B18).
|
|
739
|
+
questionId String? @map("question_id")
|
|
611
740
|
contentType String @map("content_type")
|
|
612
741
|
/// The model the sender's session stated; none from argo and on messages from before models were stated.
|
|
613
742
|
model String?
|
|
@@ -629,6 +758,7 @@ model Message {
|
|
|
629
758
|
selectorShip Ship? @relation("MessageSelectorShip", fields: [fleetId, selectorShipId], references: [fleetId, id], onDelete: Restrict)
|
|
630
759
|
meeting Meeting? @relation(fields: [fleetId, meetingId], references: [fleetId, id], onDelete: Restrict)
|
|
631
760
|
schedule Schedule? @relation("MessageSchedule", fields: [fleetId, scheduleId], references: [fleetId, id], onDelete: Restrict)
|
|
761
|
+
sealedDataKey DataKey? @relation(fields: [fleetId, sealedDataKeyId], references: [fleetId, id], onDelete: Restrict)
|
|
632
762
|
repliedToBySchedules Schedule[] @relation("ScheduleInReplyTo")
|
|
633
763
|
lastSentBySchedules Schedule[] @relation("ScheduleLastMessage")
|
|
634
764
|
deliveries Delivery[]
|
|
@@ -644,6 +774,10 @@ model Message {
|
|
|
644
774
|
@@index([fleetId, senderShipId, id])
|
|
645
775
|
/// The installation counts a fleet's messages of the last 7 days (#1126).
|
|
646
776
|
@@index([fleetId, createdAt])
|
|
777
|
+
/// A question's withdrawals and replacements, found by the question uuid they name (decisions 0038, 0068).
|
|
778
|
+
@@index([fleetId, questionId], map: "messages_fleet_id_question_id_idx", where: { questionId: { not: null } })
|
|
779
|
+
/// A data key's sealed messages, for its foreign key.
|
|
780
|
+
@@index([fleetId, sealedDataKeyId])
|
|
647
781
|
/// Every foreign key has an index leading with its columns, so deleting a
|
|
648
782
|
/// referenced row checks it with an index, not a scan (#331).
|
|
649
783
|
@@index([fleetId, selectorShipId, id])
|
|
@@ -730,7 +864,13 @@ model Schedule {
|
|
|
730
864
|
selectorShipName String? @map("selector_ship_name")
|
|
731
865
|
selectorType String? @map("selector_type")
|
|
732
866
|
selectorValueIds String[] @default([]) @map("selector_value_ids")
|
|
733
|
-
payload
|
|
867
|
+
/// Null in a sealed fleet (decision 0068): the sealed payload is the data key, nonce and ciphertext with its tag,
|
|
868
|
+
/// beside the plain payload's UTF-8 byte count, as a message's.
|
|
869
|
+
payload String?
|
|
870
|
+
sealedDataKeyId String? @map("sealed_data_key_id")
|
|
871
|
+
sealedNonce Bytes? @map("sealed_nonce")
|
|
872
|
+
sealedCiphertext Bytes? @map("sealed_ciphertext")
|
|
873
|
+
sealedPayloadBytes Int? @map("sealed_payload_bytes")
|
|
734
874
|
contentType String @map("content_type")
|
|
735
875
|
model String?
|
|
736
876
|
inReplyToMessageId String? @map("in_reply_to_message_id")
|
|
@@ -762,12 +902,13 @@ model Schedule {
|
|
|
762
902
|
endedAt DateTime? @map("ended_at") @db.Timestamptz(3)
|
|
763
903
|
cancelledAt DateTime? @map("cancelled_at") @db.Timestamptz(3)
|
|
764
904
|
|
|
765
|
-
fleet
|
|
766
|
-
ship
|
|
767
|
-
selectorShip
|
|
768
|
-
inReplyTo
|
|
769
|
-
|
|
770
|
-
|
|
905
|
+
fleet Fleet @relation(fields: [fleetId], references: [id])
|
|
906
|
+
ship Ship @relation("ScheduleShip", fields: [fleetId, shipId], references: [fleetId, id], onDelete: Restrict)
|
|
907
|
+
selectorShip Ship? @relation("ScheduleSelectorShip", fields: [fleetId, selectorShipId], references: [fleetId, id], onDelete: Restrict)
|
|
908
|
+
inReplyTo Message? @relation("ScheduleInReplyTo", fields: [fleetId, inReplyToMessageId], references: [fleetId, id], onDelete: Restrict)
|
|
909
|
+
sealedDataKey DataKey? @relation(fields: [fleetId, sealedDataKeyId], references: [fleetId, id], onDelete: Restrict)
|
|
910
|
+
lastMessage Message? @relation("ScheduleLastMessage", fields: [fleetId, lastMessageId], references: [fleetId, id], onDelete: Restrict)
|
|
911
|
+
messages Message[] @relation("MessageSchedule")
|
|
771
912
|
|
|
772
913
|
@@unique([fleetId, id])
|
|
773
914
|
/// A ship uses an idempotency key once for its schedules.
|
|
@@ -780,6 +921,7 @@ model Schedule {
|
|
|
780
921
|
@@index([fleetId, selectorShipId])
|
|
781
922
|
@@index([fleetId, inReplyToMessageId])
|
|
782
923
|
@@index([fleetId, lastMessageId])
|
|
924
|
+
@@index([fleetId, sealedDataKeyId])
|
|
783
925
|
@@map("schedules")
|
|
784
926
|
}
|
|
785
927
|
|
|
@@ -1364,3 +1506,25 @@ enum LabelOwnerKind {
|
|
|
1364
1506
|
|
|
1365
1507
|
@@map("label_owner_kind")
|
|
1366
1508
|
}
|
|
1509
|
+
|
|
1510
|
+
/// A sealed fleet's data key (decision 0068): kept only wrapped, by the company key and by the recovery key
|
|
1511
|
+
/// when set, with a check value (HMAC-SHA-256 of a fixed text under the key) that proves an unwrap gave
|
|
1512
|
+
/// the right key. Never unwrapped in the database. Old keys stay to unseal old payloads.
|
|
1513
|
+
model DataKey {
|
|
1514
|
+
id String @id
|
|
1515
|
+
fleetId String @map("fleet_id")
|
|
1516
|
+
wrappedByCompanyKey Bytes @map("wrapped_by_company_key")
|
|
1517
|
+
wrappedByRecoveryKey Bytes? @map("wrapped_by_recovery_key")
|
|
1518
|
+
checkValue Bytes @map("check_value")
|
|
1519
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
1520
|
+
isCurrent Boolean @map("is_current")
|
|
1521
|
+
|
|
1522
|
+
fleet Fleet @relation(fields: [fleetId], references: [id])
|
|
1523
|
+
messages Message[]
|
|
1524
|
+
schedules Schedule[]
|
|
1525
|
+
|
|
1526
|
+
@@unique([fleetId, id])
|
|
1527
|
+
/// One current data key per fleet.
|
|
1528
|
+
@@unique([fleetId], map: "data_keys_fleet_id_current_key", where: { isCurrent: true })
|
|
1529
|
+
@@map("data_keys")
|
|
1530
|
+
}
|