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

@aws-sdk/middleware-sdk-transcribe-streaming

Package Overview
Dependencies
Maintainers
5
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-sdk-transcribe-streaming - npm Package Compare versions

Comparing version 3.489.0 to 3.495.0

7

dist-cjs/eventstream-handler.js

@@ -1,6 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.eventStreamPayloadHandler = void 0;
exports.eventStreamPayloadHandler = {
handle: (next, args) => next(args),
};
module.exports = require("./index.js");

@@ -1,12 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTranscribeStreamingPlugin = void 0;
const middleware_inject_response_values_1 = require("./middleware-inject-response-values");
const middleware_port_1 = require("./middleware-port");
const getTranscribeStreamingPlugin = (config) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo((0, middleware_port_1.websocketPortMiddleware)(config), middleware_port_1.websocketPortMiddlewareOptions);
clientStack.add((0, middleware_inject_response_values_1.injectResponseValuesMiddleware)(config), middleware_inject_response_values_1.injectResponseValuesMiddlewareOptions);
},
});
exports.getTranscribeStreamingPlugin = getTranscribeStreamingPlugin;
module.exports = require("./index.js");

107

dist-cjs/index.js

@@ -1,7 +0,100 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./eventstream-handler"), exports);
tslib_1.__exportStar(require("./getTranscribeStreamingPlugin"), exports);
tslib_1.__exportStar(require("./middleware-inject-response-values"), exports);
tslib_1.__exportStar(require("./middleware-port"), exports);
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
eventStreamPayloadHandler: () => eventStreamPayloadHandler,
getTranscribeStreamingPlugin: () => getTranscribeStreamingPlugin,
injectResponseValuesMiddleware: () => injectResponseValuesMiddleware,
injectResponseValuesMiddlewareOptions: () => injectResponseValuesMiddlewareOptions,
websocketPortMiddleware: () => websocketPortMiddleware,
websocketPortMiddlewareOptions: () => websocketPortMiddlewareOptions
});
module.exports = __toCommonJS(src_exports);
// src/eventstream-handler.ts
var eventStreamPayloadHandler = {
handle: (next, args) => next(args)
};
// src/middleware-inject-response-values.ts
var import_uuid = require("uuid");
var injectResponseValuesMiddleware = /* @__PURE__ */ __name((config) => (next) => async (args) => {
if (args.input.SessionId === void 0 && isWebSocket(config)) {
args.input.SessionId = (0, import_uuid.v4)();
}
const requestParams = {
...args.input
};
const response = await next(args);
const output = response.output;
for (const key of Object.keys(output)) {
if (output[key] === void 0 && requestParams[key]) {
output[key] = requestParams[key];
}
}
return response;
}, "injectResponseValuesMiddleware");
var isWebSocket = /* @__PURE__ */ __name((config) => {
var _a, _b;
return (_b = (_a = config.requestHandler.metadata) == null ? void 0 : _a.handlerProtocol) == null ? void 0 : _b.includes("websocket");
}, "isWebSocket");
var injectResponseValuesMiddlewareOptions = {
step: "initialize",
name: "injectResponseValuesMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM"],
override: true
};
// src/middleware-port.ts
var import_protocol_http = require("@smithy/protocol-http");
var websocketPortMiddleware = /* @__PURE__ */ __name((options) => (next) => (args) => {
var _a, _b;
const { request } = args;
if (import_protocol_http.HttpRequest.isInstance(request) && ((_b = (_a = options.requestHandler.metadata) == null ? void 0 : _a.handlerProtocol) == null ? void 0 : _b.includes("websocket"))) {
request.hostname = `${request.hostname}:8443`;
request.headers.host = request.hostname;
}
return next(args);
}, "websocketPortMiddleware");
var websocketPortMiddlewareOptions = {
name: "websocketPortMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM", "PORT"],
relation: "after",
toMiddleware: "eventStreamHeaderMiddleware",
override: true
};
// src/getTranscribeStreamingPlugin.ts
var getTranscribeStreamingPlugin = /* @__PURE__ */ __name((config) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(websocketPortMiddleware(config), websocketPortMiddlewareOptions);
clientStack.add(injectResponseValuesMiddleware(config), injectResponseValuesMiddlewareOptions);
}
}), "getTranscribeStreamingPlugin");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
eventStreamPayloadHandler,
getTranscribeStreamingPlugin,
injectResponseValuesMiddleware,
injectResponseValuesMiddlewareOptions,
websocketPortMiddleware,
websocketPortMiddlewareOptions
});

@@ -1,28 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.injectResponseValuesMiddlewareOptions = exports.injectResponseValuesMiddleware = void 0;
const uuid_1 = require("uuid");
const injectResponseValuesMiddleware = (config) => (next) => async (args) => {
if (args.input.SessionId === undefined && isWebSocket(config)) {
args.input.SessionId = (0, uuid_1.v4)();
}
const requestParams = {
...args.input,
};
const response = await next(args);
const output = response.output;
for (const key of Object.keys(output)) {
if (output[key] === undefined && requestParams[key]) {
output[key] = requestParams[key];
}
}
return response;
};
exports.injectResponseValuesMiddleware = injectResponseValuesMiddleware;
const isWebSocket = (config) => { var _a, _b; return (_b = (_a = config.requestHandler.metadata) === null || _a === void 0 ? void 0 : _a.handlerProtocol) === null || _b === void 0 ? void 0 : _b.includes("websocket"); };
exports.injectResponseValuesMiddlewareOptions = {
step: "initialize",
name: "injectResponseValuesMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM"],
override: true,
};
module.exports = require("./index.js");

@@ -1,21 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.websocketPortMiddlewareOptions = exports.websocketPortMiddleware = void 0;
const protocol_http_1 = require("@smithy/protocol-http");
const websocketPortMiddleware = (options) => (next) => (args) => {
var _a, _b;
const { request } = args;
if (protocol_http_1.HttpRequest.isInstance(request) && ((_b = (_a = options.requestHandler.metadata) === null || _a === void 0 ? void 0 : _a.handlerProtocol) === null || _b === void 0 ? void 0 : _b.includes("websocket"))) {
request.hostname = `${request.hostname}:8443`;
request.headers.host = request.hostname;
}
return next(args);
};
exports.websocketPortMiddleware = websocketPortMiddleware;
exports.websocketPortMiddlewareOptions = {
name: "websocketPortMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM", "PORT"],
relation: "after",
toMiddleware: "eventStreamHeaderMiddleware",
override: true,
};
module.exports = require("./index.js");
{
"name": "@aws-sdk/middleware-sdk-transcribe-streaming",
"version": "3.489.0",
"version": "3.495.0",
"main": "./dist-cjs/index.js",

@@ -9,3 +9,3 @@ "module": "./dist-es/index.js",

"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:cjs": "node ../../scripts/compilation/inline middleware-sdk-transcribe-streaming",
"build:es": "tsc -p tsconfig.es.json",

@@ -25,8 +25,8 @@ "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",

"dependencies": {
"@aws-sdk/types": "3.489.0",
"@aws-sdk/util-format-url": "3.489.0",
"@smithy/eventstream-serde-browser": "^2.0.16",
"@smithy/protocol-http": "^3.0.12",
"@smithy/signature-v4": "^2.0.0",
"@smithy/types": "^2.8.0",
"@aws-sdk/types": "3.495.0",
"@aws-sdk/util-format-url": "3.495.0",
"@smithy/eventstream-serde-browser": "^2.1.0",
"@smithy/protocol-http": "^3.1.0",
"@smithy/signature-v4": "^2.1.0",
"@smithy/types": "^2.9.0",
"tslib": "^2.5.0",

@@ -33,0 +33,0 @@ "uuid": "^8.3.2"

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