@aws-sdk/client-kinesis-video-archived-media 3.476.0 → 3.477.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,39 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.de_ListFragmentsCommand = exports.de_GetMediaForFragmentListCommand = exports.de_GetImagesCommand = exports.de_GetHLSStreamingSessionURLCommand = exports.de_GetDASHStreamingSessionURLCommand = exports.de_GetClipCommand = exports.se_ListFragmentsCommand = exports.se_GetMediaForFragmentListCommand = exports.se_GetImagesCommand = exports.se_GetHLSStreamingSessionURLCommand = exports.se_GetDASHStreamingSessionURLCommand = exports.se_GetClipCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
4
+ const core_1 = require("@smithy/core");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const KinesisVideoArchivedMediaServiceException_1 = require("../models/KinesisVideoArchivedMediaServiceException");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const se_GetClipCommand = async (input, context) => {
9
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
+ const b = (0, core_1.requestBuilder)(input, context);
10
10
  const headers = {
11
11
  "content-type": "application/json",
12
12
  };
13
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getClip";
13
+ b.bp("/getClip");
14
14
  let body;
15
15
  body = JSON.stringify((0, smithy_client_1.take)(input, {
16
16
  ClipFragmentSelector: (_) => se_ClipFragmentSelector(_, context),
17
17
  StreamARN: [],
18
18
  StreamName: [],
19
19
  }));
20
- return new protocol_http_1.HttpRequest({
21
- protocol,
22
- hostname,
23
- port,
24
- method: "POST",
25
- headers,
26
- path: resolvedPath,
27
- body,
28
- });
20
+ b.m("POST").h(headers).b(body);
21
+ return b.build();
29
22
  };
30
23
  exports.se_GetClipCommand = se_GetClipCommand;
31
24
  const se_GetDASHStreamingSessionURLCommand = async (input, context) => {
32
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
25
+ const b = (0, core_1.requestBuilder)(input, context);
33
26
  const headers = {
34
27
  "content-type": "application/json",
35
28
  };
36
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getDASHStreamingSessionURL";
29
+ b.bp("/getDASHStreamingSessionURL");
37
30
  let body;
38
31
  body = JSON.stringify((0, smithy_client_1.take)(input, {
39
32
  DASHFragmentSelector: (_) => se_DASHFragmentSelector(_, context),
@@ -45,23 +38,16 @@ const se_GetDASHStreamingSessionURLCommand = async (input, context) => {
45
38
  StreamARN: [],
46
39
  StreamName: [],
47
40
  }));
48
- return new protocol_http_1.HttpRequest({
49
- protocol,
50
- hostname,
51
- port,
52
- method: "POST",
53
- headers,
54
- path: resolvedPath,
55
- body,
56
- });
41
+ b.m("POST").h(headers).b(body);
42
+ return b.build();
57
43
  };
58
44
  exports.se_GetDASHStreamingSessionURLCommand = se_GetDASHStreamingSessionURLCommand;
59
45
  const se_GetHLSStreamingSessionURLCommand = async (input, context) => {
60
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
46
+ const b = (0, core_1.requestBuilder)(input, context);
61
47
  const headers = {
62
48
  "content-type": "application/json",
63
49
  };
64
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getHLSStreamingSessionURL";
50
+ b.bp("/getHLSStreamingSessionURL");
65
51
  let body;
66
52
  body = JSON.stringify((0, smithy_client_1.take)(input, {
67
53
  ContainerFormat: [],
@@ -74,23 +60,16 @@ const se_GetHLSStreamingSessionURLCommand = async (input, context) => {
74
60
  StreamARN: [],
75
61
  StreamName: [],
76
62
  }));
77
- return new protocol_http_1.HttpRequest({
78
- protocol,
79
- hostname,
80
- port,
81
- method: "POST",
82
- headers,
83
- path: resolvedPath,
84
- body,
85
- });
63
+ b.m("POST").h(headers).b(body);
64
+ return b.build();
86
65
  };
87
66
  exports.se_GetHLSStreamingSessionURLCommand = se_GetHLSStreamingSessionURLCommand;
88
67
  const se_GetImagesCommand = async (input, context) => {
89
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
68
+ const b = (0, core_1.requestBuilder)(input, context);
90
69
  const headers = {
91
70
  "content-type": "application/json",
92
71
  };
93
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getImages";
72
+ b.bp("/getImages");
94
73
  let body;
95
74
  body = JSON.stringify((0, smithy_client_1.take)(input, {
96
75
  EndTimestamp: (_) => Math.round(_.getTime() / 1000),
@@ -106,46 +85,32 @@ const se_GetImagesCommand = async (input, context) => {
106
85
  StreamName: [],
107
86
  WidthPixels: [],
108
87
  }));
109
- return new protocol_http_1.HttpRequest({
110
- protocol,
111
- hostname,
112
- port,
113
- method: "POST",
114
- headers,
115
- path: resolvedPath,
116
- body,
117
- });
88
+ b.m("POST").h(headers).b(body);
89
+ return b.build();
118
90
  };
119
91
  exports.se_GetImagesCommand = se_GetImagesCommand;
120
92
  const se_GetMediaForFragmentListCommand = async (input, context) => {
121
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
93
+ const b = (0, core_1.requestBuilder)(input, context);
122
94
  const headers = {
123
95
  "content-type": "application/json",
124
96
  };
125
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getMediaForFragmentList";
97
+ b.bp("/getMediaForFragmentList");
126
98
  let body;
127
99
  body = JSON.stringify((0, smithy_client_1.take)(input, {
128
100
  Fragments: (_) => (0, smithy_client_1._json)(_),
129
101
  StreamARN: [],
130
102
  StreamName: [],
131
103
  }));
132
- return new protocol_http_1.HttpRequest({
133
- protocol,
134
- hostname,
135
- port,
136
- method: "POST",
137
- headers,
138
- path: resolvedPath,
139
- body,
140
- });
104
+ b.m("POST").h(headers).b(body);
105
+ return b.build();
141
106
  };
142
107
  exports.se_GetMediaForFragmentListCommand = se_GetMediaForFragmentListCommand;
143
108
  const se_ListFragmentsCommand = async (input, context) => {
144
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
+ const b = (0, core_1.requestBuilder)(input, context);
145
110
  const headers = {
146
111
  "content-type": "application/json",
147
112
  };
148
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listFragments";
113
+ b.bp("/listFragments");
149
114
  let body;
150
115
  body = JSON.stringify((0, smithy_client_1.take)(input, {
151
116
  FragmentSelector: (_) => se_FragmentSelector(_, context),
@@ -154,15 +119,8 @@ const se_ListFragmentsCommand = async (input, context) => {
154
119
  StreamARN: [],
155
120
  StreamName: [],
156
121
  }));
157
- return new protocol_http_1.HttpRequest({
158
- protocol,
159
- hostname,
160
- port,
161
- method: "POST",
162
- headers,
163
- path: resolvedPath,
164
- body,
165
- });
122
+ b.m("POST").h(headers).b(body);
123
+ return b.build();
166
124
  };
167
125
  exports.se_ListFragmentsCommand = se_ListFragmentsCommand;
168
126
  const de_GetClipCommand = async (output, context) => {
@@ -171,7 +129,7 @@ const de_GetClipCommand = async (output, context) => {
171
129
  }
172
130
  const contents = (0, smithy_client_1.map)({
173
131
  $metadata: deserializeMetadata(output),
174
- ContentType: [, output.headers["content-type"]],
132
+ [_CT]: [, output.headers[_ct]],
175
133
  });
176
134
  const data = output.body;
177
135
  context.sdkStreamMixin(data);
@@ -382,7 +340,7 @@ const de_GetMediaForFragmentListCommand = async (output, context) => {
382
340
  }
383
341
  const contents = (0, smithy_client_1.map)({
384
342
  $metadata: deserializeMetadata(output),
385
- ContentType: [, output.headers["content-type"]],
343
+ [_CT]: [, output.headers[_ct]],
386
344
  });
387
345
  const data = output.body;
388
346
  context.sdkStreamMixin(data);
@@ -672,6 +630,8 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
672
630
  value !== "" &&
673
631
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
674
632
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
633
+ const _CT = "ContentType";
634
+ const _ct = "content-type";
675
635
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
676
636
  if (encoded.length) {
677
637
  return JSON.parse(encoded);
@@ -1,35 +1,28 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
2
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { KinesisVideoArchivedMediaServiceException as __BaseException } from "../models/KinesisVideoArchivedMediaServiceException";
4
4
  import { ClientLimitExceededException, InvalidArgumentException, InvalidCodecPrivateDataException, InvalidMediaFrameException, MissingCodecPrivateDataException, NoDataRetentionException, NotAuthorizedException, ResourceNotFoundException, UnsupportedStreamMediaTypeException, } from "../models/models_0";
5
5
  export const se_GetClipCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
6
+ const b = rb(input, context);
7
7
  const headers = {
8
8
  "content-type": "application/json",
9
9
  };
10
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getClip";
10
+ b.bp("/getClip");
11
11
  let body;
12
12
  body = JSON.stringify(take(input, {
13
13
  ClipFragmentSelector: (_) => se_ClipFragmentSelector(_, context),
14
14
  StreamARN: [],
15
15
  StreamName: [],
16
16
  }));
17
- return new __HttpRequest({
18
- protocol,
19
- hostname,
20
- port,
21
- method: "POST",
22
- headers,
23
- path: resolvedPath,
24
- body,
25
- });
17
+ b.m("POST").h(headers).b(body);
18
+ return b.build();
26
19
  };
27
20
  export const se_GetDASHStreamingSessionURLCommand = async (input, context) => {
28
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
21
+ const b = rb(input, context);
29
22
  const headers = {
30
23
  "content-type": "application/json",
31
24
  };
32
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getDASHStreamingSessionURL";
25
+ b.bp("/getDASHStreamingSessionURL");
33
26
  let body;
34
27
  body = JSON.stringify(take(input, {
35
28
  DASHFragmentSelector: (_) => se_DASHFragmentSelector(_, context),
@@ -41,22 +34,15 @@ export const se_GetDASHStreamingSessionURLCommand = async (input, context) => {
41
34
  StreamARN: [],
42
35
  StreamName: [],
43
36
  }));
44
- return new __HttpRequest({
45
- protocol,
46
- hostname,
47
- port,
48
- method: "POST",
49
- headers,
50
- path: resolvedPath,
51
- body,
52
- });
37
+ b.m("POST").h(headers).b(body);
38
+ return b.build();
53
39
  };
54
40
  export const se_GetHLSStreamingSessionURLCommand = async (input, context) => {
55
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41
+ const b = rb(input, context);
56
42
  const headers = {
57
43
  "content-type": "application/json",
58
44
  };
59
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getHLSStreamingSessionURL";
45
+ b.bp("/getHLSStreamingSessionURL");
60
46
  let body;
61
47
  body = JSON.stringify(take(input, {
62
48
  ContainerFormat: [],
@@ -69,22 +55,15 @@ export const se_GetHLSStreamingSessionURLCommand = async (input, context) => {
69
55
  StreamARN: [],
70
56
  StreamName: [],
71
57
  }));
72
- return new __HttpRequest({
73
- protocol,
74
- hostname,
75
- port,
76
- method: "POST",
77
- headers,
78
- path: resolvedPath,
79
- body,
80
- });
58
+ b.m("POST").h(headers).b(body);
59
+ return b.build();
81
60
  };
82
61
  export const se_GetImagesCommand = async (input, context) => {
83
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
62
+ const b = rb(input, context);
84
63
  const headers = {
85
64
  "content-type": "application/json",
86
65
  };
87
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getImages";
66
+ b.bp("/getImages");
88
67
  let body;
89
68
  body = JSON.stringify(take(input, {
90
69
  EndTimestamp: (_) => Math.round(_.getTime() / 1000),
@@ -100,44 +79,30 @@ export const se_GetImagesCommand = async (input, context) => {
100
79
  StreamName: [],
101
80
  WidthPixels: [],
102
81
  }));
103
- return new __HttpRequest({
104
- protocol,
105
- hostname,
106
- port,
107
- method: "POST",
108
- headers,
109
- path: resolvedPath,
110
- body,
111
- });
82
+ b.m("POST").h(headers).b(body);
83
+ return b.build();
112
84
  };
113
85
  export const se_GetMediaForFragmentListCommand = async (input, context) => {
114
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
86
+ const b = rb(input, context);
115
87
  const headers = {
116
88
  "content-type": "application/json",
117
89
  };
118
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getMediaForFragmentList";
90
+ b.bp("/getMediaForFragmentList");
119
91
  let body;
120
92
  body = JSON.stringify(take(input, {
121
93
  Fragments: (_) => _json(_),
122
94
  StreamARN: [],
123
95
  StreamName: [],
124
96
  }));
125
- return new __HttpRequest({
126
- protocol,
127
- hostname,
128
- port,
129
- method: "POST",
130
- headers,
131
- path: resolvedPath,
132
- body,
133
- });
97
+ b.m("POST").h(headers).b(body);
98
+ return b.build();
134
99
  };
135
100
  export const se_ListFragmentsCommand = async (input, context) => {
136
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
101
+ const b = rb(input, context);
137
102
  const headers = {
138
103
  "content-type": "application/json",
139
104
  };
140
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listFragments";
105
+ b.bp("/listFragments");
141
106
  let body;
142
107
  body = JSON.stringify(take(input, {
143
108
  FragmentSelector: (_) => se_FragmentSelector(_, context),
@@ -146,15 +111,8 @@ export const se_ListFragmentsCommand = async (input, context) => {
146
111
  StreamARN: [],
147
112
  StreamName: [],
148
113
  }));
149
- return new __HttpRequest({
150
- protocol,
151
- hostname,
152
- port,
153
- method: "POST",
154
- headers,
155
- path: resolvedPath,
156
- body,
157
- });
114
+ b.m("POST").h(headers).b(body);
115
+ return b.build();
158
116
  };
159
117
  export const de_GetClipCommand = async (output, context) => {
160
118
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -162,7 +120,7 @@ export const de_GetClipCommand = async (output, context) => {
162
120
  }
163
121
  const contents = map({
164
122
  $metadata: deserializeMetadata(output),
165
- ContentType: [, output.headers["content-type"]],
123
+ [_CT]: [, output.headers[_ct]],
166
124
  });
167
125
  const data = output.body;
168
126
  context.sdkStreamMixin(data);
@@ -369,7 +327,7 @@ export const de_GetMediaForFragmentListCommand = async (output, context) => {
369
327
  }
370
328
  const contents = map({
371
329
  $metadata: deserializeMetadata(output),
372
- ContentType: [, output.headers["content-type"]],
330
+ [_CT]: [, output.headers[_ct]],
373
331
  });
374
332
  const data = output.body;
375
333
  context.sdkStreamMixin(data);
@@ -657,6 +615,8 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
657
615
  value !== "" &&
658
616
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
659
617
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
618
+ const _CT = "ContentType";
619
+ const _ct = "content-type";
660
620
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
661
621
  if (encoded.length) {
662
622
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kinesis-video-archived-media",
3
3
  "description": "AWS SDK for JavaScript Kinesis Video Archived Media Client for Node.js, Browser and React Native",
4
- "version": "3.476.0",
4
+ "version": "3.477.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.476.0",
24
- "@aws-sdk/core": "3.476.0",
25
- "@aws-sdk/credential-provider-node": "3.476.0",
23
+ "@aws-sdk/client-sts": "3.477.0",
24
+ "@aws-sdk/core": "3.477.0",
25
+ "@aws-sdk/credential-provider-node": "3.477.0",
26
26
  "@aws-sdk/middleware-host-header": "3.468.0",
27
27
  "@aws-sdk/middleware-logger": "3.468.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.468.0",
@@ -34,6 +34,7 @@
34
34
  "@aws-sdk/util-user-agent-browser": "3.468.0",
35
35
  "@aws-sdk/util-user-agent-node": "3.470.0",
36
36
  "@smithy/config-resolver": "^2.0.21",
37
+ "@smithy/core": "^1.2.0",
37
38
  "@smithy/fetch-http-handler": "^2.3.1",
38
39
  "@smithy/hash-node": "^2.0.17",
39
40
  "@smithy/invalid-dependency": "^2.0.15",