@aws-sdk/middleware-sdk-transcribe-streaming 3.489.0 → 3.496.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.eventStreamPayloadHandler = void 0;
4
- exports.eventStreamPayloadHandler = {
5
- handle: (next, args) => next(args),
6
- };
1
+ module.exports = require("./index.js");
@@ -1,12 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTranscribeStreamingPlugin = void 0;
4
- const middleware_inject_response_values_1 = require("./middleware-inject-response-values");
5
- const middleware_port_1 = require("./middleware-port");
6
- const getTranscribeStreamingPlugin = (config) => ({
7
- applyToStack: (clientStack) => {
8
- clientStack.addRelativeTo((0, middleware_port_1.websocketPortMiddleware)(config), middleware_port_1.websocketPortMiddlewareOptions);
9
- clientStack.add((0, middleware_inject_response_values_1.injectResponseValuesMiddleware)(config), middleware_inject_response_values_1.injectResponseValuesMiddlewareOptions);
10
- },
11
- });
12
- exports.getTranscribeStreamingPlugin = getTranscribeStreamingPlugin;
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,7 +1,102 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./eventstream-handler"), exports);
5
- tslib_1.__exportStar(require("./getTranscribeStreamingPlugin"), exports);
6
- tslib_1.__exportStar(require("./middleware-inject-response-values"), exports);
7
- tslib_1.__exportStar(require("./middleware-port"), exports);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ eventStreamPayloadHandler: () => eventStreamPayloadHandler,
24
+ getTranscribeStreamingPlugin: () => getTranscribeStreamingPlugin,
25
+ injectResponseValuesMiddleware: () => injectResponseValuesMiddleware,
26
+ injectResponseValuesMiddlewareOptions: () => injectResponseValuesMiddlewareOptions,
27
+ websocketPortMiddleware: () => websocketPortMiddleware,
28
+ websocketPortMiddlewareOptions: () => websocketPortMiddlewareOptions
29
+ });
30
+ module.exports = __toCommonJS(src_exports);
31
+
32
+ // src/eventstream-handler.ts
33
+ var eventStreamPayloadHandler = {
34
+ handle: (next, args) => next(args)
35
+ };
36
+
37
+ // src/middleware-inject-response-values.ts
38
+ var import_uuid = require("uuid");
39
+ var injectResponseValuesMiddleware = /* @__PURE__ */ __name((config) => (next) => async (args) => {
40
+ if (args.input.SessionId === void 0 && isWebSocket(config)) {
41
+ args.input.SessionId = (0, import_uuid.v4)();
42
+ }
43
+ const requestParams = {
44
+ ...args.input
45
+ };
46
+ const response = await next(args);
47
+ const output = response.output;
48
+ for (const key of Object.keys(output)) {
49
+ if (output[key] === void 0 && requestParams[key]) {
50
+ output[key] = requestParams[key];
51
+ }
52
+ }
53
+ return response;
54
+ }, "injectResponseValuesMiddleware");
55
+ var isWebSocket = /* @__PURE__ */ __name((config) => {
56
+ var _a, _b;
57
+ return (_b = (_a = config.requestHandler.metadata) == null ? void 0 : _a.handlerProtocol) == null ? void 0 : _b.includes("websocket");
58
+ }, "isWebSocket");
59
+ var injectResponseValuesMiddlewareOptions = {
60
+ step: "initialize",
61
+ name: "injectResponseValuesMiddleware",
62
+ tags: ["WEBSOCKET", "EVENT_STREAM"],
63
+ override: true
64
+ };
65
+
66
+ // src/middleware-port.ts
67
+ var import_protocol_http = require("@smithy/protocol-http");
68
+ var websocketPortMiddleware = /* @__PURE__ */ __name((options) => (next) => (args) => {
69
+ var _a, _b;
70
+ const { request } = args;
71
+ if (import_protocol_http.HttpRequest.isInstance(request) && ((_b = (_a = options.requestHandler.metadata) == null ? void 0 : _a.handlerProtocol) == null ? void 0 : _b.includes("websocket"))) {
72
+ request.hostname = `${request.hostname}:8443`;
73
+ request.headers.host = request.hostname;
74
+ }
75
+ return next(args);
76
+ }, "websocketPortMiddleware");
77
+ var websocketPortMiddlewareOptions = {
78
+ name: "websocketPortMiddleware",
79
+ tags: ["WEBSOCKET", "EVENT_STREAM", "PORT"],
80
+ relation: "after",
81
+ toMiddleware: "eventStreamHeaderMiddleware",
82
+ override: true
83
+ };
84
+
85
+ // src/getTranscribeStreamingPlugin.ts
86
+ var getTranscribeStreamingPlugin = /* @__PURE__ */ __name((config) => ({
87
+ applyToStack: (clientStack) => {
88
+ clientStack.addRelativeTo(websocketPortMiddleware(config), websocketPortMiddlewareOptions);
89
+ clientStack.add(injectResponseValuesMiddleware(config), injectResponseValuesMiddlewareOptions);
90
+ }
91
+ }), "getTranscribeStreamingPlugin");
92
+ // Annotate the CommonJS export names for ESM import in node:
93
+
94
+ 0 && (module.exports = {
95
+ eventStreamPayloadHandler,
96
+ getTranscribeStreamingPlugin,
97
+ injectResponseValuesMiddleware,
98
+ injectResponseValuesMiddlewareOptions,
99
+ websocketPortMiddleware,
100
+ websocketPortMiddlewareOptions
101
+ });
102
+
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.injectResponseValuesMiddlewareOptions = exports.injectResponseValuesMiddleware = void 0;
4
- const uuid_1 = require("uuid");
5
- const injectResponseValuesMiddleware = (config) => (next) => async (args) => {
6
- if (args.input.SessionId === undefined && isWebSocket(config)) {
7
- args.input.SessionId = (0, uuid_1.v4)();
8
- }
9
- const requestParams = {
10
- ...args.input,
11
- };
12
- const response = await next(args);
13
- const output = response.output;
14
- for (const key of Object.keys(output)) {
15
- if (output[key] === undefined && requestParams[key]) {
16
- output[key] = requestParams[key];
17
- }
18
- }
19
- return response;
20
- };
21
- exports.injectResponseValuesMiddleware = injectResponseValuesMiddleware;
22
- 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"); };
23
- exports.injectResponseValuesMiddlewareOptions = {
24
- step: "initialize",
25
- name: "injectResponseValuesMiddleware",
26
- tags: ["WEBSOCKET", "EVENT_STREAM"],
27
- override: true,
28
- };
1
+ module.exports = require("./index.js");
@@ -1,21 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.websocketPortMiddlewareOptions = exports.websocketPortMiddleware = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
5
- const websocketPortMiddleware = (options) => (next) => (args) => {
6
- var _a, _b;
7
- const { request } = args;
8
- 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"))) {
9
- request.hostname = `${request.hostname}:8443`;
10
- request.headers.host = request.hostname;
11
- }
12
- return next(args);
13
- };
14
- exports.websocketPortMiddleware = websocketPortMiddleware;
15
- exports.websocketPortMiddlewareOptions = {
16
- name: "websocketPortMiddleware",
17
- tags: ["WEBSOCKET", "EVENT_STREAM", "PORT"],
18
- relation: "after",
19
- toMiddleware: "eventStreamHeaderMiddleware",
20
- override: true,
21
- };
1
+ module.exports = require("./index.js");
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-sdk-transcribe-streaming",
3
- "version": "3.489.0",
3
+ "version": "3.496.0",
4
4
  "main": "./dist-cjs/index.js",
5
5
  "module": "./dist-es/index.js",
6
6
  "types": "./dist-types/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
9
- "build:cjs": "tsc -p tsconfig.cjs.json",
9
+ "build:cjs": "node ../../scripts/compilation/inline middleware-sdk-transcribe-streaming",
10
10
  "build:es": "tsc -p tsconfig.es.json",
11
11
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
12
12
  "build:types": "tsc -p tsconfig.types.json",
@@ -21,12 +21,12 @@
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@aws-sdk/types": "3.489.0",
25
- "@aws-sdk/util-format-url": "3.489.0",
26
- "@smithy/eventstream-serde-browser": "^2.0.16",
27
- "@smithy/protocol-http": "^3.0.12",
28
- "@smithy/signature-v4": "^2.0.0",
29
- "@smithy/types": "^2.8.0",
24
+ "@aws-sdk/types": "3.496.0",
25
+ "@aws-sdk/util-format-url": "3.496.0",
26
+ "@smithy/eventstream-serde-browser": "^2.1.1",
27
+ "@smithy/protocol-http": "^3.1.1",
28
+ "@smithy/signature-v4": "^2.1.1",
29
+ "@smithy/types": "^2.9.1",
30
30
  "tslib": "^2.5.0",
31
31
  "uuid": "^8.3.2"
32
32
  },