@aws-sdk/client-sagemaker-metrics 3.490.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,13 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SageMakerMetrics = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- const BatchPutMetricsCommand_1 = require("./commands/BatchPutMetricsCommand");
6
- const SageMakerMetricsClient_1 = require("./SageMakerMetricsClient");
7
- const commands = {
8
- BatchPutMetricsCommand: BatchPutMetricsCommand_1.BatchPutMetricsCommand,
9
- };
10
- class SageMakerMetrics extends SageMakerMetricsClient_1.SageMakerMetricsClient {
11
- }
12
- exports.SageMakerMetrics = SageMakerMetrics;
13
- (0, smithy_client_1.createAggregatedClient)(commands, SageMakerMetrics);
1
+ module.exports = require("./index.js");
@@ -1,43 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SageMakerMetricsClient = exports.__Client = void 0;
4
- const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
5
- const middleware_logger_1 = require("@aws-sdk/middleware-logger");
6
- const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
7
- const middleware_signing_1 = require("@aws-sdk/middleware-signing");
8
- const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
9
- const config_resolver_1 = require("@smithy/config-resolver");
10
- const middleware_content_length_1 = require("@smithy/middleware-content-length");
11
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
12
- const middleware_retry_1 = require("@smithy/middleware-retry");
13
- const smithy_client_1 = require("@smithy/smithy-client");
14
- Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
15
- const EndpointParameters_1 = require("./endpoint/EndpointParameters");
16
- const runtimeConfig_1 = require("./runtimeConfig");
17
- const runtimeExtensions_1 = require("./runtimeExtensions");
18
- class SageMakerMetricsClient extends smithy_client_1.Client {
19
- constructor(...[configuration]) {
20
- const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
21
- const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
22
- const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1);
23
- const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2);
24
- const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3);
25
- const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
26
- const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5);
27
- const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6);
28
- const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
29
- super(_config_8);
30
- this.config = _config_8;
31
- this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
32
- this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
33
- this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
34
- this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
35
- this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
36
- this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(this.config));
37
- this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
38
- }
39
- destroy() {
40
- super.destroy();
41
- }
42
- }
43
- exports.SageMakerMetricsClient = SageMakerMetricsClient;
1
+ module.exports = require("./index.js");
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BatchPutMetricsCommand = exports.$Command = void 0;
4
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
- const middleware_serde_1 = require("@smithy/middleware-serde");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- const EndpointParameters_1 = require("../endpoint/EndpointParameters");
9
- const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
- class BatchPutMetricsCommand extends smithy_client_1.Command
11
- .classBuilder()
12
- .ep({
13
- ...EndpointParameters_1.commonParams,
14
- })
15
- .m(function (Command, cs, config, o) {
16
- return [
17
- (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
18
- (0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
19
- ];
20
- })
21
- .s("SageMakerMetricsService", "BatchPutMetrics", {})
22
- .n("SageMakerMetricsClient", "BatchPutMetricsCommand")
23
- .f(void 0, void 0)
24
- .ser(Aws_restJson1_1.se_BatchPutMetricsCommand)
25
- .de(Aws_restJson1_1.de_BatchPutMetricsCommand)
26
- .build() {
27
- }
28
- exports.BatchPutMetricsCommand = BatchPutMetricsCommand;
1
+ module.exports = require("../index.js");
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./BatchPutMetricsCommand"), exports);
1
+ module.exports = require("../index.js");
@@ -1,18 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commonParams = exports.resolveClientEndpointParameters = void 0;
4
- const resolveClientEndpointParameters = (options) => {
5
- return {
6
- ...options,
7
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
8
- useFipsEndpoint: options.useFipsEndpoint ?? false,
9
- defaultSigningName: "sagemaker",
10
- };
11
- };
12
- exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
13
- exports.commonParams = {
14
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
15
- Endpoint: { type: "builtInParams", name: "endpoint" },
16
- Region: { type: "builtInParams", name: "region" },
17
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
18
- };
1
+ module.exports = require("../index.js");
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,11 +1,298 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SageMakerMetricsServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./SageMakerMetricsClient"), exports);
6
- tslib_1.__exportStar(require("./SageMakerMetrics"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./models"), exports);
9
- require("@aws-sdk/util-endpoints");
10
- var SageMakerMetricsServiceException_1 = require("./models/SageMakerMetricsServiceException");
11
- Object.defineProperty(exports, "SageMakerMetricsServiceException", { enumerable: true, get: function () { return SageMakerMetricsServiceException_1.SageMakerMetricsServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ $Command: () => import_smithy_client.Command,
25
+ BatchPutMetricsCommand: () => BatchPutMetricsCommand,
26
+ PutMetricsErrorCode: () => PutMetricsErrorCode,
27
+ SageMakerMetrics: () => SageMakerMetrics,
28
+ SageMakerMetricsClient: () => SageMakerMetricsClient,
29
+ SageMakerMetricsServiceException: () => SageMakerMetricsServiceException,
30
+ __Client: () => import_smithy_client.Client,
31
+ __MetadataBearer: () => import_types.MetadataBearer
32
+ });
33
+ module.exports = __toCommonJS(src_exports);
34
+
35
+ // src/SageMakerMetricsClient.ts
36
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
37
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
38
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
39
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
40
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
41
+ var import_config_resolver = require("@smithy/config-resolver");
42
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
43
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
44
+ var import_middleware_retry = require("@smithy/middleware-retry");
45
+
46
+
47
+ // src/endpoint/EndpointParameters.ts
48
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
49
+ return {
50
+ ...options,
51
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
52
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
53
+ defaultSigningName: "sagemaker"
54
+ };
55
+ }, "resolveClientEndpointParameters");
56
+ var commonParams = {
57
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
58
+ Endpoint: { type: "builtInParams", name: "endpoint" },
59
+ Region: { type: "builtInParams", name: "region" },
60
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
61
+ };
62
+
63
+ // src/SageMakerMetricsClient.ts
64
+ var import_runtimeConfig = require("././runtimeConfig");
65
+
66
+ // src/runtimeExtensions.ts
67
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
68
+ var import_protocol_http = require("@smithy/protocol-http");
69
+ var import_smithy_client = require("@smithy/smithy-client");
70
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
71
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
72
+ const extensionConfiguration = {
73
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
74
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
75
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
76
+ };
77
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
78
+ return {
79
+ ...runtimeConfig,
80
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
81
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
82
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
83
+ };
84
+ }, "resolveRuntimeExtensions");
85
+
86
+ // src/SageMakerMetricsClient.ts
87
+ var _SageMakerMetricsClient = class _SageMakerMetricsClient extends import_smithy_client.Client {
88
+ constructor(...[configuration]) {
89
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
90
+ const _config_1 = resolveClientEndpointParameters(_config_0);
91
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
92
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
93
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
94
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
95
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
96
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
97
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
98
+ super(_config_8);
99
+ this.config = _config_8;
100
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
101
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
102
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
103
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
104
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
105
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
106
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
107
+ }
108
+ /**
109
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
110
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
111
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
112
+ */
113
+ destroy() {
114
+ super.destroy();
115
+ }
116
+ };
117
+ __name(_SageMakerMetricsClient, "SageMakerMetricsClient");
118
+ var SageMakerMetricsClient = _SageMakerMetricsClient;
119
+
120
+ // src/SageMakerMetrics.ts
121
+
122
+
123
+ // src/commands/BatchPutMetricsCommand.ts
124
+
125
+ var import_middleware_serde = require("@smithy/middleware-serde");
126
+
127
+ var import_types = require("@smithy/types");
128
+
129
+ // src/protocols/Aws_restJson1.ts
130
+ var import_core = require("@smithy/core");
131
+
132
+
133
+ // src/models/SageMakerMetricsServiceException.ts
134
+
135
+ var _SageMakerMetricsServiceException = class _SageMakerMetricsServiceException extends import_smithy_client.ServiceException {
136
+ /**
137
+ * @internal
138
+ */
139
+ constructor(options) {
140
+ super(options);
141
+ Object.setPrototypeOf(this, _SageMakerMetricsServiceException.prototype);
142
+ }
143
+ };
144
+ __name(_SageMakerMetricsServiceException, "SageMakerMetricsServiceException");
145
+ var SageMakerMetricsServiceException = _SageMakerMetricsServiceException;
146
+
147
+ // src/protocols/Aws_restJson1.ts
148
+ var se_BatchPutMetricsCommand = /* @__PURE__ */ __name(async (input, context) => {
149
+ const b = (0, import_core.requestBuilder)(input, context);
150
+ const headers = {
151
+ "content-type": "application/json"
152
+ };
153
+ b.bp("/BatchPutMetrics");
154
+ let body;
155
+ body = JSON.stringify(
156
+ (0, import_smithy_client.take)(input, {
157
+ MetricData: (_) => se_RawMetricDataList(_, context),
158
+ TrialComponentName: []
159
+ })
160
+ );
161
+ b.m("PUT").h(headers).b(body);
162
+ return b.build();
163
+ }, "se_BatchPutMetricsCommand");
164
+ var de_BatchPutMetricsCommand = /* @__PURE__ */ __name(async (output, context) => {
165
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
166
+ return de_BatchPutMetricsCommandError(output, context);
167
+ }
168
+ const contents = (0, import_smithy_client.map)({
169
+ $metadata: deserializeMetadata(output)
170
+ });
171
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
172
+ const doc = (0, import_smithy_client.take)(data, {
173
+ Errors: import_smithy_client._json
174
+ });
175
+ Object.assign(contents, doc);
176
+ return contents;
177
+ }, "de_BatchPutMetricsCommand");
178
+ var de_BatchPutMetricsCommandError = /* @__PURE__ */ __name(async (output, context) => {
179
+ const parsedOutput = {
180
+ ...output,
181
+ body: await parseErrorBody(output.body, context)
182
+ };
183
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
184
+ const parsedBody = parsedOutput.body;
185
+ return throwDefaultError({
186
+ output,
187
+ parsedBody,
188
+ errorCode
189
+ });
190
+ }, "de_BatchPutMetricsCommandError");
191
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(SageMakerMetricsServiceException);
192
+ var se_RawMetricData = /* @__PURE__ */ __name((input, context) => {
193
+ return (0, import_smithy_client.take)(input, {
194
+ MetricName: [],
195
+ Step: [],
196
+ Timestamp: (_) => Math.round(_.getTime() / 1e3),
197
+ Value: import_smithy_client.serializeFloat
198
+ });
199
+ }, "se_RawMetricData");
200
+ var se_RawMetricDataList = /* @__PURE__ */ __name((input, context) => {
201
+ return input.filter((e) => e != null).map((entry) => {
202
+ return se_RawMetricData(entry, context);
203
+ });
204
+ }, "se_RawMetricDataList");
205
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
206
+ httpStatusCode: output.statusCode,
207
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
208
+ extendedRequestId: output.headers["x-amz-id-2"],
209
+ cfId: output.headers["x-amz-cf-id"]
210
+ }), "deserializeMetadata");
211
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
212
+ var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
213
+ if (encoded.length) {
214
+ return JSON.parse(encoded);
215
+ }
216
+ return {};
217
+ }), "parseBody");
218
+ var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
219
+ const value = await parseBody(errorBody, context);
220
+ value.message = value.message ?? value.Message;
221
+ return value;
222
+ }, "parseErrorBody");
223
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
224
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
225
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
226
+ let cleanValue = rawValue;
227
+ if (typeof cleanValue === "number") {
228
+ cleanValue = cleanValue.toString();
229
+ }
230
+ if (cleanValue.indexOf(",") >= 0) {
231
+ cleanValue = cleanValue.split(",")[0];
232
+ }
233
+ if (cleanValue.indexOf(":") >= 0) {
234
+ cleanValue = cleanValue.split(":")[0];
235
+ }
236
+ if (cleanValue.indexOf("#") >= 0) {
237
+ cleanValue = cleanValue.split("#")[1];
238
+ }
239
+ return cleanValue;
240
+ }, "sanitizeErrorCode");
241
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
242
+ if (headerKey !== void 0) {
243
+ return sanitizeErrorCode(output.headers[headerKey]);
244
+ }
245
+ if (data.code !== void 0) {
246
+ return sanitizeErrorCode(data.code);
247
+ }
248
+ if (data["__type"] !== void 0) {
249
+ return sanitizeErrorCode(data["__type"]);
250
+ }
251
+ }, "loadRestJsonErrorCode");
252
+
253
+ // src/commands/BatchPutMetricsCommand.ts
254
+ var _BatchPutMetricsCommand = class _BatchPutMetricsCommand extends import_smithy_client.Command.classBuilder().ep({
255
+ ...commonParams
256
+ }).m(function(Command, cs, config, o) {
257
+ return [
258
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
259
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
260
+ ];
261
+ }).s("SageMakerMetricsService", "BatchPutMetrics", {}).n("SageMakerMetricsClient", "BatchPutMetricsCommand").f(void 0, void 0).ser(se_BatchPutMetricsCommand).de(de_BatchPutMetricsCommand).build() {
262
+ };
263
+ __name(_BatchPutMetricsCommand, "BatchPutMetricsCommand");
264
+ var BatchPutMetricsCommand = _BatchPutMetricsCommand;
265
+
266
+ // src/SageMakerMetrics.ts
267
+ var commands = {
268
+ BatchPutMetricsCommand
269
+ };
270
+ var _SageMakerMetrics = class _SageMakerMetrics extends SageMakerMetricsClient {
271
+ };
272
+ __name(_SageMakerMetrics, "SageMakerMetrics");
273
+ var SageMakerMetrics = _SageMakerMetrics;
274
+ (0, import_smithy_client.createAggregatedClient)(commands, SageMakerMetrics);
275
+
276
+ // src/models/models_0.ts
277
+ var PutMetricsErrorCode = {
278
+ CONFLICT_ERROR: "CONFLICT_ERROR",
279
+ INTERNAL_ERROR: "INTERNAL_ERROR",
280
+ METRIC_LIMIT_EXCEEDED: "METRIC_LIMIT_EXCEEDED",
281
+ VALIDATION_ERROR: "VALIDATION_ERROR"
282
+ };
283
+
284
+ // src/index.ts
285
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
286
+ // Annotate the CommonJS export names for ESM import in node:
287
+
288
+ 0 && (module.exports = {
289
+ $Command,
290
+ BatchPutMetricsCommand,
291
+ PutMetricsErrorCode,
292
+ SageMakerMetrics,
293
+ SageMakerMetricsClient,
294
+ SageMakerMetricsServiceException,
295
+ __Client,
296
+ __MetadataBearer
297
+ });
298
+
@@ -1,12 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SageMakerMetricsServiceException = exports.__ServiceException = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
6
- class SageMakerMetricsServiceException extends smithy_client_1.ServiceException {
7
- constructor(options) {
8
- super(options);
9
- Object.setPrototypeOf(this, SageMakerMetricsServiceException.prototype);
10
- }
11
- }
12
- exports.SageMakerMetricsServiceException = SageMakerMetricsServiceException;
1
+ module.exports = require("../index.js");
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./models_0"), exports);
1
+ module.exports = require("../index.js");
@@ -1,9 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PutMetricsErrorCode = void 0;
4
- exports.PutMetricsErrorCode = {
5
- CONFLICT_ERROR: "CONFLICT_ERROR",
6
- INTERNAL_ERROR: "INTERNAL_ERROR",
7
- METRIC_LIMIT_EXCEEDED: "METRIC_LIMIT_EXCEEDED",
8
- VALIDATION_ERROR: "VALIDATION_ERROR",
9
- };
1
+ module.exports = require("../index.js");
@@ -1,117 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_BatchPutMetricsCommand = exports.se_BatchPutMetricsCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const SageMakerMetricsServiceException_1 = require("../models/SageMakerMetricsServiceException");
7
- const se_BatchPutMetricsCommand = async (input, context) => {
8
- const b = (0, core_1.requestBuilder)(input, context);
9
- const headers = {
10
- "content-type": "application/json",
11
- };
12
- b.bp("/BatchPutMetrics");
13
- let body;
14
- body = JSON.stringify((0, smithy_client_1.take)(input, {
15
- MetricData: (_) => se_RawMetricDataList(_, context),
16
- TrialComponentName: [],
17
- }));
18
- b.m("PUT").h(headers).b(body);
19
- return b.build();
20
- };
21
- exports.se_BatchPutMetricsCommand = se_BatchPutMetricsCommand;
22
- const de_BatchPutMetricsCommand = async (output, context) => {
23
- if (output.statusCode !== 200 && output.statusCode >= 300) {
24
- return de_BatchPutMetricsCommandError(output, context);
25
- }
26
- const contents = (0, smithy_client_1.map)({
27
- $metadata: deserializeMetadata(output),
28
- });
29
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
30
- const doc = (0, smithy_client_1.take)(data, {
31
- Errors: smithy_client_1._json,
32
- });
33
- Object.assign(contents, doc);
34
- return contents;
35
- };
36
- exports.de_BatchPutMetricsCommand = de_BatchPutMetricsCommand;
37
- const de_BatchPutMetricsCommandError = async (output, context) => {
38
- const parsedOutput = {
39
- ...output,
40
- body: await parseErrorBody(output.body, context),
41
- };
42
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
43
- const parsedBody = parsedOutput.body;
44
- return throwDefaultError({
45
- output,
46
- parsedBody,
47
- errorCode,
48
- });
49
- };
50
- const throwDefaultError = (0, smithy_client_1.withBaseException)(SageMakerMetricsServiceException_1.SageMakerMetricsServiceException);
51
- const se_RawMetricData = (input, context) => {
52
- return (0, smithy_client_1.take)(input, {
53
- MetricName: [],
54
- Step: [],
55
- Timestamp: (_) => Math.round(_.getTime() / 1000),
56
- Value: smithy_client_1.serializeFloat,
57
- });
58
- };
59
- const se_RawMetricDataList = (input, context) => {
60
- return input
61
- .filter((e) => e != null)
62
- .map((entry) => {
63
- return se_RawMetricData(entry, context);
64
- });
65
- };
66
- const deserializeMetadata = (output) => ({
67
- httpStatusCode: output.statusCode,
68
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
69
- extendedRequestId: output.headers["x-amz-id-2"],
70
- cfId: output.headers["x-amz-cf-id"],
71
- });
72
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
73
- const isSerializableHeaderValue = (value) => value !== undefined &&
74
- value !== null &&
75
- value !== "" &&
76
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
77
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
78
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
79
- if (encoded.length) {
80
- return JSON.parse(encoded);
81
- }
82
- return {};
83
- });
84
- const parseErrorBody = async (errorBody, context) => {
85
- const value = await parseBody(errorBody, context);
86
- value.message = value.message ?? value.Message;
87
- return value;
88
- };
89
- const loadRestJsonErrorCode = (output, data) => {
90
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
91
- const sanitizeErrorCode = (rawValue) => {
92
- let cleanValue = rawValue;
93
- if (typeof cleanValue === "number") {
94
- cleanValue = cleanValue.toString();
95
- }
96
- if (cleanValue.indexOf(",") >= 0) {
97
- cleanValue = cleanValue.split(",")[0];
98
- }
99
- if (cleanValue.indexOf(":") >= 0) {
100
- cleanValue = cleanValue.split(":")[0];
101
- }
102
- if (cleanValue.indexOf("#") >= 0) {
103
- cleanValue = cleanValue.split("#")[1];
104
- }
105
- return cleanValue;
106
- };
107
- const headerKey = findKey(output.headers, "x-amzn-errortype");
108
- if (headerKey !== undefined) {
109
- return sanitizeErrorCode(output.headers[headerKey]);
110
- }
111
- if (data.code !== undefined) {
112
- return sanitizeErrorCode(data.code);
113
- }
114
- if (data["__type"] !== undefined) {
115
- return sanitizeErrorCode(data["__type"]);
116
- }
117
- };
1
+ module.exports = require("../index.js");
@@ -1,22 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeExtensions = void 0;
4
- const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const asPartial = (t) => t;
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = {
10
- ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
11
- ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
12
- ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
13
- };
14
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
15
- return {
16
- ...runtimeConfig,
17
- ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
18
- ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
19
- ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
20
- };
21
- };
22
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
1
+ module.exports = require("./index.js");
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-metrics",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Metrics Client for Node.js, Browser and React Native",
4
- "version": "3.490.0",
4
+ "version": "3.496.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
- "build:cjs": "tsc -p tsconfig.cjs.json",
7
+ "build:cjs": "node ../../scripts/compilation/inline client-sagemaker-metrics",
8
8
  "build:es": "tsc -p tsconfig.es.json",
9
9
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
10
10
  "build:types": "tsc -p tsconfig.types.json",
@@ -20,47 +20,47 @@
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.490.0",
24
- "@aws-sdk/core": "3.490.0",
25
- "@aws-sdk/credential-provider-node": "3.490.0",
26
- "@aws-sdk/middleware-host-header": "3.489.0",
27
- "@aws-sdk/middleware-logger": "3.489.0",
28
- "@aws-sdk/middleware-recursion-detection": "3.489.0",
29
- "@aws-sdk/middleware-signing": "3.489.0",
30
- "@aws-sdk/middleware-user-agent": "3.489.0",
31
- "@aws-sdk/region-config-resolver": "3.489.0",
32
- "@aws-sdk/types": "3.489.0",
33
- "@aws-sdk/util-endpoints": "3.489.0",
34
- "@aws-sdk/util-user-agent-browser": "3.489.0",
35
- "@aws-sdk/util-user-agent-node": "3.489.0",
36
- "@smithy/config-resolver": "^2.0.23",
37
- "@smithy/core": "^1.2.2",
38
- "@smithy/fetch-http-handler": "^2.3.2",
39
- "@smithy/hash-node": "^2.0.18",
40
- "@smithy/invalid-dependency": "^2.0.16",
41
- "@smithy/middleware-content-length": "^2.0.18",
42
- "@smithy/middleware-endpoint": "^2.3.0",
43
- "@smithy/middleware-retry": "^2.0.26",
44
- "@smithy/middleware-serde": "^2.0.16",
45
- "@smithy/middleware-stack": "^2.0.10",
46
- "@smithy/node-config-provider": "^2.1.9",
47
- "@smithy/node-http-handler": "^2.2.2",
48
- "@smithy/protocol-http": "^3.0.12",
49
- "@smithy/smithy-client": "^2.2.1",
50
- "@smithy/types": "^2.8.0",
51
- "@smithy/url-parser": "^2.0.16",
52
- "@smithy/util-base64": "^2.0.1",
53
- "@smithy/util-body-length-browser": "^2.0.1",
54
- "@smithy/util-body-length-node": "^2.1.0",
55
- "@smithy/util-defaults-mode-browser": "^2.0.24",
56
- "@smithy/util-defaults-mode-node": "^2.0.32",
57
- "@smithy/util-endpoints": "^1.0.8",
58
- "@smithy/util-retry": "^2.0.9",
59
- "@smithy/util-utf8": "^2.0.2",
23
+ "@aws-sdk/client-sts": "3.496.0",
24
+ "@aws-sdk/core": "3.496.0",
25
+ "@aws-sdk/credential-provider-node": "3.496.0",
26
+ "@aws-sdk/middleware-host-header": "3.496.0",
27
+ "@aws-sdk/middleware-logger": "3.496.0",
28
+ "@aws-sdk/middleware-recursion-detection": "3.496.0",
29
+ "@aws-sdk/middleware-signing": "3.496.0",
30
+ "@aws-sdk/middleware-user-agent": "3.496.0",
31
+ "@aws-sdk/region-config-resolver": "3.496.0",
32
+ "@aws-sdk/types": "3.496.0",
33
+ "@aws-sdk/util-endpoints": "3.496.0",
34
+ "@aws-sdk/util-user-agent-browser": "3.496.0",
35
+ "@aws-sdk/util-user-agent-node": "3.496.0",
36
+ "@smithy/config-resolver": "^2.1.1",
37
+ "@smithy/core": "^1.3.1",
38
+ "@smithy/fetch-http-handler": "^2.4.1",
39
+ "@smithy/hash-node": "^2.1.1",
40
+ "@smithy/invalid-dependency": "^2.1.1",
41
+ "@smithy/middleware-content-length": "^2.1.1",
42
+ "@smithy/middleware-endpoint": "^2.4.1",
43
+ "@smithy/middleware-retry": "^2.1.1",
44
+ "@smithy/middleware-serde": "^2.1.1",
45
+ "@smithy/middleware-stack": "^2.1.1",
46
+ "@smithy/node-config-provider": "^2.2.1",
47
+ "@smithy/node-http-handler": "^2.3.1",
48
+ "@smithy/protocol-http": "^3.1.1",
49
+ "@smithy/smithy-client": "^2.3.1",
50
+ "@smithy/types": "^2.9.1",
51
+ "@smithy/url-parser": "^2.1.1",
52
+ "@smithy/util-base64": "^2.1.1",
53
+ "@smithy/util-body-length-browser": "^2.1.1",
54
+ "@smithy/util-body-length-node": "^2.2.1",
55
+ "@smithy/util-defaults-mode-browser": "^2.1.1",
56
+ "@smithy/util-defaults-mode-node": "^2.1.1",
57
+ "@smithy/util-endpoints": "^1.1.1",
58
+ "@smithy/util-retry": "^2.1.1",
59
+ "@smithy/util-utf8": "^2.1.1",
60
60
  "tslib": "^2.5.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@smithy/service-client-documentation-generator": "^2.0.0",
63
+ "@smithy/service-client-documentation-generator": "^2.1.1",
64
64
  "@tsconfig/node14": "1.0.3",
65
65
  "@types/node": "^14.14.31",
66
66
  "concurrently": "7.0.0",