@aws-sdk/client-mediastore-data 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,109 +1,73 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.de_PutObjectCommand = exports.de_ListItemsCommand = exports.de_GetObjectCommand = exports.de_DescribeObjectCommand = exports.de_DeleteObjectCommand = exports.se_PutObjectCommand = exports.se_ListItemsCommand = exports.se_GetObjectCommand = exports.se_DescribeObjectCommand = exports.se_DeleteObjectCommand = 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 MediaStoreDataServiceException_1 = require("../models/MediaStoreDataServiceException");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const se_DeleteObjectCommand = 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
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
12
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
11
+ b.bp("/{Path+}");
12
+ b.p("Path", () => input.Path, "{Path+}", true);
13
13
  let body;
14
- return new protocol_http_1.HttpRequest({
15
- protocol,
16
- hostname,
17
- port,
18
- method: "DELETE",
19
- headers,
20
- path: resolvedPath,
21
- body,
22
- });
14
+ b.m("DELETE").h(headers).b(body);
15
+ return b.build();
23
16
  };
24
17
  exports.se_DeleteObjectCommand = se_DeleteObjectCommand;
25
18
  const se_DescribeObjectCommand = async (input, context) => {
26
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
19
+ const b = (0, core_1.requestBuilder)(input, context);
27
20
  const headers = {};
28
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
29
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
21
+ b.bp("/{Path+}");
22
+ b.p("Path", () => input.Path, "{Path+}", true);
30
23
  let body;
31
- return new protocol_http_1.HttpRequest({
32
- protocol,
33
- hostname,
34
- port,
35
- method: "HEAD",
36
- headers,
37
- path: resolvedPath,
38
- body,
39
- });
24
+ b.m("HEAD").h(headers).b(body);
25
+ return b.build();
40
26
  };
41
27
  exports.se_DescribeObjectCommand = se_DescribeObjectCommand;
42
28
  const se_GetObjectCommand = async (input, context) => {
43
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
29
+ const b = (0, core_1.requestBuilder)(input, context);
44
30
  const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
45
- range: input.Range,
31
+ [_r]: input[_R],
46
32
  });
47
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
48
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
33
+ b.bp("/{Path+}");
34
+ b.p("Path", () => input.Path, "{Path+}", true);
49
35
  let body;
50
- return new protocol_http_1.HttpRequest({
51
- protocol,
52
- hostname,
53
- port,
54
- method: "GET",
55
- headers,
56
- path: resolvedPath,
57
- body,
58
- });
36
+ b.m("GET").h(headers).b(body);
37
+ return b.build();
59
38
  };
60
39
  exports.se_GetObjectCommand = se_GetObjectCommand;
61
40
  const se_ListItemsCommand = async (input, context) => {
62
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41
+ const b = (0, core_1.requestBuilder)(input, context);
63
42
  const headers = {};
64
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
43
+ b.bp("/");
65
44
  const query = (0, smithy_client_1.map)({
66
- Path: [, input.Path],
67
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
68
- NextToken: [, input.NextToken],
45
+ [_P]: [, input[_P]],
46
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
47
+ [_NT]: [, input[_NT]],
69
48
  });
70
49
  let body;
71
- return new protocol_http_1.HttpRequest({
72
- protocol,
73
- hostname,
74
- port,
75
- method: "GET",
76
- headers,
77
- path: resolvedPath,
78
- query,
79
- body,
80
- });
50
+ b.m("GET").h(headers).q(query).b(body);
51
+ return b.build();
81
52
  };
82
53
  exports.se_ListItemsCommand = se_ListItemsCommand;
83
54
  const se_PutObjectCommand = async (input, context) => {
84
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
55
+ const b = (0, core_1.requestBuilder)(input, context);
85
56
  const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
86
57
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
87
- "content-type": input.ContentType || "application/octet-stream",
88
- "cache-control": input.CacheControl,
89
- "x-amz-storage-class": input.StorageClass,
90
- "x-amz-upload-availability": input.UploadAvailability,
58
+ [_ct]: input[_CT] || "application/octet-stream",
59
+ [_cc]: input[_CC],
60
+ [_xasc]: input[_SC],
61
+ [_xaua]: input[_UA],
91
62
  });
92
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
93
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
63
+ b.bp("/{Path+}");
64
+ b.p("Path", () => input.Path, "{Path+}", true);
94
65
  let body;
95
66
  if (input.Body !== undefined) {
96
67
  body = input.Body;
97
68
  }
98
- return new protocol_http_1.HttpRequest({
99
- protocol,
100
- hostname,
101
- port,
102
- method: "PUT",
103
- headers,
104
- path: resolvedPath,
105
- body,
106
- });
69
+ b.m("PUT").h(headers).b(body);
70
+ return b.build();
107
71
  };
108
72
  exports.se_PutObjectCommand = se_PutObjectCommand;
109
73
  const de_DeleteObjectCommand = async (output, context) => {
@@ -148,17 +112,11 @@ const de_DescribeObjectCommand = async (output, context) => {
148
112
  }
149
113
  const contents = (0, smithy_client_1.map)({
150
114
  $metadata: deserializeMetadata(output),
151
- ETag: [, output.headers["etag"]],
152
- ContentType: [, output.headers["content-type"]],
153
- ContentLength: [
154
- () => void 0 !== output.headers["content-length"],
155
- () => (0, smithy_client_1.strictParseLong)(output.headers["content-length"]),
156
- ],
157
- CacheControl: [, output.headers["cache-control"]],
158
- LastModified: [
159
- () => void 0 !== output.headers["last-modified"],
160
- () => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers["last-modified"])),
161
- ],
115
+ [_ET]: [, output.headers[_e]],
116
+ [_CT]: [, output.headers[_ct]],
117
+ [_CL]: [() => void 0 !== output.headers[_cl], () => (0, smithy_client_1.strictParseLong)(output.headers[_cl])],
118
+ [_CC]: [, output.headers[_cc]],
119
+ [_LM]: [() => void 0 !== output.headers[_lm], () => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers[_lm]))],
162
120
  });
163
121
  await (0, smithy_client_1.collectBody)(output.body, context);
164
122
  return contents;
@@ -195,18 +153,12 @@ const de_GetObjectCommand = async (output, context) => {
195
153
  }
196
154
  const contents = (0, smithy_client_1.map)({
197
155
  $metadata: deserializeMetadata(output),
198
- CacheControl: [, output.headers["cache-control"]],
199
- ContentRange: [, output.headers["content-range"]],
200
- ContentLength: [
201
- () => void 0 !== output.headers["content-length"],
202
- () => (0, smithy_client_1.strictParseLong)(output.headers["content-length"]),
203
- ],
204
- ContentType: [, output.headers["content-type"]],
205
- ETag: [, output.headers["etag"]],
206
- LastModified: [
207
- () => void 0 !== output.headers["last-modified"],
208
- () => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers["last-modified"])),
209
- ],
156
+ [_CC]: [, output.headers[_cc]],
157
+ [_CR]: [, output.headers[_cr]],
158
+ [_CL]: [() => void 0 !== output.headers[_cl], () => (0, smithy_client_1.strictParseLong)(output.headers[_cl])],
159
+ [_CT]: [, output.headers[_ct]],
160
+ [_ET]: [, output.headers[_e]],
161
+ [_LM]: [() => void 0 !== output.headers[_lm], () => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc7231DateTime)(output.headers[_lm]))],
210
162
  });
211
163
  const data = output.body;
212
164
  context.sdkStreamMixin(data);
@@ -405,6 +357,27 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
405
357
  value !== "" &&
406
358
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
407
359
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
360
+ const _CC = "CacheControl";
361
+ const _CL = "ContentLength";
362
+ const _CR = "ContentRange";
363
+ const _CT = "ContentType";
364
+ const _ET = "ETag";
365
+ const _LM = "LastModified";
366
+ const _MR = "MaxResults";
367
+ const _NT = "NextToken";
368
+ const _P = "Path";
369
+ const _R = "Range";
370
+ const _SC = "StorageClass";
371
+ const _UA = "UploadAvailability";
372
+ const _cc = "cache-control";
373
+ const _cl = "content-length";
374
+ const _cr = "content-range";
375
+ const _ct = "content-type";
376
+ const _e = "etag";
377
+ const _lm = "last-modified";
378
+ const _r = "range";
379
+ const _xasc = "x-amz-storage-class";
380
+ const _xaua = "x-amz-upload-availability";
408
381
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
409
382
  if (encoded.length) {
410
383
  return JSON.parse(encoded);
@@ -1,102 +1,66 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
- import { collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, parseRfc7231DateTime as __parseRfc7231DateTime, resolvedPath as __resolvedPath, strictParseLong as __strictParseLong, take, withBaseException, } from "@smithy/smithy-client";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
+ import { collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, parseRfc7231DateTime as __parseRfc7231DateTime, strictParseLong as __strictParseLong, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { MediaStoreDataServiceException as __BaseException } from "../models/MediaStoreDataServiceException";
4
4
  import { ContainerNotFoundException, InternalServerError, ObjectNotFoundException, RequestedRangeNotSatisfiableException, } from "../models/models_0";
5
5
  export const se_DeleteObjectCommand = 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
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
9
- resolvedPath = __resolvedPath(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
8
+ b.bp("/{Path+}");
9
+ b.p("Path", () => input.Path, "{Path+}", true);
10
10
  let body;
11
- return new __HttpRequest({
12
- protocol,
13
- hostname,
14
- port,
15
- method: "DELETE",
16
- headers,
17
- path: resolvedPath,
18
- body,
19
- });
11
+ b.m("DELETE").h(headers).b(body);
12
+ return b.build();
20
13
  };
21
14
  export const se_DescribeObjectCommand = async (input, context) => {
22
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
15
+ const b = rb(input, context);
23
16
  const headers = {};
24
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
25
- resolvedPath = __resolvedPath(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
17
+ b.bp("/{Path+}");
18
+ b.p("Path", () => input.Path, "{Path+}", true);
26
19
  let body;
27
- return new __HttpRequest({
28
- protocol,
29
- hostname,
30
- port,
31
- method: "HEAD",
32
- headers,
33
- path: resolvedPath,
34
- body,
35
- });
20
+ b.m("HEAD").h(headers).b(body);
21
+ return b.build();
36
22
  };
37
23
  export const se_GetObjectCommand = async (input, context) => {
38
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
24
+ const b = rb(input, context);
39
25
  const headers = map({}, isSerializableHeaderValue, {
40
- range: input.Range,
26
+ [_r]: input[_R],
41
27
  });
42
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
43
- resolvedPath = __resolvedPath(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
28
+ b.bp("/{Path+}");
29
+ b.p("Path", () => input.Path, "{Path+}", true);
44
30
  let body;
45
- return new __HttpRequest({
46
- protocol,
47
- hostname,
48
- port,
49
- method: "GET",
50
- headers,
51
- path: resolvedPath,
52
- body,
53
- });
31
+ b.m("GET").h(headers).b(body);
32
+ return b.build();
54
33
  };
55
34
  export const se_ListItemsCommand = async (input, context) => {
56
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35
+ const b = rb(input, context);
57
36
  const headers = {};
58
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/";
37
+ b.bp("/");
59
38
  const query = map({
60
- Path: [, input.Path],
61
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
62
- NextToken: [, input.NextToken],
39
+ [_P]: [, input[_P]],
40
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
41
+ [_NT]: [, input[_NT]],
63
42
  });
64
43
  let body;
65
- return new __HttpRequest({
66
- protocol,
67
- hostname,
68
- port,
69
- method: "GET",
70
- headers,
71
- path: resolvedPath,
72
- query,
73
- body,
74
- });
44
+ b.m("GET").h(headers).q(query).b(body);
45
+ return b.build();
75
46
  };
76
47
  export const se_PutObjectCommand = async (input, context) => {
77
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
48
+ const b = rb(input, context);
78
49
  const headers = map({}, isSerializableHeaderValue, {
79
50
  "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
80
- "content-type": input.ContentType || "application/octet-stream",
81
- "cache-control": input.CacheControl,
82
- "x-amz-storage-class": input.StorageClass,
83
- "x-amz-upload-availability": input.UploadAvailability,
51
+ [_ct]: input[_CT] || "application/octet-stream",
52
+ [_cc]: input[_CC],
53
+ [_xasc]: input[_SC],
54
+ [_xaua]: input[_UA],
84
55
  });
85
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/{Path+}";
86
- resolvedPath = __resolvedPath(resolvedPath, input, "Path", () => input.Path, "{Path+}", true);
56
+ b.bp("/{Path+}");
57
+ b.p("Path", () => input.Path, "{Path+}", true);
87
58
  let body;
88
59
  if (input.Body !== undefined) {
89
60
  body = input.Body;
90
61
  }
91
- return new __HttpRequest({
92
- protocol,
93
- hostname,
94
- port,
95
- method: "PUT",
96
- headers,
97
- path: resolvedPath,
98
- body,
99
- });
62
+ b.m("PUT").h(headers).b(body);
63
+ return b.build();
100
64
  };
101
65
  export const de_DeleteObjectCommand = async (output, context) => {
102
66
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -139,17 +103,11 @@ export const de_DescribeObjectCommand = async (output, context) => {
139
103
  }
140
104
  const contents = map({
141
105
  $metadata: deserializeMetadata(output),
142
- ETag: [, output.headers["etag"]],
143
- ContentType: [, output.headers["content-type"]],
144
- ContentLength: [
145
- () => void 0 !== output.headers["content-length"],
146
- () => __strictParseLong(output.headers["content-length"]),
147
- ],
148
- CacheControl: [, output.headers["cache-control"]],
149
- LastModified: [
150
- () => void 0 !== output.headers["last-modified"],
151
- () => __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])),
152
- ],
106
+ [_ET]: [, output.headers[_e]],
107
+ [_CT]: [, output.headers[_ct]],
108
+ [_CL]: [() => void 0 !== output.headers[_cl], () => __strictParseLong(output.headers[_cl])],
109
+ [_CC]: [, output.headers[_cc]],
110
+ [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))],
153
111
  });
154
112
  await collectBody(output.body, context);
155
113
  return contents;
@@ -185,18 +143,12 @@ export const de_GetObjectCommand = async (output, context) => {
185
143
  }
186
144
  const contents = map({
187
145
  $metadata: deserializeMetadata(output),
188
- CacheControl: [, output.headers["cache-control"]],
189
- ContentRange: [, output.headers["content-range"]],
190
- ContentLength: [
191
- () => void 0 !== output.headers["content-length"],
192
- () => __strictParseLong(output.headers["content-length"]),
193
- ],
194
- ContentType: [, output.headers["content-type"]],
195
- ETag: [, output.headers["etag"]],
196
- LastModified: [
197
- () => void 0 !== output.headers["last-modified"],
198
- () => __expectNonNull(__parseRfc7231DateTime(output.headers["last-modified"])),
199
- ],
146
+ [_CC]: [, output.headers[_cc]],
147
+ [_CR]: [, output.headers[_cr]],
148
+ [_CL]: [() => void 0 !== output.headers[_cl], () => __strictParseLong(output.headers[_cl])],
149
+ [_CT]: [, output.headers[_ct]],
150
+ [_ET]: [, output.headers[_e]],
151
+ [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))],
200
152
  });
201
153
  const data = output.body;
202
154
  context.sdkStreamMixin(data);
@@ -392,6 +344,27 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
392
344
  value !== "" &&
393
345
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
394
346
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
347
+ const _CC = "CacheControl";
348
+ const _CL = "ContentLength";
349
+ const _CR = "ContentRange";
350
+ const _CT = "ContentType";
351
+ const _ET = "ETag";
352
+ const _LM = "LastModified";
353
+ const _MR = "MaxResults";
354
+ const _NT = "NextToken";
355
+ const _P = "Path";
356
+ const _R = "Range";
357
+ const _SC = "StorageClass";
358
+ const _UA = "UploadAvailability";
359
+ const _cc = "cache-control";
360
+ const _cl = "content-length";
361
+ const _cr = "content-range";
362
+ const _ct = "content-type";
363
+ const _e = "etag";
364
+ const _lm = "last-modified";
365
+ const _r = "range";
366
+ const _xasc = "x-amz-storage-class";
367
+ const _xaua = "x-amz-upload-availability";
395
368
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
396
369
  if (encoded.length) {
397
370
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-mediastore-data",
3
3
  "description": "AWS SDK for JavaScript Mediastore Data 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",
@@ -22,9 +22,9 @@
22
22
  "dependencies": {
23
23
  "@aws-crypto/sha256-browser": "3.0.0",
24
24
  "@aws-crypto/sha256-js": "3.0.0",
25
- "@aws-sdk/client-sts": "3.476.0",
26
- "@aws-sdk/core": "3.476.0",
27
- "@aws-sdk/credential-provider-node": "3.476.0",
25
+ "@aws-sdk/client-sts": "3.477.0",
26
+ "@aws-sdk/core": "3.477.0",
27
+ "@aws-sdk/credential-provider-node": "3.477.0",
28
28
  "@aws-sdk/middleware-host-header": "3.468.0",
29
29
  "@aws-sdk/middleware-logger": "3.468.0",
30
30
  "@aws-sdk/middleware-recursion-detection": "3.468.0",
@@ -36,6 +36,7 @@
36
36
  "@aws-sdk/util-user-agent-browser": "3.468.0",
37
37
  "@aws-sdk/util-user-agent-node": "3.470.0",
38
38
  "@smithy/config-resolver": "^2.0.21",
39
+ "@smithy/core": "^1.2.0",
39
40
  "@smithy/fetch-http-handler": "^2.3.1",
40
41
  "@smithy/hash-node": "^2.0.17",
41
42
  "@smithy/invalid-dependency": "^2.0.15",