Class: SanctionManager
Manages sanctions for a project.
Constructors
new SanctionManager()
Internal
Parameters
| Parameter | Type |
|---|---|
ctx | ClientContext |
projectId | string |
Returns
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:31
Methods
create()
Create a new sanction
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | Sanction creation payload |
body.endAt? | string | Description When the sanction ends (null = permanent) Example 2024-01-15T11:00:00Z |
body.externalUserId? | string | Description External user ID from ODIN (for cross-session sanctions) Example user_abc123 |
body.metadata? | Record<string, never> | Description Additional metadata (evidence, AI confidence, etc.) Example { * "confidence": 0.95, * "triggeredBy": "profanity_filter" * } |
body.participantId? | string | Description Participant ID to sanction (for session-scoped sanctions) Example 550e8400-e29b-41d4-a716-446655440000 |
body.reason? | string | Description Reason for the sanction Example Repeated use of profanity detected by automated filter |
body.scope? | Record<string, never> | Description Scope configuration for channel-specific sanctions Example { * "channels": [ * "team", * "proximity" * ] * } |
body.sessionId? | string | Description Session ID (for session-scoped sanctions) Example 550e8400-e29b-41d4-a716-446655440001 |
body.startAt? | string | Description When the sanction starts (defaults to now) Example 2024-01-15T10:00:00Z |
body.type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction to apply Example mute @enum {string} |
Returns
Promise<Sanction>
Live Sanction object
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:55
get()
Get a sanction by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
sanctionId | string | Sanction ID |
Returns
Promise<Sanction>
Live Sanction object
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:69
getActive()
Get active sanctions for a user
Parameters
| Parameter | Type | Description |
|---|---|---|
externalUserId | string | External user ID from ODIN |
query? | object | Optional filter by sanction type |
query.type? | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Filter by specific sanction type |
Returns
Promise<object[]>
Array of active sanctions
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:112
getByParticipant()
Get all sanctions for a participant
Parameters
| Parameter | Type | Description |
|---|---|---|
participantId | string | Participant ID |
Returns
Promise<object[]>
Array of sanctions
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:97
getByUser()
Get all sanctions for a user by external user ID
Parameters
| Parameter | Type | Description |
|---|---|---|
externalUserId | string | External user ID from ODIN |
Returns
Promise<object[]>
Array of sanctions
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:83
list()
List sanctions for this project
Parameters
| Parameter | Type | Description |
|---|---|---|
query? | object | Optional filters (type, activeOnly, limit, offset) |
query.activeOnly? | boolean | Description Only return active sanctions |
query.limit? | number | Description Pagination limit |
query.offset? | number | Description Pagination offset |
query.type? | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Filter by sanction type |
Returns
Promise<object>
Sanctions list with total count
| Name | Type | Description | Defined in |
|---|---|---|---|
sanctions | object[] | Description List of sanctions | 4Players/cortex-typescript-sdk/src/types.ts:4246 |
total | number | Description Total count (for pagination) | 4Players/cortex-typescript-sdk/src/types.ts:4248 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:41
watch()
watch()
Live-subscribe to sanctions. With no argument, watches the whole collection; with a sanction ID, watches that single sanction. A revoked sanction stays in the collection with an updated status (it is not removed).
Returns
CollectionSubscription<object>
A CollectionSubscription (no id) or DocumentSubscription (with id)
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3485 |
createdByUserId? | string | Description User who created the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3480 |
endAt? | string | Format: date-time Description When sanction expires (null = permanent) | 4Players/cortex-typescript-sdk/src/types.ts:3478 |
externalUserId? | string | Description External user ID | 4Players/cortex-typescript-sdk/src/types.ts:3455 |
id | string | Description Sanction ID | 4Players/cortex-typescript-sdk/src/types.ts:3449 |
isActive | boolean | Description Whether the sanction is currently active | 4Players/cortex-typescript-sdk/src/types.ts:3499 |
metadata? | Record<string, never> | Description Additional metadata | 4Players/cortex-typescript-sdk/src/types.ts:3468 |
participant? | object | Description Participant information (if available) | 4Players/cortex-typescript-sdk/src/types.ts:3503 |
participant.displayName | string | Description Display name of the participant | 4Players/cortex-typescript-sdk/src/types.ts:3436 |
participant.externalUserId | string | Description External user ID from ODIN | 4Players/cortex-typescript-sdk/src/types.ts:3438 |
participant.id | string | Description Participant ID | 4Players/cortex-typescript-sdk/src/types.ts:3432 |
participant.joinedAt? | string | Format: date-time Description When the participant first joined the project | 4Players/cortex-typescript-sdk/src/types.ts:3445 |
participant.projectId | string | Description ODIN project ID this participant belongs to | 4Players/cortex-typescript-sdk/src/types.ts:3434 |
participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) | 4Players/cortex-typescript-sdk/src/types.ts:3440 |
participantId? | string | Description Participant ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3453 |
reason? | string | Description Reason for sanction | 4Players/cortex-typescript-sdk/src/types.ts:3466 |
revokedAt? | string | Format: date-time Description When sanction was revoked | 4Players/cortex-typescript-sdk/src/types.ts:3495 |
revokedByUserId? | string | Description User who revoked the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3497 |
scope? | Record<string, never> | Description Scope configuration | 4Players/cortex-typescript-sdk/src/types.ts:3464 |
sessionId? | string | Description Session ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3457 |
startAt | string | Format: date-time Description When sanction becomes active | 4Players/cortex-typescript-sdk/src/types.ts:3473 |
status | string | Description Status: active, expired, or revoked | 4Players/cortex-typescript-sdk/src/types.ts:3501 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:3451 |
type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction | 4Players/cortex-typescript-sdk/src/types.ts:3462 |
updatedAt | string | Format: date-time Description Last update timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3490 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:127
watch(sanctionId)
Parameters
| Parameter | Type |
|---|---|
sanctionId | string |
Returns
DocumentSubscription<object>
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3485 |
createdByUserId? | string | Description User who created the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3480 |
endAt? | string | Format: date-time Description When sanction expires (null = permanent) | 4Players/cortex-typescript-sdk/src/types.ts:3478 |
externalUserId? | string | Description External user ID | 4Players/cortex-typescript-sdk/src/types.ts:3455 |
id | string | Description Sanction ID | 4Players/cortex-typescript-sdk/src/types.ts:3449 |
isActive | boolean | Description Whether the sanction is currently active | 4Players/cortex-typescript-sdk/src/types.ts:3499 |
metadata? | Record<string, never> | Description Additional metadata | 4Players/cortex-typescript-sdk/src/types.ts:3468 |
participant? | object | Description Participant information (if available) | 4Players/cortex-typescript-sdk/src/types.ts:3503 |
participant.displayName | string | Description Display name of the participant | 4Players/cortex-typescript-sdk/src/types.ts:3436 |
participant.externalUserId | string | Description External user ID from ODIN | 4Players/cortex-typescript-sdk/src/types.ts:3438 |
participant.id | string | Description Participant ID | 4Players/cortex-typescript-sdk/src/types.ts:3432 |
participant.joinedAt? | string | Format: date-time Description When the participant first joined the project | 4Players/cortex-typescript-sdk/src/types.ts:3445 |
participant.projectId | string | Description ODIN project ID this participant belongs to | 4Players/cortex-typescript-sdk/src/types.ts:3434 |
participant.userData? | Record<string, never> | Description User data from ODIN (parsed JSON) | 4Players/cortex-typescript-sdk/src/types.ts:3440 |
participantId? | string | Description Participant ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3453 |
reason? | string | Description Reason for sanction | 4Players/cortex-typescript-sdk/src/types.ts:3466 |
revokedAt? | string | Format: date-time Description When sanction was revoked | 4Players/cortex-typescript-sdk/src/types.ts:3495 |
revokedByUserId? | string | Description User who revoked the sanction | 4Players/cortex-typescript-sdk/src/types.ts:3497 |
scope? | Record<string, never> | Description Scope configuration | 4Players/cortex-typescript-sdk/src/types.ts:3464 |
sessionId? | string | Description Session ID (if session-scoped) | 4Players/cortex-typescript-sdk/src/types.ts:3457 |
startAt | string | Format: date-time Description When sanction becomes active | 4Players/cortex-typescript-sdk/src/types.ts:3473 |
status | string | Description Status: active, expired, or revoked | 4Players/cortex-typescript-sdk/src/types.ts:3501 |
tenantId | string | Description Tenant ID | 4Players/cortex-typescript-sdk/src/types.ts:3451 |
type | | "warn" | "mute" | "listen_only" | "text_only" | "rate_limit" | "shadow_mute" | "temp_ban" | "perm_ban" | "ranked_restriction" | "queue_delay" | "party_restriction" | "human_review" | Description Type of sanction | 4Players/cortex-typescript-sdk/src/types.ts:3462 |
updatedAt | string | Format: date-time Description Last update timestamp | 4Players/cortex-typescript-sdk/src/types.ts:3490 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sanctions.ts:128