@wildo-ai/saas-models 1.1.0 → 1.1.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/esm/applications/applications-context.schemas.d.ts +2 -0
- package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +36 -0
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.js +8 -1
- package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.d.ts +2 -2
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js +39 -0
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts +6 -6
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.js +8 -4
- package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +35 -0
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.js +8 -3
- package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js +39 -0
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.d.ts +4 -4
- package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.js +6 -2
- package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.js +39 -0
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.d.ts +4 -4
- package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js +7 -3
- package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +35 -2
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +61 -0
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +58 -0
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +14 -0
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts +49 -0
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js +124 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +11 -3
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +11 -3
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +93 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +116 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +67 -12
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +95 -8
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts +21 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js +20 -0
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +2 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.js +29 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +33 -0
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.js +32 -0
- package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +12 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +12 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +13 -0
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +6 -6
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +26 -6
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +0 -2
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +1 -0
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +4 -3
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js +4 -3
- package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.js +48 -0
- package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts +144 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.js +136 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -0
- package/dist/esm/files/files.shared.schemas.d.ts +45 -4
- package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.schemas.js +48 -4
- package/dist/esm/files/files.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js +33 -0
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js +6 -2
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js +53 -0
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js +43 -0
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +8 -3
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js +41 -0
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts +0 -7
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js +23 -13
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js +51 -0
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.js +8 -2
- package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js +51 -0
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js +28 -3
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js +51 -0
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.js +18 -4
- package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +37 -3
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +29 -3
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts +70 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js +71 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -0
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +36 -0
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +44 -0
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.js +15 -4
- package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +18 -10
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js +17 -0
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.d.ts +59 -0
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js +103 -0
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/collection-query-parameters.shared.d.ts +22 -0
- package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -0
- package/dist/esm/resources/collection-query-parameters.shared.js +22 -0
- package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -0
- package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js +86 -13
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +162 -41
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js +109 -20
- package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +21 -6
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +57 -0
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.js +64 -0
- package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +17 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js +16 -0
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts +28 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js +28 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts +21 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js +21 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -0
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +43 -0
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts +0 -8
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js +13 -4
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +16 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js +16 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts +54 -0
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.js +59 -0
- package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +61 -0
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +13 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js +35 -0
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js +7 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +34 -0
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.js +7 -4
- package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.js +37 -0
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.js +17 -2
- package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js +36 -0
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.js +15 -5
- package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js +53 -0
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js +62 -0
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js +53 -0
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js +62 -0
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.schemas.d.ts +19 -0
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js +41 -16
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -6
- package/dist/esm/.builder.pid +0 -9
|
@@ -42,6 +42,7 @@ import { ResourceSystemAccessMode } from '../resources/resources-config.shared.s
|
|
|
42
42
|
import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
|
|
43
43
|
import { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory.js';
|
|
44
44
|
import { CORE_ORG_ROLES, CORE_APP_ROLES } from '../security/authorizations/roles.shared.schemas.js';
|
|
45
|
+
import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
|
|
45
46
|
import { a2aPushDeliveryLogPolymorphicDeclaration, A2APushDeliveryStatus, } from './a2a-push-delivery-log.shared.schemas.js';
|
|
46
47
|
/**
|
|
47
48
|
* Who may read a delivery row.
|
|
@@ -98,6 +99,21 @@ export const a2aPushDeliveryLogPolymorphicFactories = createPolymorphicResourceC
|
|
|
98
99
|
// fail-closed subject-export authority refuses the whole runtime graph at companion bootstrap
|
|
99
100
|
// ("no effective portability provenance … (undeclared)" for every field).
|
|
100
101
|
portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },
|
|
102
|
+
/**
|
|
103
|
+
* Subject erasure RETAINS this row and scrubs the delivered payload.
|
|
104
|
+
*
|
|
105
|
+
* The delivery record — what was sent, when, to which endpoint, and whether it succeeded — is the
|
|
106
|
+
* operational evidence this resource exists to keep. The `payload` is not: it carries the task's own
|
|
107
|
+
* content, which originated with the person, and a payload can hold anything a task held.
|
|
108
|
+
*/
|
|
109
|
+
retentionPolicy: {
|
|
110
|
+
mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Erasing one of these rows revokes NO session. The row is work performed for a person, not the person;
|
|
114
|
+
* its owner FK names the scope the work ran in. The subject's session ends through the `USERS` row.
|
|
115
|
+
*/
|
|
116
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
|
|
101
117
|
coreOperations: [
|
|
102
118
|
CoreResourceOperation.READ,
|
|
103
119
|
CoreResourceOperation.LIST,
|
|
@@ -106,8 +122,25 @@ export const a2aPushDeliveryLogPolymorphicFactories = createPolymorphicResourceC
|
|
|
106
122
|
CoreResourceOperation.UPDATE,
|
|
107
123
|
CoreResourceOperation.DELETE,
|
|
108
124
|
CoreResourceOperation.DELETE_MANY,
|
|
125
|
+
// Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.
|
|
126
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
109
127
|
],
|
|
110
128
|
operationsConfiguration: {
|
|
129
|
+
/*
|
|
130
|
+
* Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it
|
|
131
|
+
* must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,
|
|
132
|
+
* which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the
|
|
133
|
+
* HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the
|
|
134
|
+
* verb the impersonalize writer uses to stamp the retention markers.
|
|
135
|
+
*/
|
|
136
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
137
|
+
variants: [{
|
|
138
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
139
|
+
isDefault: true,
|
|
140
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
141
|
+
riskLevel: ResourceOperationRiskLevel.CRITICAL,
|
|
142
|
+
}],
|
|
143
|
+
},
|
|
111
144
|
[CoreResourceOperation.READ]: {
|
|
112
145
|
variants: [{
|
|
113
146
|
variantType: ResourceOperationVariantType.API_CALL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-push-delivery-log.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.ts"],"names":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,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,kBAAkB;oBACnC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;QACD,8FAA8F;QAC9F,8CAA8C;QAC9C,CAAC,qBAAqB,CAAC,WAAW,CAAC,EAAE;YACnC,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,kBAAkB;oBACnC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * A2A Push Delivery Log Resource Configuration — polymorphic across the three A2A owner scopes.\n *\n * Produces 3 factory functions (USER + ORG + APP). Spread into the registry factory map:\n * ...a2aPushDeliveryLogPolymorphicFactories\n *\n * Operation set, and why each one is shaped the way it is:\n * - READ / LIST / SEARCH (API) : an owner inspects what was delivered on its behalf\n * - CREATE (INTERNAL_CALL) : dispatcher-only — a delivery row is EVIDENCE, and a\n * client that could author one could fabricate proof\n * that a notification was sent\n * - UPDATE (INTERNAL_CALL) : the worker's lifecycle transitions\n * (PENDING → IN_FLIGHT → DELIVERED/FAILED)\n * - DELETE / DELETE_MANY (REPOSITORY_ONLY) : reserved for retention purging. Deliberately NO\n * external single-row delete — a trail an owner can\n * selectively erase is not a trail\n *\n * **Route-lessness and TIER are two different questions, and conflating them broke this resource.**\n * `INTERNAL_CALL` and `REPOSITORY_ONLY` are both route-less — neither exposes an HTTP surface, so the\n * \"never a public mutation\" property above holds identically under either. What they differ on is which\n * tier can REACH them. CREATE and UPDATE are written by `A2APushDeliveryLogRepository` through\n * `*AsSystem` (the service tier), which resolves via `getServiceOperationPathDefault` and matches only\n * `INTERNAL_CALL` / `API_CALL`; they were authored `REPOSITORY_ONLY` and therefore threw on every write\n * until 2026-08-11. DELETE / DELETE_MANY correctly STAY `REPOSITORY_ONLY`: nothing calls them through\n * `*AsSystem` — retention purging and the owner-scope composition cascade both run at the repository\n * tier, which is exactly the tier `REPOSITORY_ONLY` serves. Enumerated deliberately rather than swept:\n * changing a variant nothing calls would have been churn, and leaving one a caller DOES reach was the bug.\n *\n * Deliberately NO `RETRY` custom operation, unlike the M2M delivery log. Retry there is an admin\n * repairing a tenant's own integration; here the caller is an external agent client, and letting it\n * re-fire deliveries on demand would hand it an amplifier pointed at a URL it also chose. Retries\n * are the worker's, on its own backoff schedule. If an operator-driven retry is ever wanted it\n * belongs on an admin surface, not on this resource.\n *\n * @see notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.ts — the pattern\n * @see a2a-token-budget-state.shared.resources-config.schemas.ts — the 3-scope role precedent\n */\n\nimport { z } from 'zod';\nimport {\n CoreResourceOperation,\n CoreResourceType,\n} from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_ORG_ROLES, CORE_APP_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport {\n a2aPushDeliveryLogPolymorphicDeclaration,\n A2APushDeliveryStatus,\n} from './a2a-push-delivery-log.shared.schemas';\n\n/**\n * Who may read a delivery row.\n *\n * A row names a webhook URL the owner itself registered and the outcome of contacting it. It\n * carries no message content by construction (the payload is a `statusUpdate`, never a `Task` — see\n * `a2a-push-notification-delivery.backend.utils.ts`), so owner-level read is the right bar rather\n * than an admin one: the party that configured the delivery is the party that needs to see whether\n * it worked, and forcing them to an admin to diagnose their own webhook helps nobody.\n *\n * Follows the token-budget precedent for the same three scopes.\n */\nconst OWNER_READ_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_MEMBER],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_USER],\n};\n\n/** Writes are the dispatcher's and the worker's; the role here gates nothing reachable over HTTP. */\nconst SYSTEM_WRITE_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\nexport const a2aPushDeliveryLogPolymorphicFactories = createPolymorphicResourceConfigurations(\n a2aPushDeliveryLogPolymorphicDeclaration,\n {\n isSystemResource: true,\n\n /**\n * Opt the runtime into scoped writes on the owner's behalf. Absent this, every `*AsSystem` verb\n * fails closed.\n *\n * This resource follows the TASK service's pattern rather than the M2M delivery log's, and the\n * difference is not stylistic: the M2M dispatcher runs inside the resource operation that\n * triggered the webhook and therefore holds that operation's `ExecutionContext`, whereas a push\n * notification is triggered by `advanceTask` — a system-owned transition with no caller context\n * to borrow. Synthesising one at the call site would fabricate an authority nobody granted;\n * `*AsSystem` is the door built for exactly this.\n *\n * No `delete` mode: nothing system-deletes a delivery row. Removal is retention purging or the\n * owner-scope cascade, both of which run through their own paths.\n */\n systemAccessPolicy: {\n // The subject's own delivery evidence — including the webhook URLs they registered. Granted\n // because the owner can already READ/LIST/SEARCH these rows over the API, so withholding them\n // from a subject export would make the export narrower than the product surface.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n // Art. 20 portability provenance for the field sweep this user-DEPENDENT resource enters.\n // Every field on a delivery row is delivery mechanics the SYSTEM observed while attempting the\n // webhook (attempt counts, timestamps, response status, the destination recorded at send time)\n // — none of it is content the subject provided on THIS row, so the blanket default is OBSERVED,\n // matching the A2A siblings (task, execution, token-budget state). Without this declaration the\n // fail-closed subject-export authority refuses the whole runtime graph at companion bootstrap\n // (\"no effective portability provenance … (undeclared)\" for every field).\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n CoreResourceOperation.DELETE_MANY,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n // `failureReason` is searchable because \"why did my webhook stop working\" is the question\n // this resource exists to answer. `httpUrl` is NOT: it would let a caller enumerate rows\n // by destination, and the owner already knows its own URLs from the configuration plane.\n searchableFields: ['taskId', 'pushNotificationConfigId', 'failureReason'],\n filterFields: {\n status: z.enum(A2APushDeliveryStatus),\n taskId: z.string(),\n resourceServerInstanceRef: z.string(),\n createdAt: z.date(),\n },\n sortFields: ['createdAt', 'status', 'attemptCount'] as const,\n }],\n },\n // A delivery row is EVIDENCE that a notification was attempted. Authoring one from outside\n // would let a caller fabricate that evidence — so CREATE carries NO HTTP surface.\n //\n // ⚠️ `INTERNAL_CALL`, not `REPOSITORY_ONLY`, and the distinction is load-bearing rather than\n // stylistic. Both are route-less, so both withhold the surface equally; what differs is which\n // TIER can reach them. `A2APushDeliveryLogRepository` writes through `*AsSystem`, which\n // dispatches via the service tier and resolves through `getServiceOperationPathDefault` —\n // matching only `INTERNAL_CALL` / `API_CALL`. This op was authored `REPOSITORY_ONLY`, so every\n // `open()` threw `resources_registry_operation_path_not_found`, the dispatcher's no-throw\n // contract swallowed it at WARN, and the whole push-delivery feature was inert for eleven days\n // while the agent card advertised it (measured 2026-08-11 by the live lane; the config was green\n // at boot throughout, because a variant satisfies every \"the op exists\" check and fails only when\n // a service-tier caller invokes it).\n //\n // The sibling `flows-actors-task` config states the same rule for the same reason and is the\n // pattern this follows: \"INTERNAL_CALL (not REPOSITORY_ONLY) is mandatory\". Keep the two in step —\n // both are written by the A2A runtime through `*AsSystem`, governed by `systemAccessPolicy` above\n // rather than by the op RBAC (`SYSTEM_WRITE_ROLES` gates nothing reachable here).\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n // The worker's lifecycle transitions, reached through `updateAsSystem` — so `INTERNAL_CALL` for\n // exactly the reason CREATE is, and broken the same way while it was not. Still no HTTP surface:\n // exposing UPDATE would let a caller mark its own undelivered notifications DELIVERED.\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n // Retention purging. Bulk twin of DELETE, and REPOSITORY_ONLY for the same reason: a trail an\n // owner can selectively erase is not a trail.\n [CoreResourceOperation.DELETE_MANY]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"a2a-push-delivery-log.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACvH,OAAO,EACL,wCAAwC,EACxC,qBAAqB,GACtB,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,gBAAgB,GAAG;IACvB,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;IACnD,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC;IAC7D,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;CAC1D,CAAC;AAEF,qGAAqG;AACrG,MAAM,kBAAkB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AkB;oBACnC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * A2A Push Delivery Log Resource Configuration — polymorphic across the three A2A owner scopes.\n *\n * Produces 3 factory functions (USER + ORG + APP). Spread into the registry factory map:\n * ...a2aPushDeliveryLogPolymorphicFactories\n *\n * Operation set, and why each one is shaped the way it is:\n * - READ / LIST / SEARCH (API) : an owner inspects what was delivered on its behalf\n * - CREATE (INTERNAL_CALL) : dispatcher-only — a delivery row is EVIDENCE, and a\n * client that could author one could fabricate proof\n * that a notification was sent\n * - UPDATE (INTERNAL_CALL) : the worker's lifecycle transitions\n * (PENDING → IN_FLIGHT → DELIVERED/FAILED)\n * - DELETE / DELETE_MANY (REPOSITORY_ONLY) : reserved for retention purging. Deliberately NO\n * external single-row delete — a trail an owner can\n * selectively erase is not a trail\n *\n * **Route-lessness and TIER are two different questions, and conflating them broke this resource.**\n * `INTERNAL_CALL` and `REPOSITORY_ONLY` are both route-less — neither exposes an HTTP surface, so the\n * \"never a public mutation\" property above holds identically under either. What they differ on is which\n * tier can REACH them. CREATE and UPDATE are written by `A2APushDeliveryLogRepository` through\n * `*AsSystem` (the service tier), which resolves via `getServiceOperationPathDefault` and matches only\n * `INTERNAL_CALL` / `API_CALL`; they were authored `REPOSITORY_ONLY` and therefore threw on every write\n * until 2026-08-11. DELETE / DELETE_MANY correctly STAY `REPOSITORY_ONLY`: nothing calls them through\n * `*AsSystem` — retention purging and the owner-scope composition cascade both run at the repository\n * tier, which is exactly the tier `REPOSITORY_ONLY` serves. Enumerated deliberately rather than swept:\n * changing a variant nothing calls would have been churn, and leaving one a caller DOES reach was the bug.\n *\n * Deliberately NO `RETRY` custom operation, unlike the M2M delivery log. Retry there is an admin\n * repairing a tenant's own integration; here the caller is an external agent client, and letting it\n * re-fire deliveries on demand would hand it an amplifier pointed at a URL it also chose. Retries\n * are the worker's, on its own backoff schedule. If an operator-driven retry is ever wanted it\n * belongs on an admin surface, not on this resource.\n *\n * @see notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.ts — the pattern\n * @see a2a-token-budget-state.shared.resources-config.schemas.ts — the 3-scope role precedent\n */\n\nimport { z } from 'zod';\nimport {\n CoreResourceOperation,\n CoreResourceType,\n} from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_ORG_ROLES, CORE_APP_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\nimport {\n a2aPushDeliveryLogPolymorphicDeclaration,\n A2APushDeliveryStatus,\n} from './a2a-push-delivery-log.shared.schemas';\n\n/**\n * Who may read a delivery row.\n *\n * A row names a webhook URL the owner itself registered and the outcome of contacting it. It\n * carries no message content by construction (the payload is a `statusUpdate`, never a `Task` — see\n * `a2a-push-notification-delivery.backend.utils.ts`), so owner-level read is the right bar rather\n * than an admin one: the party that configured the delivery is the party that needs to see whether\n * it worked, and forcing them to an admin to diagnose their own webhook helps nobody.\n *\n * Follows the token-budget precedent for the same three scopes.\n */\nconst OWNER_READ_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_MEMBER],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_USER],\n};\n\n/** Writes are the dispatcher's and the worker's; the role here gates nothing reachable over HTTP. */\nconst SYSTEM_WRITE_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\nexport const a2aPushDeliveryLogPolymorphicFactories = createPolymorphicResourceConfigurations(\n a2aPushDeliveryLogPolymorphicDeclaration,\n {\n isSystemResource: true,\n\n /**\n * Opt the runtime into scoped writes on the owner's behalf. Absent this, every `*AsSystem` verb\n * fails closed.\n *\n * This resource follows the TASK service's pattern rather than the M2M delivery log's, and the\n * difference is not stylistic: the M2M dispatcher runs inside the resource operation that\n * triggered the webhook and therefore holds that operation's `ExecutionContext`, whereas a push\n * notification is triggered by `advanceTask` — a system-owned transition with no caller context\n * to borrow. Synthesising one at the call site would fabricate an authority nobody granted;\n * `*AsSystem` is the door built for exactly this.\n *\n * No `delete` mode: nothing system-deletes a delivery row. Removal is retention purging or the\n * owner-scope cascade, both of which run through their own paths.\n */\n systemAccessPolicy: {\n // The subject's own delivery evidence — including the webhook URLs they registered. Granted\n // because the owner can already READ/LIST/SEARCH these rows over the API, so withholding them\n // from a subject export would make the export narrower than the product surface.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n // Art. 20 portability provenance for the field sweep this user-DEPENDENT resource enters.\n // Every field on a delivery row is delivery mechanics the SYSTEM observed while attempting the\n // webhook (attempt counts, timestamps, response status, the destination recorded at send time)\n // — none of it is content the subject provided on THIS row, so the blanket default is OBSERVED,\n // matching the A2A siblings (task, execution, token-budget state). Without this declaration the\n // fail-closed subject-export authority refuses the whole runtime graph at companion bootstrap\n // (\"no effective portability provenance … (undeclared)\" for every field).\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and scrubs the delivered payload.\n *\n * The delivery record — what was sent, when, to which endpoint, and whether it succeeded — is the\n * operational evidence this resource exists to keep. The `payload` is not: it carries the task's own\n * content, which originated with the person, and a payload can hold anything a task held.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is work performed for a person, not the person;\n * its owner FK names the scope the work ran in. The subject's session ends through the `USERS` row.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n CoreResourceOperation.DELETE_MANY,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n operationsConfiguration: {\n /*\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n * verb the impersonalize writer uses to stamp the retention markers.\n */\n [CoreResourceOperation.UPDATE_MANY]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.SEARCH]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n // `failureReason` is searchable because \"why did my webhook stop working\" is the question\n // this resource exists to answer. `httpUrl` is NOT: it would let a caller enumerate rows\n // by destination, and the owner already knows its own URLs from the configuration plane.\n searchableFields: ['taskId', 'pushNotificationConfigId', 'failureReason'],\n filterFields: {\n status: z.enum(A2APushDeliveryStatus),\n taskId: z.string(),\n resourceServerInstanceRef: z.string(),\n createdAt: z.date(),\n },\n sortFields: ['createdAt', 'status', 'attemptCount'] as const,\n }],\n },\n // A delivery row is EVIDENCE that a notification was attempted. Authoring one from outside\n // would let a caller fabricate that evidence — so CREATE carries NO HTTP surface.\n //\n // ⚠️ `INTERNAL_CALL`, not `REPOSITORY_ONLY`, and the distinction is load-bearing rather than\n // stylistic. Both are route-less, so both withhold the surface equally; what differs is which\n // TIER can reach them. `A2APushDeliveryLogRepository` writes through `*AsSystem`, which\n // dispatches via the service tier and resolves through `getServiceOperationPathDefault` —\n // matching only `INTERNAL_CALL` / `API_CALL`. This op was authored `REPOSITORY_ONLY`, so every\n // `open()` threw `resources_registry_operation_path_not_found`, the dispatcher's no-throw\n // contract swallowed it at WARN, and the whole push-delivery feature was inert for eleven days\n // while the agent card advertised it (measured 2026-08-11 by the live lane; the config was green\n // at boot throughout, because a variant satisfies every \"the op exists\" check and fails only when\n // a service-tier caller invokes it).\n //\n // The sibling `flows-actors-task` config states the same rule for the same reason and is the\n // pattern this follows: \"INTERNAL_CALL (not REPOSITORY_ONLY) is mandatory\". Keep the two in step —\n // both are written by the A2A runtime through `*AsSystem`, governed by `systemAccessPolicy` above\n // rather than by the op RBAC (`SYSTEM_WRITE_ROLES` gates nothing reachable here).\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n // The worker's lifecycle transitions, reached through `updateAsSystem` — so `INTERNAL_CALL` for\n // exactly the reason CREATE is, and broken the same way while it was not. Still no HTTP surface:\n // exposing UPDATE would let a caller mark its own undelivered notifications DELIVERED.\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n // Retention purging. Bulk twin of DELETE, and REPOSITORY_ONLY for the same reason: a trail an\n // owner can selectively erase is not a trail.\n [CoreResourceOperation.DELETE_MANY]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n polymorphicRole: SYSTEM_WRITE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n },\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-push-delivery-log.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-push-delivery-log.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"a2a-push-delivery-log.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-push-delivery-log.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,kDAAkD,CAAC;AAI1D;;;;;;;;;;;;GAYG;AACH,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;iBAqFnC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,EAAE,4BAA4B,EAI1E,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;kBAMnD,CAAC"}
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
*/
|
|
32
32
|
import { z } from 'zod';
|
|
33
33
|
import { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas.js';
|
|
34
|
-
import { addDataCategories, initZodDecorators } from '@wildo-ai/zod-decorators';
|
|
34
|
+
import { addDataCategories, initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';
|
|
35
|
+
import { RedactionType } from '../compliance/privacy/redaction.shared.schemas.js';
|
|
35
36
|
import { CoreResourceType, coreResourceShared_FieldIdentifier, } from '../resources/resources.shared.core.definitions.js';
|
|
36
37
|
import { declarePolymorphicSchemas, optOutPolymorphicAutoBusinessKey, } from '../resources/utils/resource-polymorphism.schemas.js';
|
|
37
38
|
initZodDecorators(z);
|
|
@@ -100,7 +101,10 @@ export const A2APushDeliveryLogSchema = z.object({
|
|
|
100
101
|
// `addDataCategories` rather than the fluent form: `z.unknown()` is one of the types that carry NO
|
|
101
102
|
// prototype-installed decorators at all (a decorator-WIDE gap, not specific to this one), so
|
|
102
103
|
// `.dataCategories(...)` does not type-check on it. The helper is the documented escape hatch.
|
|
103
|
-
payload
|
|
104
|
+
// REMOVE on erasure. The delivered payload carries the task's own content, which originated with the
|
|
105
|
+
// person — so it is content this row HOLDS. `z.unknown()` accepts null, so REMOVE is clearable here even
|
|
106
|
+
// though the field is not written `.optional()`.
|
|
107
|
+
payload: addImpersonalizeWith(addDataCategories(z.unknown(), PersonalDataCategory.USER_CONTENT), RedactionType.REMOVE),
|
|
104
108
|
status: z
|
|
105
109
|
.enum(A2APushDeliveryStatus)
|
|
106
110
|
.default(A2APushDeliveryStatus.PENDING)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-push-delivery-log.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-push-delivery-log.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEhF,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kDAAkD,CAAC;AAE1D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,4CAAmB,CAAA;IACnB,gDAAuB,CAAA;IACvB,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;AACnB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,0EAA0E;IAC1E,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE;IAEtD;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CA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AG,CAAC,gCAAgC,CAAC;CACjF,CAAC,CAAC","sourcesContent":["/**\n * A2A push-notification delivery log — one row per (task state change × registered webhook).\n *\n * ## Why this is a SIBLING of the M2M webhook delivery log rather than a variant of it\n *\n * The two share a delivery PATTERN — write the row before enqueueing, one queue job per row, the\n * worker classifies the response and either retries or terminates — and that pattern is reused\n * deliberately, down to the transport primitive. What they do not share is a SCOPE SET:\n * `M2MWebhookDeliveryLog` is stamped out for `ORGANIZATIONS` and `APPLICATION`, while an A2A task\n * can be owned by a **USER** as well. A delegated-user A2A caller is the ordinary case, not an edge\n * one, so extending the M2M resource would have meant adding a user-scoped variant — a whole\n * user-facing resource surface — to a shipped feature on behalf of a different subsystem.\n *\n * Keeping them separate also keeps the two producers separable in every query: a resource-operation\n * notification and a task-lifecycle notification are different facts about different things, and an\n * operator filtering one should never have to exclude the other by hand.\n *\n * ## Why the row is written BEFORE the delivery is attempted\n *\n * Copied from the M2M dispatcher's reasoning, because it is the property that makes this table\n * worth having: if the worker created the row on its first attempt, an unreachable queue would\n * leave no trace at all. Writing it up front means an operator always sees an entry per\n * (task transition × webhook), including the deliveries that never got as far as being tried.\n *\n * spec-cite: A2A 1.0 §4.3.3 — *\"Agents MUST attempt delivery at least once for each configured\n * webhook\"* — and §13.2, which asks for retry with exponential backoff and permits giving up after\n * a configured number of consecutive failures. This row is where all three become observable.\n *\n * @see notifications/m2m/m2m-webhook-delivery-log.shared.schemas.ts — the pattern this mirrors\n * @see a2a-token-budget-state.shared.schemas.ts — the 3-scope A2A polymorphic precedent\n */\n\nimport { z } from 'zod';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { addDataCategories, initZodDecorators } from '@wildo-ai/zod-decorators';\n\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n/**\n * The delivery lifecycle:\n * PENDING → IN_FLIGHT → DELIVERED (acknowledged with 2xx)\n * PENDING → IN_FLIGHT → PENDING (transient failure — retry scheduled with backoff)\n * PENDING → IN_FLIGHT → FAILED (terminal — non-retryable status, or attempts exhausted)\n *\n * Deliberately its OWN enum rather than a reuse of `M2MWebhookDeliveryLogStatus`, even though the\n * members coincide. That enum is named for, and owned by, the M2M notifications feature; importing\n * it here would couple flows-actors to that subsystem's release cycle for no gain, and would make\n * either feature's future state change a cross-feature edit. If a third outbound-delivery consumer\n * ever appears, the answer is to extract ONE shared vocabulary — not to have the second consumer\n * borrow the first one's.\n */\nexport enum A2APushDeliveryStatus {\n PENDING = 'pending',\n IN_FLIGHT = 'in_flight',\n DELIVERED = 'delivered',\n FAILED = 'failed',\n}\n\nexport const A2APushDeliveryLogSchema = z.object({\n /** Document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The stable identity of this delivery, generated once when the row is written and sent with\n * every attempt so a receiver can deduplicate.\n *\n * spec-cite: A2A 1.0 §4.3.3 — *\"Clients SHOULD process notifications idempotently, as duplicate\n * deliveries may occur\"*. A client can only honour that if duplicates are RECOGNISABLE, which\n * means the id must be stable across retries — hence generated at row creation, never per attempt.\n */\n deliveryId: z.string().min(1).isDBIndexed().isSummaryField(),\n\n /** The task whose transition triggered this notification. */\n taskId: z.string().min(1).isDBIndexed().isSummaryField(),\n\n /** Which registered configuration this row delivers to — a task may have several. */\n pushNotificationConfigId: z.string().min(1).isSummaryField(),\n\n /**\n * The agent instance the task belongs to. Carried so an operator can attribute deliveries per\n * agent, and so a per-instance purge never reaches another agent's rows — the same isolation\n * axis the task read enforces.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed().isSummaryField(),\n\n /**\n * The machine credential that owns the task, when one does.\n *\n * Carried because the worker must RE-READ the live configuration to obtain the client's\n * credential (see the worker for why the secret is not copied onto this row), and that read\n * enforces all four isolation axes. Without this field the read falls back to the \"no credential\"\n * sentinel and matches nothing for any task a machine client created — which is most A2A tasks,\n * since client-credentials auth is the ordinary way an agent connects.\n *\n * Optional rather than sentinel-defaulted: a delegated-user task genuinely has no machine\n * credential, and storing a sentinel here would make \"absent\" and \"explicitly none\" the same\n * value on a row whose whole job is to be evidence.\n */\n machineCredentialId: z.string().min(1).optional(),\n\n /** The destination, captured as it was AT DISPATCH — a later config edit must not rewrite history. */\n httpUrl: z.url(),\n\n payloadHash: z.string().min(1),\n // USER_CONTENT — the delivered payload carries the task's own content, which originated with the\n // person. The declaration says what the field is FOR; a payload can hold anything a task held.\n //\n // `addDataCategories` rather than the fluent form: `z.unknown()` is one of the types that carry NO\n // prototype-installed decorators at all (a decorator-WIDE gap, not specific to this one), so\n // `.dataCategories(...)` does not type-check on it. The helper is the documented escape hatch.\n payload: addDataCategories(z.unknown(), PersonalDataCategory.USER_CONTENT),\n\n status: z\n .enum(A2APushDeliveryStatus)\n .default(A2APushDeliveryStatus.PENDING)\n .isDBIndexed()\n .isSummaryField(),\n\n attemptCount: z.number().int().nonnegative().default(0).isSummaryField(),\n\n lastAttemptAt: z.date().optional(),\n /** When the next retry becomes eligible. Indexed — this is the worker's drain query. */\n nextAttemptAt: z.date().optional().isDBIndexed(),\n\n responseStatus: z.number().int().optional(),\n /** Truncated by the worker before persistence: a webhook may answer with an unbounded body. */\n responseBodyTruncated: z.string().optional(),\n failureReason: z.string().optional().isSummaryField(),\n\n deliveredAt: z.date().optional(),\n failedAt: z.date().optional(),\n\n createdAt: z\n .date()\n .default(() => new Date())\n .isDBIndexed()\n .isSummaryField(),\n});\n\nexport type A2APushDeliveryLogBase = z.infer<typeof A2APushDeliveryLogSchema>;\n\n/**\n * The three owner scopes an A2A task — and therefore its deliveries — can belong to.\n *\n * Mirrors `flowActorTasksPolymorphicDeclaration`'s scope set exactly, and must keep mirroring it: a\n * task owner with no delivery-log variant is a task whose notifications cannot be recorded, which\n * is the audit hole this table exists to close.\n */\nexport const A2A_PUSH_DELIVERY_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n];\n\n/**\n * Produces 3 variants:\n * - users → `userA2aPushDeliveryLog` (`userId` injected)\n * - organizations → `organizationA2aPushDeliveryLog` (`organizationId` injected)\n * - applications → `applicationA2aPushDeliveryLog` (`applicationId` injected)\n *\n * Multi-row, so it opts OUT of the singleton auto-business-key: unlike the token-budget\n * accumulator, there are many delivery rows per owner and the owner FK is not their identity.\n */\nexport const a2aPushDeliveryLogPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'a2aPushDeliveryLog',\n baseFieldIdentifier: 'a2aPushDeliveryLogId',\n baseEnumKey: 'A2A_PUSH_DELIVERY_LOG',\n baseSchema: A2APushDeliveryLogSchema,\n variants: A2A_PUSH_DELIVERY_SCOPE_VARIANTS.map(optOutPolymorphicAutoBusinessKey),\n});\n"]}
|
|
1
|
+
{"version":3,"file":"a2a-push-delivery-log.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-push-delivery-log.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,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E,CAAC;SACzB,WAAW,EAAE;SACb,cAAc,EAAE;CACpB,CAAC,CAAC;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAmC;IAC9E,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,KAAK,EAAU,qBAAqB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAU,cAAc,EAAE,IAAI,EAAE;IACvK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,aAAa,EAAE,qBAAqB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE;IACvK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,WAAW,EAAI,qBAAqB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAI,cAAc,EAAE,IAAI,EAAE;CACxK,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,yBAAyB,CAAC;IAChF,gBAAgB,EAAE,oBAAoB;IACtC,mBAAmB,EAAE,sBAAsB;IAC3C,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE,wBAAwB;IACpC,QAAQ,EAAE,gCAAgC,CAAC,GAAG,CAAC,gCAAgC,CAAC;CACjF,CAAC,CAAC","sourcesContent":["/**\n * A2A push-notification delivery log — one row per (task state change × registered webhook).\n *\n * ## Why this is a SIBLING of the M2M webhook delivery log rather than a variant of it\n *\n * The two share a delivery PATTERN — write the row before enqueueing, one queue job per row, the\n * worker classifies the response and either retries or terminates — and that pattern is reused\n * deliberately, down to the transport primitive. What they do not share is a SCOPE SET:\n * `M2MWebhookDeliveryLog` is stamped out for `ORGANIZATIONS` and `APPLICATION`, while an A2A task\n * can be owned by a **USER** as well. A delegated-user A2A caller is the ordinary case, not an edge\n * one, so extending the M2M resource would have meant adding a user-scoped variant — a whole\n * user-facing resource surface — to a shipped feature on behalf of a different subsystem.\n *\n * Keeping them separate also keeps the two producers separable in every query: a resource-operation\n * notification and a task-lifecycle notification are different facts about different things, and an\n * operator filtering one should never have to exclude the other by hand.\n *\n * ## Why the row is written BEFORE the delivery is attempted\n *\n * Copied from the M2M dispatcher's reasoning, because it is the property that makes this table\n * worth having: if the worker created the row on its first attempt, an unreachable queue would\n * leave no trace at all. Writing it up front means an operator always sees an entry per\n * (task transition × webhook), including the deliveries that never got as far as being tried.\n *\n * spec-cite: A2A 1.0 §4.3.3 — *\"Agents MUST attempt delivery at least once for each configured\n * webhook\"* — and §13.2, which asks for retry with exponential backoff and permits giving up after\n * a configured number of consecutive failures. This row is where all three become observable.\n *\n * @see notifications/m2m/m2m-webhook-delivery-log.shared.schemas.ts — the pattern this mirrors\n * @see a2a-token-budget-state.shared.schemas.ts — the 3-scope A2A polymorphic precedent\n */\n\nimport { z } from 'zod';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { addDataCategories, initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\n\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n/**\n * The delivery lifecycle:\n * PENDING → IN_FLIGHT → DELIVERED (acknowledged with 2xx)\n * PENDING → IN_FLIGHT → PENDING (transient failure — retry scheduled with backoff)\n * PENDING → IN_FLIGHT → FAILED (terminal — non-retryable status, or attempts exhausted)\n *\n * Deliberately its OWN enum rather than a reuse of `M2MWebhookDeliveryLogStatus`, even though the\n * members coincide. That enum is named for, and owned by, the M2M notifications feature; importing\n * it here would couple flows-actors to that subsystem's release cycle for no gain, and would make\n * either feature's future state change a cross-feature edit. If a third outbound-delivery consumer\n * ever appears, the answer is to extract ONE shared vocabulary — not to have the second consumer\n * borrow the first one's.\n */\nexport enum A2APushDeliveryStatus {\n PENDING = 'pending',\n IN_FLIGHT = 'in_flight',\n DELIVERED = 'delivered',\n FAILED = 'failed',\n}\n\nexport const A2APushDeliveryLogSchema = z.object({\n /** Document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * The stable identity of this delivery, generated once when the row is written and sent with\n * every attempt so a receiver can deduplicate.\n *\n * spec-cite: A2A 1.0 §4.3.3 — *\"Clients SHOULD process notifications idempotently, as duplicate\n * deliveries may occur\"*. A client can only honour that if duplicates are RECOGNISABLE, which\n * means the id must be stable across retries — hence generated at row creation, never per attempt.\n */\n deliveryId: z.string().min(1).isDBIndexed().isSummaryField(),\n\n /** The task whose transition triggered this notification. */\n taskId: z.string().min(1).isDBIndexed().isSummaryField(),\n\n /** Which registered configuration this row delivers to — a task may have several. */\n pushNotificationConfigId: z.string().min(1).isSummaryField(),\n\n /**\n * The agent instance the task belongs to. Carried so an operator can attribute deliveries per\n * agent, and so a per-instance purge never reaches another agent's rows — the same isolation\n * axis the task read enforces.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed().isSummaryField(),\n\n /**\n * The machine credential that owns the task, when one does.\n *\n * Carried because the worker must RE-READ the live configuration to obtain the client's\n * credential (see the worker for why the secret is not copied onto this row), and that read\n * enforces all four isolation axes. Without this field the read falls back to the \"no credential\"\n * sentinel and matches nothing for any task a machine client created — which is most A2A tasks,\n * since client-credentials auth is the ordinary way an agent connects.\n *\n * Optional rather than sentinel-defaulted: a delegated-user task genuinely has no machine\n * credential, and storing a sentinel here would make \"absent\" and \"explicitly none\" the same\n * value on a row whose whole job is to be evidence.\n */\n machineCredentialId: z.string().min(1).optional(),\n\n /** The destination, captured as it was AT DISPATCH — a later config edit must not rewrite history. */\n httpUrl: z.url(),\n\n payloadHash: z.string().min(1),\n // USER_CONTENT — the delivered payload carries the task's own content, which originated with the\n // person. The declaration says what the field is FOR; a payload can hold anything a task held.\n //\n // `addDataCategories` rather than the fluent form: `z.unknown()` is one of the types that carry NO\n // prototype-installed decorators at all (a decorator-WIDE gap, not specific to this one), so\n // `.dataCategories(...)` does not type-check on it. The helper is the documented escape hatch.\n // REMOVE on erasure. The delivered payload carries the task's own content, which originated with the\n // person — so it is content this row HOLDS. `z.unknown()` accepts null, so REMOVE is clearable here even\n // though the field is not written `.optional()`.\n payload: addImpersonalizeWith(\n addDataCategories(z.unknown(), PersonalDataCategory.USER_CONTENT),\n RedactionType.REMOVE,\n ),\n\n status: z\n .enum(A2APushDeliveryStatus)\n .default(A2APushDeliveryStatus.PENDING)\n .isDBIndexed()\n .isSummaryField(),\n\n attemptCount: z.number().int().nonnegative().default(0).isSummaryField(),\n\n lastAttemptAt: z.date().optional(),\n /** When the next retry becomes eligible. Indexed — this is the worker's drain query. */\n nextAttemptAt: z.date().optional().isDBIndexed(),\n\n responseStatus: z.number().int().optional(),\n /** Truncated by the worker before persistence: a webhook may answer with an unbounded body. */\n responseBodyTruncated: z.string().optional(),\n failureReason: z.string().optional().isSummaryField(),\n\n deliveredAt: z.date().optional(),\n failedAt: z.date().optional(),\n\n createdAt: z\n .date()\n .default(() => new Date())\n .isDBIndexed()\n .isSummaryField(),\n});\n\nexport type A2APushDeliveryLogBase = z.infer<typeof A2APushDeliveryLogSchema>;\n\n/**\n * The three owner scopes an A2A task — and therefore its deliveries — can belong to.\n *\n * Mirrors `flowActorTasksPolymorphicDeclaration`'s scope set exactly, and must keep mirroring it: a\n * task owner with no delivery-log variant is a task whose notifications cannot be recorded, which\n * is the audit hole this table exists to close.\n */\nexport const A2A_PUSH_DELIVERY_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n];\n\n/**\n * Produces 3 variants:\n * - users → `userA2aPushDeliveryLog` (`userId` injected)\n * - organizations → `organizationA2aPushDeliveryLog` (`organizationId` injected)\n * - applications → `applicationA2aPushDeliveryLog` (`applicationId` injected)\n *\n * Multi-row, so it opts OUT of the singleton auto-business-key: unlike the token-budget\n * accumulator, there are many delivery rows per owner and the owner FK is not their identity.\n */\nexport const a2aPushDeliveryLogPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'a2aPushDeliveryLog',\n baseFieldIdentifier: 'a2aPushDeliveryLogId',\n baseEnumKey: 'A2A_PUSH_DELIVERY_LOG',\n baseSchema: A2APushDeliveryLogSchema,\n variants: A2A_PUSH_DELIVERY_SCOPE_VARIANTS.map(optOutPolymorphicAutoBusinessKey),\n});\n"]}
|
|
@@ -57,5 +57,5 @@ import { CoreResourceOperation } from '../resources/resources.shared.core.defini
|
|
|
57
57
|
* - organizationA2aTokenBudgetState
|
|
58
58
|
* - applicationA2aTokenBudgetState
|
|
59
59
|
*/
|
|
60
|
-
export declare const a2aTokenBudgetStatePolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<undefined, CoreResourceOperation.READ | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE, any>>;
|
|
60
|
+
export declare const a2aTokenBudgetStatePolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<undefined, CoreResourceOperation.READ | CoreResourceOperation.UPDATE_MANY | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
|
|
61
61
|
//# sourceMappingURL=a2a-token-budget-state.shared.resources-config.schemas.d.ts.map
|
package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-token-budget-state.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"a2a-token-budget-state.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AA4BzG;;;;;;;;;GASG;AACH,eAAO,MAAM,uCAAuC,qPA8InD,CAAC"}
|
|
@@ -53,6 +53,7 @@ import { createPolymorphicResourceConfigurations } from '../resources/utils/reso
|
|
|
53
53
|
import { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas.js';
|
|
54
54
|
import { a2aTokenBudgetStatePolymorphicDeclaration } from './a2a-token-budget-state.shared.schemas.js';
|
|
55
55
|
import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
|
|
56
|
+
import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
|
|
56
57
|
/**
|
|
57
58
|
* Per-variant OWNER-READ role map. A tenant may inspect its OWN budget consumption (a
|
|
58
59
|
* read-only usage view: "how much of my allowance have I used?"). The scope authorizer +
|
|
@@ -91,12 +92,64 @@ export const a2aTokenBudgetStatePolymorphicFactories = createPolymorphicResource
|
|
|
91
92
|
read: ResourceSystemAccessMode.ALLOWED,
|
|
92
93
|
},
|
|
93
94
|
portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },
|
|
95
|
+
/**
|
|
96
|
+
* Subject erasure RETAINS this row and scrubs nothing, because there is nothing here to scrub.
|
|
97
|
+
*
|
|
98
|
+
* `RETAIN_ONLY` is a positive ASSERTION that this resource holds no personal data of its own. The row is a
|
|
99
|
+
* token-consumption accumulator: counters, a window boundary and the owner scope key. It declares no
|
|
100
|
+
* personal-data category, and its only link to a person is the scope FK, which the never-scrub floor
|
|
101
|
+
* protects in every mode.
|
|
102
|
+
*
|
|
103
|
+
* The assertion is CHECKED in both directions — the factory refuses `RETAIN_ONLY` if any field carries an
|
|
104
|
+
* impersonalize treatment, and if any non-floor field declares `.dataCategories()`.
|
|
105
|
+
*/
|
|
106
|
+
retentionPolicy: {
|
|
107
|
+
mode: ErasureRetentionMode.RETAIN_ONLY,
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR whose
|
|
111
|
+
* spend it accumulates — and the enum prescribes `NO_PRINCIPAL` for that shape. The subject's own session
|
|
112
|
+
* ends through the `USERS` row.
|
|
113
|
+
*/
|
|
114
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
|
|
94
115
|
coreOperations: [
|
|
95
116
|
CoreResourceOperation.CREATE,
|
|
96
117
|
CoreResourceOperation.READ,
|
|
97
118
|
CoreResourceOperation.DELETE,
|
|
119
|
+
// Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.
|
|
120
|
+
CoreResourceOperation.LIST,
|
|
121
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
98
122
|
],
|
|
99
123
|
operationsConfiguration: {
|
|
124
|
+
/*
|
|
125
|
+
|
|
126
|
+
* Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it
|
|
127
|
+
|
|
128
|
+
* must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,
|
|
129
|
+
|
|
130
|
+
* which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the
|
|
131
|
+
|
|
132
|
+
* HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the
|
|
133
|
+
|
|
134
|
+
* verb the impersonalize writer uses to stamp the retention markers.
|
|
135
|
+
|
|
136
|
+
*/
|
|
137
|
+
[CoreResourceOperation.LIST]: {
|
|
138
|
+
variants: [{
|
|
139
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
140
|
+
isDefault: true,
|
|
141
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
142
|
+
riskLevel: ResourceOperationRiskLevel.LOW,
|
|
143
|
+
}],
|
|
144
|
+
},
|
|
145
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
146
|
+
variants: [{
|
|
147
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
148
|
+
isDefault: true,
|
|
149
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
150
|
+
riskLevel: ResourceOperationRiskLevel.CRITICAL,
|
|
151
|
+
}],
|
|
152
|
+
},
|
|
100
153
|
// === CREATE === runtime opens the singleton on the first budgeted turn (createAsSystem).
|
|
101
154
|
// No explicit request DTO: auto-derives per variant so the injected owner FK is required.
|
|
102
155
|
[CoreResourceOperation.CREATE]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-token-budget-state.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3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AG;iBAC1C,CAAC;SACH;QAED,0FAA0F;QAC1F,oFAAoF;QACpF,2FAA2F;QAC3F,qFAAqF;QACrF,iEAAiE;QACjE,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE;YAC5B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,gBAAgB;oBACjC,SAAS,EAAE,0BAA0B,CAAC,GAAG;iBAC1C,CAAC;SACH;QAED,2FAA2F;QAC3F,yFAAyF;QAEzF,yFAAyF;QACzF,0EAA0E;QAC1E,EAAE;QACF,uFAAuF;QACvF,qFAAqF;QACrF,yFAAyF;QACzF,qFAAqF;QACrF,0DAA0D;QAC1D,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * A2A Token Budget State — Resource Configuration (POLYMORPHIC SINGLETON)\n * ======================================================================\n *\n * The per-tenant A2A LLM token-budget accumulator, stamped out as THREE owner-scope\n * singleton variants from one polymorphic declaration (`userA2aTokenBudgetState` /\n * `organizationA2aTokenBudgetState` / `applicationA2aTokenBudgetState`). Spread the\n * produced factories into the registry factory map:\n * ...a2aTokenBudgetStatePolymorphicFactories\n *\n * Access model — SYSTEM-WRITTEN, OWNER-READABLE:\n * - This is internal enforcement state, not user-authored data: only the A2A runtime WRITES\n * it, via `*AsSystem` (governed by `systemAccessPolicy`). The tenant may READ its own row\n * (a usage view: \"how much of my allowance have I used?\"), but never authors it.\n * - CREATE (`INTERNAL_CALL` super-admin, no explicit request DTO — it auto-derives per variant so\n * the injected owner FK is required on the correct variant) opens the singleton on the first\n * budgeted turn, via `createAsSystem`. `INTERNAL_CALL` (not `REPOSITORY_ONLY`) is mandatory\n * here: `*AsSystem` dispatches through the service tier and resolves the op via\n * `getServiceOperationPathDefault`, which only matches INTERNAL_CALL / API_CALL variants.\n * - There is deliberately NO `UPDATE` operation. Advancing the counter is an ATOMIC increment\n * (`RepositoriesRegistryHandlerBackendService.atomicIncrementField`) executed at the repository\n * tier, precisely so concurrent turns cannot lose tokens to a read-modify-write race — a\n * service-tier UPDATE cannot express that. Declaring an `UPDATE` op (with a DTO and a\n * `systemAccessPolicy.update` grant) would therefore be dead configuration describing a write\n * path nothing takes, and would invite a future contributor to route the counter through it and\n * silently reintroduce the race.\n * - DELETE is `INTERNAL_CALL` super-admin: it exists to satisfy the composition `onParentDelete`\n * cascade teardown (which runs at the repository tier and selects the operation-default DELETE,\n * irrespective of variant type), NOT to offer an HTTP surface. Deliberately NOT `API_CALL`:\n * zeroing this row zeroes recorded consumption, which is a SPEND-CAP BYPASS, so it gets no URL\n * at all — strictly stronger than relying on a role floor. (The role floor is nevertheless\n * platform-only for defence in depth.)\n * - READ is the ONE `API_CALL`, and it is owner-level on its own merit: a tenant inspecting its\n * own consumption (\"how much of my allowance have I used?\"). It is read-only, so it cannot\n * affect the cap.\n *\n * CASCADE NOTE (recorded because it was initially mis-diagnosed): the cascade's requirement is a\n * cardinality-appropriate DISCOVERY op + a DELETE teardown op — for a 1:1 child that is READ, for\n * 1:many it is LIST. It does NOT require a URL-isable variant: `supportsOperation` checks only\n * `isOperationDefault`, and a sole `INTERNAL_CALL` variant is the default within its own group.\n * The guard violation seen while building this resource came from the relationship declaring\n * `childCardinality: MANY` (the helper's default) on a SINGLETON — which demanded LIST, not READ.\n * Fixing the cardinality fixed it; verified by reverting DELETE to `INTERNAL_CALL` with the guard\n * still green.\n *\n * @see a2a-token-budget-state.shared.schemas.ts — the polymorphic declaration + base schema\n * @see flows-actors-execution.shared.resources-config.schemas.ts — the 3-scope polymorphic config precedent\n */\n\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { a2aTokenBudgetStatePolymorphicDeclaration } from './a2a-token-budget-state.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\n\n/**\n * Per-variant OWNER-READ role map. A tenant may inspect its OWN budget consumption (a\n * read-only usage view: \"how much of my allowance have I used?\"). The scope authorizer +\n * contextual filter isolate rows to the owner; the role is the operation floor.\n *\n * The APPLICATION variant is intentionally `APP_USER`, matching the `flowActorExecutions`\n * precedent: app-scope rows are app-wide state, so any authenticated app user can read the\n * application's aggregate A2A consumption. Tighten to an admin role if that telemetry is ever\n * considered sensitive — it reveals platform usage volume, not tenant content.\n */\nconst OWNER_READ_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_MEMBER],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_USER],\n};\n\n/**\n * Polymorphic factory map for the A2A token budget state. Spread into\n * `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...a2aTokenBudgetStatePolymorphicFactories\n *\n * Produces entries for:\n * - userA2aTokenBudgetState\n * - organizationA2aTokenBudgetState\n * - applicationA2aTokenBudgetState\n */\nexport const a2aTokenBudgetStatePolymorphicFactories = createPolymorphicResourceConfigurations(\n a2aTokenBudgetStatePolymorphicDeclaration,\n {\n isSystemResource: true,\n\n // Opt the A2A runtime (system actor) into scoped writes/reads on the tenant's behalf.\n // Absent this, every `*AsSystem` verb fails closed. Shared by all variants.\n // No `update` grant: the counter is advanced by an atomic repository-tier increment, never by\n // `updateAsSystem` (see the header). Granting it would authorise a path nothing takes.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own token-budget state. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.DELETE,\n ],\n\n operationsConfiguration: {\n // === CREATE === runtime opens the singleton on the first budgeted turn (createAsSystem).\n // No explicit request DTO: auto-derives per variant so the injected owner FK is required.\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === READ === the owner inspects its own consumption AND the runtime loads the singleton\n // for the pre-dispatch budget check (readAsSystem). `API_CALL` on its own merit — a\n // tenant-facing usage view — and read-only, so owner-level roles cannot affect the cap. It\n // ALSO serves as the cascade's 1:1 discovery op, though that would be satisfied by a\n // non-URL variant too (see the CASCADE NOTE in the file header).\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // (No UPDATE operation — the counter is advanced by an atomic repository-tier increment so\n // concurrent turns cannot lose tokens to a read-modify-write race. See the file header.)\n\n // === DELETE === teardown for the composition `onParentDelete` cascade (repository tier,\n // which selects the operation-default DELETE regardless of variant type).\n //\n // ⚠️ DELIBERATELY `INTERNAL_CALL` — NO HTTP ROUTE AT ALL. Deleting this row ZEROES the\n // tenant's recorded consumption, i.e. a SPEND-CAP BYPASS, so the strongest available\n // protection is to expose no URL rather than to guard one with a role. The platform-only\n // (`APP_ADMIN_SUPER_ADMIN`) floor is defence in depth on top of that. The cascade is\n // unaffected: it runs below both routing and role checks.\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"a2a-token-budget-state.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,yCAAyC,EAAE,MAAM,yCAAyC,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AAEvH;;;;;;;;;GASG;AACH,MAAM,gBAAgB,GAAG;IACvB,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;IACnD,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC;IAC7D,CAAC,gBAAgB,CAAC,WAAW,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AAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAE7C,SAAS,EAAE,0BAA0B,CAAC,QAAQ;iBAE/C,CAAC;SAEH;QAED,0FAA0F;QAC1F,0FAA0F;QAC1F,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,GAAG;iBAC1C,CAAC;SACH;QAED,0FAA0F;QAC1F,oFAAoF;QACpF,2FAA2F;QAC3F,qFAAqF;QACrF,iEAAiE;QACjE,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE;YAC5B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,gBAAgB;oBACjC,SAAS,EAAE,0BAA0B,CAAC,GAAG;iBAC1C,CAAC;SACH;QAED,2FAA2F;QAC3F,yFAAyF;QAEzF,yFAAyF;QACzF,0EAA0E;QAC1E,EAAE;QACF,uFAAuF;QACvF,qFAAqF;QACrF,yFAAyF;QACzF,qFAAqF;QACrF,0DAA0D;QAC1D,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * A2A Token Budget State — Resource Configuration (POLYMORPHIC SINGLETON)\n * ======================================================================\n *\n * The per-tenant A2A LLM token-budget accumulator, stamped out as THREE owner-scope\n * singleton variants from one polymorphic declaration (`userA2aTokenBudgetState` /\n * `organizationA2aTokenBudgetState` / `applicationA2aTokenBudgetState`). Spread the\n * produced factories into the registry factory map:\n * ...a2aTokenBudgetStatePolymorphicFactories\n *\n * Access model — SYSTEM-WRITTEN, OWNER-READABLE:\n * - This is internal enforcement state, not user-authored data: only the A2A runtime WRITES\n * it, via `*AsSystem` (governed by `systemAccessPolicy`). The tenant may READ its own row\n * (a usage view: \"how much of my allowance have I used?\"), but never authors it.\n * - CREATE (`INTERNAL_CALL` super-admin, no explicit request DTO — it auto-derives per variant so\n * the injected owner FK is required on the correct variant) opens the singleton on the first\n * budgeted turn, via `createAsSystem`. `INTERNAL_CALL` (not `REPOSITORY_ONLY`) is mandatory\n * here: `*AsSystem` dispatches through the service tier and resolves the op via\n * `getServiceOperationPathDefault`, which only matches INTERNAL_CALL / API_CALL variants.\n * - There is deliberately NO `UPDATE` operation. Advancing the counter is an ATOMIC increment\n * (`RepositoriesRegistryHandlerBackendService.atomicIncrementField`) executed at the repository\n * tier, precisely so concurrent turns cannot lose tokens to a read-modify-write race — a\n * service-tier UPDATE cannot express that. Declaring an `UPDATE` op (with a DTO and a\n * `systemAccessPolicy.update` grant) would therefore be dead configuration describing a write\n * path nothing takes, and would invite a future contributor to route the counter through it and\n * silently reintroduce the race.\n * - DELETE is `INTERNAL_CALL` super-admin: it exists to satisfy the composition `onParentDelete`\n * cascade teardown (which runs at the repository tier and selects the operation-default DELETE,\n * irrespective of variant type), NOT to offer an HTTP surface. Deliberately NOT `API_CALL`:\n * zeroing this row zeroes recorded consumption, which is a SPEND-CAP BYPASS, so it gets no URL\n * at all — strictly stronger than relying on a role floor. (The role floor is nevertheless\n * platform-only for defence in depth.)\n * - READ is the ONE `API_CALL`, and it is owner-level on its own merit: a tenant inspecting its\n * own consumption (\"how much of my allowance have I used?\"). It is read-only, so it cannot\n * affect the cap.\n *\n * CASCADE NOTE (recorded because it was initially mis-diagnosed): the cascade's requirement is a\n * cardinality-appropriate DISCOVERY op + a DELETE teardown op — for a 1:1 child that is READ, for\n * 1:many it is LIST. It does NOT require a URL-isable variant: `supportsOperation` checks only\n * `isOperationDefault`, and a sole `INTERNAL_CALL` variant is the default within its own group.\n * The guard violation seen while building this resource came from the relationship declaring\n * `childCardinality: MANY` (the helper's default) on a SINGLETON — which demanded LIST, not READ.\n * Fixing the cardinality fixed it; verified by reverting DELETE to `INTERNAL_CALL` with the guard\n * still green.\n *\n * @see a2a-token-budget-state.shared.schemas.ts — the polymorphic declaration + base schema\n * @see flows-actors-execution.shared.resources-config.schemas.ts — the 3-scope polymorphic config precedent\n */\n\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { a2aTokenBudgetStatePolymorphicDeclaration } from './a2a-token-budget-state.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\n/**\n * Per-variant OWNER-READ role map. A tenant may inspect its OWN budget consumption (a\n * read-only usage view: \"how much of my allowance have I used?\"). The scope authorizer +\n * contextual filter isolate rows to the owner; the role is the operation floor.\n *\n * The APPLICATION variant is intentionally `APP_USER`, matching the `flowActorExecutions`\n * precedent: app-scope rows are app-wide state, so any authenticated app user can read the\n * application's aggregate A2A consumption. Tighten to an admin role if that telemetry is ever\n * considered sensitive — it reveals platform usage volume, not tenant content.\n */\nconst OWNER_READ_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_MEMBER],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_USER],\n};\n\n/**\n * Polymorphic factory map for the A2A token budget state. Spread into\n * `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...a2aTokenBudgetStatePolymorphicFactories\n *\n * Produces entries for:\n * - userA2aTokenBudgetState\n * - organizationA2aTokenBudgetState\n * - applicationA2aTokenBudgetState\n */\nexport const a2aTokenBudgetStatePolymorphicFactories = createPolymorphicResourceConfigurations(\n a2aTokenBudgetStatePolymorphicDeclaration,\n {\n isSystemResource: true,\n\n // Opt the A2A runtime (system actor) into scoped writes/reads on the tenant's behalf.\n // Absent this, every `*AsSystem` verb fails closed. Shared by all variants.\n // No `update` grant: the counter is advanced by an atomic repository-tier increment, never by\n // `updateAsSystem` (see the header). Granting it would authorise a path nothing takes.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own token-budget state. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and scrubs nothing, because there is nothing here to scrub.\n *\n * `RETAIN_ONLY` is a positive ASSERTION that this resource holds no personal data of its own. The row is a\n * token-consumption accumulator: counters, a window boundary and the owner scope key. It declares no\n * personal-data category, and its only link to a person is the scope FK, which the never-scrub floor\n * protects in every mode.\n *\n * The assertion is CHECKED in both directions — the factory refuses `RETAIN_ONLY` if any field carries an\n * impersonalize treatment, and if any non-floor field declares `.dataCategories()`.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_ONLY,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR whose\n * spend it accumulates — and the enum prescribes `NO_PRINCIPAL` for that shape. The subject's own session\n * ends through the `USERS` row.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.DELETE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.LIST,\n CoreResourceOperation.UPDATE_MANY,\n ],\n\n operationsConfiguration: {\n\n /*\n\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n\n * verb the impersonalize writer uses to stamp the retention markers.\n\n */\n\n [CoreResourceOperation.LIST]: {\n\n variants: [{\n\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n\n isDefault: true,\n\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n\n riskLevel: ResourceOperationRiskLevel.LOW,\n\n }],\n\n },\n\n [CoreResourceOperation.UPDATE_MANY]: {\n\n variants: [{\n\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n\n isDefault: true,\n\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n\n }],\n\n },\n\n // === CREATE === runtime opens the singleton on the first budgeted turn (createAsSystem).\n // No explicit request DTO: auto-derives per variant so the injected owner FK is required.\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === READ === the owner inspects its own consumption AND the runtime loads the singleton\n // for the pre-dispatch budget check (readAsSystem). `API_CALL` on its own merit — a\n // tenant-facing usage view — and read-only, so owner-level roles cannot affect the cap. It\n // ALSO serves as the cascade's 1:1 discovery op, though that would be satisfied by a\n // non-URL variant too (see the CASCADE NOTE in the file header).\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // (No UPDATE operation — the counter is advanced by an atomic repository-tier increment so\n // concurrent turns cannot lose tokens to a read-modify-write race. See the file header.)\n\n // === DELETE === teardown for the composition `onParentDelete` cascade (repository tier,\n // which selects the operation-default DELETE regardless of variant type).\n //\n // ⚠️ DELIBERATELY `INTERNAL_CALL` — NO HTTP ROUTE AT ALL. Deleting this row ZEROES the\n // tenant's recorded consumption, i.e. a SPEND-CAP BYPASS, so the strongest available\n // protection is to expose no URL rather than to guard one with a role. The platform-only\n // (`APP_ADMIN_SUPER_ADMIN`) floor is defence in depth on top of that. The cascade is\n // unaffected: it runs below both routing and role checks.\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n },\n);\n"]}
|
|
@@ -44,5 +44,5 @@ import { CoreResourceOperation } from '../resources/resources.shared.core.defini
|
|
|
44
44
|
* - organizationFlowActorExecutions
|
|
45
45
|
* - applicationFlowActorExecutions
|
|
46
46
|
*/
|
|
47
|
-
export declare const flowActorExecutionsPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<undefined, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
|
|
47
|
+
export declare const flowActorExecutionsPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<undefined, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
|
|
48
48
|
//# sourceMappingURL=flows-actors-execution.shared.resources-config.schemas.d.ts.map
|
package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-execution.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"flows-actors-execution.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AA6DzG;;;;;;;;;GASG;AACH,eAAO,MAAM,uCAAuC,oRAiJnD,CAAC"}
|
|
@@ -39,6 +39,7 @@ import { ResourceSystemAccessMode } from '../resources/resources-config.shared.s
|
|
|
39
39
|
import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
|
|
40
40
|
import { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory.js';
|
|
41
41
|
import { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas.js';
|
|
42
|
+
import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
|
|
42
43
|
import { flowActorExecutionsPolymorphicDeclaration, FlowActorExecutionUpdateInternalSchema, } from './flows-actors-execution.shared.schemas.js';
|
|
43
44
|
/**
|
|
44
45
|
* Per-variant owner-read role map. A user reads its own executions (APP_USER, the
|
|
@@ -108,14 +109,56 @@ export const flowActorExecutionsPolymorphicFactories = createPolymorphicResource
|
|
|
108
109
|
update: ResourceSystemAccessMode.ALLOWED,
|
|
109
110
|
},
|
|
110
111
|
portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },
|
|
112
|
+
/**
|
|
113
|
+
* Subject erasure RETAINS this row and RESETS the conversation.
|
|
114
|
+
*
|
|
115
|
+
* `messages` is the conversation itself — the person's own words and the model's replies to them — so
|
|
116
|
+
* `RETAIN_ONLY` would be false and the factory refuses it. It is a defaulted array, so REMOVE (needs
|
|
117
|
+
* clearable) and MASK (needs a string) both refuse; `RedactionType.RESET` returns it to the empty default.
|
|
118
|
+
*
|
|
119
|
+
* Note the contrast with the sibling `flowActorTasks`, whose content fields are optional strings and take
|
|
120
|
+
* REMOVE. Same subsystem, same kind of content, different container — which is why RESET had to exist for
|
|
121
|
+
* this one to declare any posture at all.
|
|
122
|
+
*/
|
|
123
|
+
retentionPolicy: {
|
|
124
|
+
mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Erasing one of these rows revokes NO session. The row is work performed for a person, not the person; its
|
|
128
|
+
* owner FK names the scope the work ran in.
|
|
129
|
+
*/
|
|
130
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
|
|
111
131
|
coreOperations: [
|
|
112
132
|
CoreResourceOperation.CREATE,
|
|
113
133
|
CoreResourceOperation.READ,
|
|
114
134
|
CoreResourceOperation.UPDATE,
|
|
115
135
|
CoreResourceOperation.LIST,
|
|
116
136
|
CoreResourceOperation.DELETE,
|
|
137
|
+
// Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.
|
|
138
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
117
139
|
],
|
|
118
140
|
operationsConfiguration: {
|
|
141
|
+
/*
|
|
142
|
+
|
|
143
|
+
* Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it
|
|
144
|
+
|
|
145
|
+
* must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,
|
|
146
|
+
|
|
147
|
+
* which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the
|
|
148
|
+
|
|
149
|
+
* HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the
|
|
150
|
+
|
|
151
|
+
* verb the impersonalize writer uses to stamp the retention markers.
|
|
152
|
+
|
|
153
|
+
*/
|
|
154
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
155
|
+
variants: [{
|
|
156
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
157
|
+
isDefault: true,
|
|
158
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
159
|
+
riskLevel: ResourceOperationRiskLevel.CRITICAL,
|
|
160
|
+
}],
|
|
161
|
+
},
|
|
119
162
|
// === READ === owner reads their own execution (chat history)
|
|
120
163
|
[CoreResourceOperation.READ]: {
|
|
121
164
|
variants: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-execution.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EACL,yCAAyC,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,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,UAAU,EAAE,sCAAsC;iBACnD,CAAC;SACH;QAED,+EAA+E;QAC/E,6EAA6E;QAC7E,gFAAgF;QAChF,2EAA2E;QAC3E,oFAAoF;QACpF,kFAAkF;QAClF,8EAA8E;QAC9E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,kBAAkB;oBACnC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Flows-Actors Execution — Resource Configuration (POLYMORPHIC)\n * =============================================================\n *\n * Persisted flow/actor system executions (chat history + kind-discriminated\n * runtime state), stamped out as THREE owner-scope variants from one polymorphic\n * declaration (`userFlowActorExecutions` / `organizationFlowActorExecutions` /\n * `applicationFlowActorExecutions`). Spread the produced factories into the\n * registry factory map:\n * ...flowActorExecutionsPolymorphicFactories\n *\n * Scope + access model:\n * - Owner = the injected scope FK per variant (USER_SELF / ORGANIZATIONS /\n * APPLICATION primary scope). Default READ/LIST are `API_CALL`; their roles are\n * resolved PER VARIANT by `polymorphicRole` — a user reads its own (APP_USER +\n * USER_SELF filter), a machine reads its org/app variant with its granted org/app\n * role (ORG_MEMBER / APP_USER). Standard RBAC, no new role, no authorizer change.\n * - CREATE/UPDATE are `INTERNAL_CALL` super-admin: only the flows-actors\n * conversational runtime (a system actor) persists executions + appends messages,\n * via `*AsSystem` (governed by `systemAccessPolicy`, not the op RBAC). CREATE has\n * no explicit request DTO — it auto-derives per variant so the injected owner FK\n * (`userId` / `organizationId` / `applicationId`) is required on the correct variant.\n * UPDATE uses the shared owner-agnostic `FlowActorExecutionUpdateInternalSchema`.\n * INTERNAL_CALL (not REPOSITORY_ONLY) is mandatory: `*AsSystem` dispatches through\n * the service tier and resolves the op via `getServiceOperationPathDefault`, which\n * only matches INTERNAL_CALL / API_CALL variants.\n * - DELETE is a single owner-facing `API_CALL` (default) whose role floor is DISTINCT\n * from read (a user deletes only their own chat; org/app conversations require org/app\n * admin — `OWNER_DELETE_ROLES`). The same default op ALSO powers the composition\n * `onParentDelete` cascade at the repository tier (which selects the\n * `isOperationDefault === true` DELETE) — no `REPOSITORY_ONLY` variant needed.\n *\n * @see flows-actors-execution.shared.schemas.ts — the polymorphic declaration + base schema\n * @see billing-account.shared.resources-config.schemas.ts — the polymorphic config precedent\n */\n\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport {\n flowActorExecutionsPolymorphicDeclaration,\n FlowActorExecutionUpdateInternalSchema,\n} from './flows-actors-execution.shared.schemas';\n\n/**\n * Per-variant owner-read role map. A user reads its own executions (APP_USER, the\n * USER_SELF filter restricts to the caller's rows); a machine reads its org/app\n * variant with the role its API-key / OIDC-client was granted (ORG_MEMBER for an\n * org machine, APP_USER for an app machine). The scope authorizer +\n * contextual filter isolate rows to the owner; the role is the operation floor.\n */\nconst OWNER_READ_ROLES = {\n // USER variant: the scope FK IS the principal, so `APP_USER` plus the contextual filter yields\n // exactly \"my own rows\". Correct, and unchanged.\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n // ── MACHINE variants: ADMIN-only, and this is a CORRECTION (review finding F5-1) ──\n //\n // These previously granted `ORG_MEMBER` / `APP_USER`, inherited from the USER variant where that\n // is right. On the machine variants it is not: the scope FK does not identify the principal.\n // `applicationId` is a DEPLOYMENT SINGLETON, so every application-scope principal resolves to the\n // same contextual filter, and `organizationId` is shared by every machine client of one tenant.\n // The generic REST plane therefore let a PEER principal read another client's rows — the whole\n // `messages[]` log on an execution, and `title` (the opening 120 chars of the originating prompt)\n // on a task. That is exactly the cross-client disclosure the credential axis closed on the A2A\n // plane; the axis was applied there and not here, and both planes read the same rows.\n //\n // The resolution follows the reasoning the DELETE map below ALREADY documents: an org/app record\n // is SHARED SCOPE DATA, not owner data. Whoever administers the scope may inspect it; a peer\n // principal inside that scope may not. Roles are the framework's single authorization axis, so\n // this is expressed there rather than by inventing a second one.\n //\n // The A2A path is unaffected — it reads through `readAsSystem` and isolates by its own\n // owner + agent + credential filter, which is stricter than either role set.\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Per-variant DELETE role map. Delete authority is DELIBERATELY DISTINCT from read\n * (destroying a conversation ≠ reading it): a user deletes only their OWN chat\n * (APP_USER, USER_SELF-gated), but an org/app conversation is SHARED scope data, so\n * removing it requires ORG_ADMIN / APP_ADMIN_SUPER_ADMIN — not any org member / app\n * user who can merely read it. (Read-authority ⊉ delete-authority.)\n */\nconst OWNER_DELETE_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Polymorphic factory map for flows-actors executions. Spread into\n * `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...flowActorExecutionsPolymorphicFactories\n *\n * Produces entries for:\n * - userFlowActorExecutions\n * - organizationFlowActorExecutions\n * - applicationFlowActorExecutions\n */\nexport const flowActorExecutionsPolymorphicFactories = createPolymorphicResourceConfigurations(\n flowActorExecutionsPolymorphicDeclaration,\n {\n isSystemResource: true,\n\n // Opt the conversational runtime (system actor) into scoped writes/reads on the\n // owner's behalf. Absent this, every `*AsSystem` verb fails closed. Shared by\n // all variants per the polymorphic-resource contract.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own flow executions. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.LIST,\n CoreResourceOperation.DELETE,\n ],\n\n operationsConfiguration: {\n // === READ === owner reads their own execution (chat history)\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === LIST === owner lists their own executions (history index)\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === CREATE === system runtime opens an execution (via createAsSystem).\n // No explicit request DTO: auto-derives per variant so the injected owner FK\n // is required on the correct variant. Super-admin INTERNAL_CALL — the write is\n // governed by systemAccessPolicy, not this role.\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === UPDATE === system runtime appends messages / advances status.\n // Owner-agnostic shared DTO (owner is immutable).\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n requestDto: FlowActorExecutionUpdateInternalSchema,\n }],\n },\n\n // === DELETE === destructive removal of a conversation. Role floor is DISTINCT\n // from read (OWNER_DELETE_ROLES: a user deletes only their own chat; org/app\n // conversations require org/app admin). The single API_CALL default ALSO powers\n // the composition onParentDelete cascade — the repository tier selects the\n // `isOperationDefault === true` DELETE op (`repository-resource.backend.service.ts`\n // `delete()`), so NO separate REPOSITORY_ONLY variant is needed (billing cascades\n // identically with one default; a second variant would be inert scaffolding).\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_DELETE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n },\n ],\n },\n },\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"flows-actors-execution.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAA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A4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,gBAAgB;oBACjC,SAAS,EAAE,0BAA0B,CAAC,GAAG;iBAC1C,CAAC;SACH;QAED,yEAAyE;QACzE,6EAA6E;QAC7E,+EAA+E;QAC/E,iDAAiD;QACjD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,GAAG;iBAC1C,CAAC;SACH;QAED,oEAAoE;QACpE,kDAAkD;QAClD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC;oBAC7C,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,UAAU,EAAE,sCAAsC;iBACnD,CAAC;SACH;QAED,+EAA+E;QAC/E,6EAA6E;QAC7E,gFAAgF;QAChF,2EAA2E;QAC3E,oFAAoF;QACpF,kFAAkF;QAClF,8EAA8E;QAC9E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,kBAAkB;oBACnC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Flows-Actors Execution — Resource Configuration (POLYMORPHIC)\n * =============================================================\n *\n * Persisted flow/actor system executions (chat history + kind-discriminated\n * runtime state), stamped out as THREE owner-scope variants from one polymorphic\n * declaration (`userFlowActorExecutions` / `organizationFlowActorExecutions` /\n * `applicationFlowActorExecutions`). Spread the produced factories into the\n * registry factory map:\n * ...flowActorExecutionsPolymorphicFactories\n *\n * Scope + access model:\n * - Owner = the injected scope FK per variant (USER_SELF / ORGANIZATIONS /\n * APPLICATION primary scope). Default READ/LIST are `API_CALL`; their roles are\n * resolved PER VARIANT by `polymorphicRole` — a user reads its own (APP_USER +\n * USER_SELF filter), a machine reads its org/app variant with its granted org/app\n * role (ORG_MEMBER / APP_USER). Standard RBAC, no new role, no authorizer change.\n * - CREATE/UPDATE are `INTERNAL_CALL` super-admin: only the flows-actors\n * conversational runtime (a system actor) persists executions + appends messages,\n * via `*AsSystem` (governed by `systemAccessPolicy`, not the op RBAC). CREATE has\n * no explicit request DTO — it auto-derives per variant so the injected owner FK\n * (`userId` / `organizationId` / `applicationId`) is required on the correct variant.\n * UPDATE uses the shared owner-agnostic `FlowActorExecutionUpdateInternalSchema`.\n * INTERNAL_CALL (not REPOSITORY_ONLY) is mandatory: `*AsSystem` dispatches through\n * the service tier and resolves the op via `getServiceOperationPathDefault`, which\n * only matches INTERNAL_CALL / API_CALL variants.\n * - DELETE is a single owner-facing `API_CALL` (default) whose role floor is DISTINCT\n * from read (a user deletes only their own chat; org/app conversations require org/app\n * admin — `OWNER_DELETE_ROLES`). The same default op ALSO powers the composition\n * `onParentDelete` cascade at the repository tier (which selects the\n * `isOperationDefault === true` DELETE) — no `REPOSITORY_ONLY` variant needed.\n *\n * @see flows-actors-execution.shared.schemas.ts — the polymorphic declaration + base schema\n * @see billing-account.shared.resources-config.schemas.ts — the polymorphic config precedent\n */\n\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\nimport {\n flowActorExecutionsPolymorphicDeclaration,\n FlowActorExecutionUpdateInternalSchema,\n} from './flows-actors-execution.shared.schemas';\n\n/**\n * Per-variant owner-read role map. A user reads its own executions (APP_USER, the\n * USER_SELF filter restricts to the caller's rows); a machine reads its org/app\n * variant with the role its API-key / OIDC-client was granted (ORG_MEMBER for an\n * org machine, APP_USER for an app machine). The scope authorizer +\n * contextual filter isolate rows to the owner; the role is the operation floor.\n */\nconst OWNER_READ_ROLES = {\n // USER variant: the scope FK IS the principal, so `APP_USER` plus the contextual filter yields\n // exactly \"my own rows\". Correct, and unchanged.\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n // ── MACHINE variants: ADMIN-only, and this is a CORRECTION (review finding F5-1) ──\n //\n // These previously granted `ORG_MEMBER` / `APP_USER`, inherited from the USER variant where that\n // is right. On the machine variants it is not: the scope FK does not identify the principal.\n // `applicationId` is a DEPLOYMENT SINGLETON, so every application-scope principal resolves to the\n // same contextual filter, and `organizationId` is shared by every machine client of one tenant.\n // The generic REST plane therefore let a PEER principal read another client's rows — the whole\n // `messages[]` log on an execution, and `title` (the opening 120 chars of the originating prompt)\n // on a task. That is exactly the cross-client disclosure the credential axis closed on the A2A\n // plane; the axis was applied there and not here, and both planes read the same rows.\n //\n // The resolution follows the reasoning the DELETE map below ALREADY documents: an org/app record\n // is SHARED SCOPE DATA, not owner data. Whoever administers the scope may inspect it; a peer\n // principal inside that scope may not. Roles are the framework's single authorization axis, so\n // this is expressed there rather than by inventing a second one.\n //\n // The A2A path is unaffected — it reads through `readAsSystem` and isolates by its own\n // owner + agent + credential filter, which is stricter than either role set.\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Per-variant DELETE role map. Delete authority is DELIBERATELY DISTINCT from read\n * (destroying a conversation ≠ reading it): a user deletes only their OWN chat\n * (APP_USER, USER_SELF-gated), but an org/app conversation is SHARED scope data, so\n * removing it requires ORG_ADMIN / APP_ADMIN_SUPER_ADMIN — not any org member / app\n * user who can merely read it. (Read-authority ⊉ delete-authority.)\n */\nconst OWNER_DELETE_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Polymorphic factory map for flows-actors executions. Spread into\n * `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...flowActorExecutionsPolymorphicFactories\n *\n * Produces entries for:\n * - userFlowActorExecutions\n * - organizationFlowActorExecutions\n * - applicationFlowActorExecutions\n */\nexport const flowActorExecutionsPolymorphicFactories = createPolymorphicResourceConfigurations(\n flowActorExecutionsPolymorphicDeclaration,\n {\n isSystemResource: true,\n\n // Opt the conversational runtime (system actor) into scoped writes/reads on the\n // owner's behalf. Absent this, every `*AsSystem` verb fails closed. Shared by\n // all variants per the polymorphic-resource contract.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own flow executions. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and RESETS the conversation.\n *\n * `messages` is the conversation itself — the person's own words and the model's replies to them — so\n * `RETAIN_ONLY` would be false and the factory refuses it. It is a defaulted array, so REMOVE (needs\n * clearable) and MASK (needs a string) both refuse; `RedactionType.RESET` returns it to the empty default.\n *\n * Note the contrast with the sibling `flowActorTasks`, whose content fields are optional strings and take\n * REMOVE. Same subsystem, same kind of content, different container — which is why RESET had to exist for\n * this one to declare any posture at all.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is work performed for a person, not the person; its\n * owner FK names the scope the work ran in.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.LIST,\n CoreResourceOperation.DELETE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n\n operationsConfiguration: {\n\n /*\n\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n\n * verb the impersonalize writer uses to stamp the retention markers.\n\n */\n\n [CoreResourceOperation.UPDATE_MANY]: {\n\n variants: [{\n\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n\n isDefault: true,\n\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n\n }],\n\n },\n\n // === READ === owner reads their own execution (chat history)\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === LIST === owner lists their own executions (history index)\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === CREATE === system runtime opens an execution (via createAsSystem).\n // No explicit request DTO: auto-derives per variant so the injected owner FK\n // is required on the correct variant. Super-admin INTERNAL_CALL — the write is\n // governed by systemAccessPolicy, not this role.\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === UPDATE === system runtime appends messages / advances status.\n // Owner-agnostic shared DTO (owner is immutable).\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n requestDto: FlowActorExecutionUpdateInternalSchema,\n }],\n },\n\n // === DELETE === destructive removal of a conversation. Role floor is DISTINCT\n // from read (OWNER_DELETE_ROLES: a user deletes only their own chat; org/app\n // conversations require org/app admin). The single API_CALL default ALSO powers\n // the composition onParentDelete cascade — the repository tier selects the\n // `isOperationDefault === true` DELETE op (`repository-resource.backend.service.ts`\n // `delete()`), so NO separate REPOSITORY_ONLY variant is needed (billing cascades\n // identically with one default; a second variant would be inert scaffolding).\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_DELETE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n },\n ],\n },\n },\n },\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-execution.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA2E,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAGpJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"flows-actors-execution.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAA2E,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAGpJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAM5E,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,kDAAkD,CAAC;AAQ1D;;;;;GAKG;AACH,oBAAY,4BAA4B;IACtC,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED;;;;;GAKG;AACH,oBAAY,8BAA8B;IACxC,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,gCAAgC;;;;;;;iBAU3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC;;;;;;;iBA+BlD,CAAC;AACH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAExG,qFAAqF;AACrF,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,iCAAiC,GAAG,MAAM,CAEjG;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,iCAAiC,CAE3F;AAuBD;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;iBAoIvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAMlF;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC,EAAE,4BAA4B,EAIvC,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;kBAMpD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;iBAqBjD,CAAC;AAMH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
* log mirrors (`WS_FlowsActorsMessagePayloadSchema`)
|
|
32
32
|
*/
|
|
33
33
|
import { z } from 'zod';
|
|
34
|
-
import { initZodDecorators } from '@wildo-ai/zod-decorators';
|
|
34
|
+
import { initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';
|
|
35
35
|
import { FlowsActors_Status } from './flows-actors.commons.shared.schemas.js';
|
|
36
36
|
import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
|
|
37
37
|
import { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas.js';
|
|
38
38
|
import { FlowActorSystem_Kind } from './flows-actors.system.shared.schemas.js';
|
|
39
|
+
import { RedactionType } from '../compliance/privacy/redaction.shared.schemas.js';
|
|
39
40
|
import { CoreResourceType, coreResourceShared_FieldIdentifier, } from '../resources/resources.shared.core.definitions.js';
|
|
40
41
|
import { declarePolymorphicSchemas, optOutPolymorphicAutoBusinessKey, } from '../resources/utils/resource-polymorphism.schemas.js';
|
|
41
42
|
initZodDecorators(z);
|
|
@@ -240,11 +241,15 @@ export const FlowActorExecutionBaseSchema = z.object({
|
|
|
240
241
|
* The task family's `output`/`artifacts` are DERIVED by contrast, and that is not an
|
|
241
242
|
* inconsistency: those are model output ABOUT the work, with no subject-authored content mixed in.
|
|
242
243
|
*/
|
|
243
|
-
|
|
244
|
+
// RESET on erasure — returns this field to its schema default. It holds the conversation itself,
|
|
245
|
+
// which the category above correctly declares as personal data. RESET rather than REMOVE or MASK
|
|
246
|
+
// because the field is non-nullable WITH a `.default()`: REMOVE needs a clearable field and MASK
|
|
247
|
+
// needs a string. The value comes from the schema, so there is no second copy to drift.
|
|
248
|
+
messages: addImpersonalizeWith(FlowActorExecution_MessageSchema.array().default([])
|
|
244
249
|
.portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)
|
|
245
250
|
// The conversation itself. Category as well as provenance, so a notice can enumerate it: the two
|
|
246
251
|
// axes answer different questions and a provenance alone leaves the field an OUTSTANDING gap.
|
|
247
|
-
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
252
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT), RedactionType.RESET),
|
|
248
253
|
// === HITL (human-in-the-loop) suspension ===
|
|
249
254
|
/**
|
|
250
255
|
* Serialized {@link FlowActorExecution_PausedApproval} — present ONLY while `status` is
|