Skip to content

Commit

Permalink
feat: add stage instance related typings to audit logs (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
iShibi committed Jul 3, 2021
1 parent c5b6091 commit 836e8fb
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 4 deletions.
16 changes: 15 additions & 1 deletion deno/payloads/v8/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
import type { StageInstancePrivacyLevel } from './stageInstance.ts';

/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
Expand Down Expand Up @@ -135,6 +136,10 @@ export enum AuditLogEvent {
IntegrationCreate = 80,
IntegrationUpdate,
IntegrationDelete,

StageInstanceCreate = 83,
StageInstanceUpdate,
StageInstanceDelete,
}

/**
Expand Down Expand Up @@ -164,6 +169,9 @@ export interface APIAuditLogOptions {
* - MESSAGE_PIN
* - MESSAGE_UNPIN
* - MESSAGE_DELETE
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -284,7 +292,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit;
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel;

/**
* Returned when a guild's name is changed
Expand Down Expand Up @@ -563,6 +572,11 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
*/
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;

/**
* Returned when privacy level of a stage instance is changed
*/
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;

interface AuditLogChangeData<K extends string, D extends unknown> {
key: K;
/**
Expand Down
16 changes: 15 additions & 1 deletion deno/payloads/v9/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
import type { StageInstancePrivacyLevel } from './stageInstance.ts';

/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
Expand Down Expand Up @@ -135,6 +136,10 @@ export enum AuditLogEvent {
IntegrationCreate = 80,
IntegrationUpdate,
IntegrationDelete,

StageInstanceCreate = 83,
StageInstanceUpdate,
StageInstanceDelete,
}

/**
Expand Down Expand Up @@ -164,6 +169,9 @@ export interface APIAuditLogOptions {
* - MESSAGE_PIN
* - MESSAGE_UNPIN
* - MESSAGE_DELETE
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -284,7 +292,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit;
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel;

/**
* Returned when a guild's name is changed
Expand Down Expand Up @@ -563,6 +572,11 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
*/
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;

/**
* Returned when privacy level of a stage instance is changed
*/
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;

interface AuditLogChangeData<K extends string, D extends unknown> {
key: K;
/**
Expand Down
16 changes: 15 additions & 1 deletion payloads/v8/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
import type { APIRole } from './permissions';
import type { APIUser } from './user';
import type { APIWebhook } from './webhook';
import type { StageInstancePrivacyLevel } from './stageInstance';

/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
Expand Down Expand Up @@ -135,6 +136,10 @@ export const enum AuditLogEvent {
IntegrationCreate = 80,
IntegrationUpdate,
IntegrationDelete,

StageInstanceCreate = 83,
StageInstanceUpdate,
StageInstanceDelete,
}

/**
Expand Down Expand Up @@ -164,6 +169,9 @@ export interface APIAuditLogOptions {
* - MESSAGE_PIN
* - MESSAGE_UNPIN
* - MESSAGE_DELETE
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -284,7 +292,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit;
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel;

/**
* Returned when a guild's name is changed
Expand Down Expand Up @@ -563,6 +572,11 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
*/
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;

/**
* Returned when privacy level of a stage instance is changed
*/
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;

interface AuditLogChangeData<K extends string, D extends unknown> {
key: K;
/**
Expand Down
16 changes: 15 additions & 1 deletion payloads/v9/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
import type { APIRole } from './permissions';
import type { APIUser } from './user';
import type { APIWebhook } from './webhook';
import type { StageInstancePrivacyLevel } from './stageInstance';

/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
Expand Down Expand Up @@ -135,6 +136,10 @@ export const enum AuditLogEvent {
IntegrationCreate = 80,
IntegrationUpdate,
IntegrationDelete,

StageInstanceCreate = 83,
StageInstanceUpdate,
StageInstanceDelete,
}

/**
Expand Down Expand Up @@ -164,6 +169,9 @@ export interface APIAuditLogOptions {
* - MESSAGE_PIN
* - MESSAGE_UNPIN
* - MESSAGE_DELETE
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
*/
channel_id?: Snowflake;

Expand Down Expand Up @@ -284,7 +292,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit;
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel;

/**
* Returned when a guild's name is changed
Expand Down Expand Up @@ -563,6 +572,11 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
*/
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;

/**
* Returned when privacy level of a stage instance is changed
*/
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;

interface AuditLogChangeData<K extends string, D extends unknown> {
key: K;
/**
Expand Down

0 comments on commit 836e8fb

Please sign in to comment.