Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@twurple/ebs-helper

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twurple/ebs-helper - npm Package Compare versions

Comparing version 6.1.0-pre.3 to 6.1.0

21

lib/helpers.external.d.ts

@@ -48,4 +48,4 @@ import { type UserIdResolvable } from '@twurple/common';

/** @private */
export declare function createPubSubMessageJwtData(broadcaster: UserIdResolvable | undefined, targets: string[]): {
channel_id: string | undefined;
export declare function createPubSubGlobalMessageJwtData(): {
channel_id: string;
pubsub_perms: {

@@ -56,7 +56,20 @@ send: string[];

/** @private */
export declare function createPubSubMessageBody(targets: string[], broadcaster: UserIdResolvable | undefined, message: string): {
export declare function createPubSubGlobalMessageBody(message: string): {
is_global_broadcast: boolean;
target: string[];
broadcaster_id: string | undefined;
message: string;
};
/** @private */
export declare function createPubSubMessageJwtData(broadcaster: UserIdResolvable, targets: string[]): {
channel_id: string;
pubsub_perms: {
send: string[];
};
};
/** @private */
export declare function createPubSubMessageBody(targets: string[], broadcaster: UserIdResolvable, message: string): {
target: string[];
broadcaster_id: string;
message: string;
};
//# sourceMappingURL=helpers.external.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createPubSubMessageBody = exports.createPubSubMessageJwtData = exports.createChatMessageBody = exports.createChatMessageJwtData = exports.createConfigurationSegmentBody = exports.createConfigurationSegmentQuery = exports.createExtensionRequiredConfigurationBody = exports.getExtensionSecretCreateQuery = exports.getExtensionSecretsQuery = exports.getExtensionQuery = void 0;
exports.createPubSubMessageBody = exports.createPubSubMessageJwtData = exports.createPubSubGlobalMessageBody = exports.createPubSubGlobalMessageJwtData = exports.createChatMessageBody = exports.createChatMessageJwtData = exports.createConfigurationSegmentBody = exports.createConfigurationSegmentQuery = exports.createExtensionRequiredConfigurationBody = exports.getExtensionSecretCreateQuery = exports.getExtensionSecretsQuery = exports.getExtensionQuery = void 0;
const shared_utils_1 = require("@d-fischer/shared-utils");

@@ -73,4 +73,18 @@ const common_1 = require("@twurple/common");

/** @private */
function createPubSubGlobalMessageJwtData() {
return { channel_id: 'all', pubsub_perms: { send: ['global'] } };
}
exports.createPubSubGlobalMessageJwtData = createPubSubGlobalMessageJwtData;
/** @private */
function createPubSubGlobalMessageBody(message) {
return {
is_global_broadcast: true,
target: ['global'],
message
};
}
exports.createPubSubGlobalMessageBody = createPubSubGlobalMessageBody;
/** @private */
function createPubSubMessageJwtData(broadcaster, targets) {
return { channel_id: (0, shared_utils_1.mapOptional)(broadcaster, common_1.extractUserId), pubsub_perms: { send: targets } };
return { channel_id: (0, common_1.extractUserId)(broadcaster), pubsub_perms: { send: targets } };
}

@@ -82,3 +96,3 @@ exports.createPubSubMessageJwtData = createPubSubMessageJwtData;

target: targets,
broadcaster_id: (0, shared_utils_1.mapOptional)(broadcaster, common_1.extractUserId),
broadcaster_id: (0, common_1.extractUserId)(broadcaster),
message

@@ -85,0 +99,0 @@ };

@@ -218,3 +218,11 @@ "use strict";

async function sendExtensionPubSubGlobalMessage(config, message) {
await sendAnyExtensionPubSubMessage(config, ['global'], message);
const jwt = (0, jwt_1.createExternalJwt)({
...config,
additionalData: (0, helpers_external_1.createPubSubGlobalMessageJwtData)()
});
await (0, api_call_1.callTwitchApi)({
url: 'extensions/pubsub',
method: 'POST',
jsonBody: (0, helpers_external_1.createPubSubGlobalMessageBody)(message)
}, config.clientId, jwt);
}

@@ -221,0 +229,0 @@ exports.sendExtensionPubSubGlobalMessage = sendExtensionPubSubGlobalMessage;

6

package.json
{
"name": "@twurple/ebs-helper",
"version": "6.1.0-pre.3",
"version": "6.1.0",
"publishConfig": {

@@ -37,4 +37,4 @@ "access": "public"

"@d-fischer/shared-utils": "^3.4.0",
"@twurple/api-call": "6.1.0-pre.3",
"@twurple/common": "6.1.0-pre.3",
"@twurple/api-call": "6.1.0",
"@twurple/common": "6.1.0",
"jsonwebtoken": "^8.5.1",

@@ -41,0 +41,0 @@ "tslib": "^2.0.3"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc