-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parser): Add
RunAttestationCommand
Can be used to get attestation responses from BotGuard, assuming you have a VM (retrieved using the `/att/get` endpoint, with engagement type set to `ENGAGEMENT_TYPE_UNBOUND`) loaded up.
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { YTNode } from '../../helpers.js'; | ||
import type { RawNode } from '../../types/index.js'; | ||
|
||
export type AttIds = { | ||
encrypted_video_id?: string; | ||
external_channel_id?: string; | ||
comment_id?: string; | ||
external_owner_id?: string; | ||
artist_id?: string; | ||
playlist_id?: string; | ||
external_post_id?: string; | ||
share_id?: string; | ||
} | ||
|
||
export default class RunAttestationCommand extends YTNode { | ||
static type = 'RunAttestationCommand'; | ||
|
||
public engagement_type: string; | ||
public ids?: AttIds[]; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.engagement_type = data.engagementType; | ||
if (Reflect.has(data, 'ids')) { | ||
this.ids = data.ids.map((id: RawNode) => ({ | ||
encrypted_video_id: id.encryptedVideoId, | ||
external_channel_id: id.externalChannelId, | ||
comment_id: id.commentId, | ||
external_owner_id: id.externalOwnerId, | ||
artist_id: id.artistId, | ||
playlist_id: id.playlistId, | ||
external_post_id: id.externalPostId, | ||
share_id: id.shareId | ||
})); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters