@aws-sdk/client-sagemaker-edge 3.901.0 → 3.907.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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +372 -464
  2. package/package.json +6 -6
package/dist-cjs/index.js CHANGED
@@ -1,490 +1,398 @@
1
- "use strict";
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 });
1
+ 'use strict';
2
+
3
+ var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
4
+ var middlewareLogger = require('@aws-sdk/middleware-logger');
5
+ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
6
+ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
+ var configResolver = require('@smithy/config-resolver');
8
+ var core = require('@smithy/core');
9
+ var middlewareContentLength = require('@smithy/middleware-content-length');
10
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
+ var middlewareRetry = require('@smithy/middleware-retry');
12
+ var smithyClient = require('@smithy/smithy-client');
13
+ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
+ var runtimeConfig = require('./runtimeConfig');
15
+ var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
+ var protocolHttp = require('@smithy/protocol-http');
17
+ var middlewareSerde = require('@smithy/middleware-serde');
18
+ var core$1 = require('@aws-sdk/core');
19
+
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "sagemaker",
25
+ });
10
26
  };
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;
27
+ const commonParams = {
28
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
29
+ Endpoint: { type: "builtInParams", name: "endpoint" },
30
+ Region: { type: "builtInParams", name: "region" },
31
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
18
32
  };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- ChecksumType: () => ChecksumType,
25
- DeploymentStatus: () => DeploymentStatus,
26
- DeploymentType: () => DeploymentType,
27
- FailureHandlingPolicy: () => FailureHandlingPolicy,
28
- GetDeploymentsCommand: () => GetDeploymentsCommand,
29
- GetDeviceRegistrationCommand: () => GetDeviceRegistrationCommand,
30
- InternalServiceException: () => InternalServiceException,
31
- ModelState: () => ModelState,
32
- SagemakerEdge: () => SagemakerEdge,
33
- SagemakerEdgeClient: () => SagemakerEdgeClient,
34
- SagemakerEdgeServiceException: () => SagemakerEdgeServiceException,
35
- SendHeartbeatCommand: () => SendHeartbeatCommand,
36
- __Client: () => import_smithy_client.Client
37
- });
38
- module.exports = __toCommonJS(index_exports);
39
-
40
- // src/SagemakerEdgeClient.ts
41
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
42
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
43
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
44
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
45
- var import_config_resolver = require("@smithy/config-resolver");
46
- var import_core = require("@smithy/core");
47
- var import_middleware_content_length = require("@smithy/middleware-content-length");
48
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
49
- var import_middleware_retry = require("@smithy/middleware-retry");
50
33
 
51
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
52
-
53
- // src/endpoint/EndpointParameters.ts
54
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
55
- return Object.assign(options, {
56
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
57
- useFipsEndpoint: options.useFipsEndpoint ?? false,
58
- defaultSigningName: "sagemaker"
59
- });
60
- }, "resolveClientEndpointParameters");
61
- var commonParams = {
62
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
63
- Endpoint: { type: "builtInParams", name: "endpoint" },
64
- Region: { type: "builtInParams", name: "region" },
65
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
34
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
35
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
36
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
37
+ let _credentials = runtimeConfig.credentials;
38
+ return {
39
+ setHttpAuthScheme(httpAuthScheme) {
40
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
41
+ if (index === -1) {
42
+ _httpAuthSchemes.push(httpAuthScheme);
43
+ }
44
+ else {
45
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
46
+ }
47
+ },
48
+ httpAuthSchemes() {
49
+ return _httpAuthSchemes;
50
+ },
51
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
52
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
53
+ },
54
+ httpAuthSchemeProvider() {
55
+ return _httpAuthSchemeProvider;
56
+ },
57
+ setCredentials(credentials) {
58
+ _credentials = credentials;
59
+ },
60
+ credentials() {
61
+ return _credentials;
62
+ },
63
+ };
64
+ };
65
+ const resolveHttpAuthRuntimeConfig = (config) => {
66
+ return {
67
+ httpAuthSchemes: config.httpAuthSchemes(),
68
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
69
+ credentials: config.credentials(),
70
+ };
66
71
  };
67
72
 
68
- // src/SagemakerEdgeClient.ts
69
- var import_runtimeConfig = require("././runtimeConfig");
70
-
71
- // src/runtimeExtensions.ts
72
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
73
- var import_protocol_http = require("@smithy/protocol-http");
74
- var import_smithy_client = require("@smithy/smithy-client");
73
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
74
+ const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
75
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
76
+ return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
77
+ };
75
78
 
76
- // src/auth/httpAuthExtensionConfiguration.ts
77
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
78
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
79
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
80
- let _credentials = runtimeConfig.credentials;
81
- return {
82
- setHttpAuthScheme(httpAuthScheme) {
83
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
84
- if (index === -1) {
85
- _httpAuthSchemes.push(httpAuthScheme);
86
- } else {
87
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
88
- }
89
- },
90
- httpAuthSchemes() {
91
- return _httpAuthSchemes;
92
- },
93
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
94
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
95
- },
96
- httpAuthSchemeProvider() {
97
- return _httpAuthSchemeProvider;
98
- },
99
- setCredentials(credentials) {
100
- _credentials = credentials;
101
- },
102
- credentials() {
103
- return _credentials;
79
+ class SagemakerEdgeClient extends smithyClient.Client {
80
+ config;
81
+ constructor(...[configuration]) {
82
+ const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
83
+ super(_config_0);
84
+ this.initConfig = _config_0;
85
+ const _config_1 = resolveClientEndpointParameters(_config_0);
86
+ const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
87
+ const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
88
+ const _config_4 = configResolver.resolveRegionConfig(_config_3);
89
+ const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
90
+ const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
91
+ const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
92
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
93
+ this.config = _config_8;
94
+ this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
95
+ this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
96
+ this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
97
+ this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
98
+ this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
99
+ this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
100
+ this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
101
+ httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSagemakerEdgeHttpAuthSchemeParametersProvider,
102
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
103
+ "aws.auth#sigv4": config.credentials,
104
+ }),
105
+ }));
106
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
104
107
  }
105
- };
106
- }, "getHttpAuthExtensionConfiguration");
107
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
108
- return {
109
- httpAuthSchemes: config.httpAuthSchemes(),
110
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
111
- credentials: config.credentials()
112
- };
113
- }, "resolveHttpAuthRuntimeConfig");
108
+ destroy() {
109
+ super.destroy();
110
+ }
111
+ }
114
112
 
115
- // src/runtimeExtensions.ts
116
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
117
- const extensionConfiguration = Object.assign(
118
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
119
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
120
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
121
- getHttpAuthExtensionConfiguration(runtimeConfig)
122
- );
123
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
124
- return Object.assign(
125
- runtimeConfig,
126
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
127
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
128
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
129
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
130
- );
131
- }, "resolveRuntimeExtensions");
113
+ class SagemakerEdgeServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, SagemakerEdgeServiceException.prototype);
117
+ }
118
+ }
132
119
 
133
- // src/SagemakerEdgeClient.ts
134
- var SagemakerEdgeClient = class extends import_smithy_client.Client {
135
- static {
136
- __name(this, "SagemakerEdgeClient");
137
- }
138
- /**
139
- * The resolved configuration of SagemakerEdgeClient class. This is resolved and normalized from the {@link SagemakerEdgeClientConfig | constructor configuration interface}.
140
- */
141
- config;
142
- constructor(...[configuration]) {
143
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
144
- super(_config_0);
145
- this.initConfig = _config_0;
146
- const _config_1 = resolveClientEndpointParameters(_config_0);
147
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
148
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
149
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
150
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
151
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
152
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
153
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
154
- this.config = _config_8;
155
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
156
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
157
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
158
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
159
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
160
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
161
- this.middlewareStack.use(
162
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
163
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultSagemakerEdgeHttpAuthSchemeParametersProvider,
164
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
165
- "aws.auth#sigv4": config.credentials
166
- }), "identityProviderConfigProvider")
167
- })
168
- );
169
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
170
- }
171
- /**
172
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
173
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
174
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
175
- */
176
- destroy() {
177
- super.destroy();
178
- }
120
+ const ChecksumType = {
121
+ Sha1: "SHA1",
179
122
  };
180
-
181
- // src/SagemakerEdge.ts
182
-
183
-
184
- // src/commands/GetDeploymentsCommand.ts
185
-
186
- var import_middleware_serde = require("@smithy/middleware-serde");
187
-
188
-
189
- // src/protocols/Aws_restJson1.ts
190
- var import_core2 = require("@aws-sdk/core");
191
-
192
-
193
-
194
- // src/models/SagemakerEdgeServiceException.ts
195
-
196
- var SagemakerEdgeServiceException = class _SagemakerEdgeServiceException extends import_smithy_client.ServiceException {
197
- static {
198
- __name(this, "SagemakerEdgeServiceException");
199
- }
200
- /**
201
- * @internal
202
- */
203
- constructor(options) {
204
- super(options);
205
- Object.setPrototypeOf(this, _SagemakerEdgeServiceException.prototype);
206
- }
123
+ const ModelState = {
124
+ Deploy: "DEPLOY",
125
+ Undeploy: "UNDEPLOY",
126
+ };
127
+ const FailureHandlingPolicy = {
128
+ DoNothing: "DO_NOTHING",
129
+ RollbackOnFailure: "ROLLBACK_ON_FAILURE",
130
+ };
131
+ const DeploymentType = {
132
+ Model: "Model",
133
+ };
134
+ class InternalServiceException extends SagemakerEdgeServiceException {
135
+ name = "InternalServiceException";
136
+ $fault = "client";
137
+ Message;
138
+ constructor(opts) {
139
+ super({
140
+ name: "InternalServiceException",
141
+ $fault: "client",
142
+ ...opts,
143
+ });
144
+ Object.setPrototypeOf(this, InternalServiceException.prototype);
145
+ this.Message = opts.Message;
146
+ }
147
+ }
148
+ const DeploymentStatus = {
149
+ Fail: "FAIL",
150
+ Success: "SUCCESS",
207
151
  };
208
152
 
209
- // src/models/models_0.ts
210
- var ChecksumType = {
211
- Sha1: "SHA1"
153
+ const se_GetDeploymentsCommand = async (input, context) => {
154
+ const b = core.requestBuilder(input, context);
155
+ const headers = {
156
+ "content-type": "application/json",
157
+ };
158
+ b.bp("/GetDeployments");
159
+ let body;
160
+ body = JSON.stringify(smithyClient.take(input, {
161
+ DeviceFleetName: [],
162
+ DeviceName: [],
163
+ }));
164
+ b.m("POST").h(headers).b(body);
165
+ return b.build();
212
166
  };
213
- var ModelState = {
214
- Deploy: "DEPLOY",
215
- Undeploy: "UNDEPLOY"
167
+ const se_GetDeviceRegistrationCommand = async (input, context) => {
168
+ const b = core.requestBuilder(input, context);
169
+ const headers = {
170
+ "content-type": "application/json",
171
+ };
172
+ b.bp("/GetDeviceRegistration");
173
+ let body;
174
+ body = JSON.stringify(smithyClient.take(input, {
175
+ DeviceFleetName: [],
176
+ DeviceName: [],
177
+ }));
178
+ b.m("POST").h(headers).b(body);
179
+ return b.build();
216
180
  };
217
- var FailureHandlingPolicy = {
218
- DoNothing: "DO_NOTHING",
219
- RollbackOnFailure: "ROLLBACK_ON_FAILURE"
181
+ const se_SendHeartbeatCommand = async (input, context) => {
182
+ const b = core.requestBuilder(input, context);
183
+ const headers = {
184
+ "content-type": "application/json",
185
+ };
186
+ b.bp("/SendHeartbeat");
187
+ let body;
188
+ body = JSON.stringify(smithyClient.take(input, {
189
+ AgentMetrics: (_) => se_EdgeMetrics(_),
190
+ AgentVersion: [],
191
+ DeploymentResult: (_) => se_DeploymentResult(_),
192
+ DeviceFleetName: [],
193
+ DeviceName: [],
194
+ Models: (_) => se_Models(_),
195
+ }));
196
+ b.m("POST").h(headers).b(body);
197
+ return b.build();
220
198
  };
221
- var DeploymentType = {
222
- Model: "Model"
199
+ const de_GetDeploymentsCommand = async (output, context) => {
200
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
201
+ return de_CommandError(output, context);
202
+ }
203
+ const contents = smithyClient.map({
204
+ $metadata: deserializeMetadata(output),
205
+ });
206
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
207
+ const doc = smithyClient.take(data, {
208
+ Deployments: smithyClient._json,
209
+ });
210
+ Object.assign(contents, doc);
211
+ return contents;
223
212
  };
224
- var InternalServiceException = class _InternalServiceException extends SagemakerEdgeServiceException {
225
- static {
226
- __name(this, "InternalServiceException");
227
- }
228
- name = "InternalServiceException";
229
- $fault = "client";
230
- Message;
231
- /**
232
- * @internal
233
- */
234
- constructor(opts) {
235
- super({
236
- name: "InternalServiceException",
237
- $fault: "client",
238
- ...opts
213
+ const de_GetDeviceRegistrationCommand = async (output, context) => {
214
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
215
+ return de_CommandError(output, context);
216
+ }
217
+ const contents = smithyClient.map({
218
+ $metadata: deserializeMetadata(output),
219
+ });
220
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
221
+ const doc = smithyClient.take(data, {
222
+ CacheTTL: smithyClient.expectString,
223
+ DeviceRegistration: smithyClient.expectString,
239
224
  });
240
- Object.setPrototypeOf(this, _InternalServiceException.prototype);
241
- this.Message = opts.Message;
242
- }
225
+ Object.assign(contents, doc);
226
+ return contents;
243
227
  };
244
- var DeploymentStatus = {
245
- Fail: "FAIL",
246
- Success: "SUCCESS"
228
+ const de_SendHeartbeatCommand = async (output, context) => {
229
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
230
+ return de_CommandError(output, context);
231
+ }
232
+ const contents = smithyClient.map({
233
+ $metadata: deserializeMetadata(output),
234
+ });
235
+ await smithyClient.collectBody(output.body, context);
236
+ return contents;
247
237
  };
248
-
249
- // src/protocols/Aws_restJson1.ts
250
- var se_GetDeploymentsCommand = /* @__PURE__ */ __name(async (input, context) => {
251
- const b = (0, import_core.requestBuilder)(input, context);
252
- const headers = {
253
- "content-type": "application/json"
254
- };
255
- b.bp("/GetDeployments");
256
- let body;
257
- body = JSON.stringify(
258
- (0, import_smithy_client.take)(input, {
259
- DeviceFleetName: [],
260
- DeviceName: []
261
- })
262
- );
263
- b.m("POST").h(headers).b(body);
264
- return b.build();
265
- }, "se_GetDeploymentsCommand");
266
- var se_GetDeviceRegistrationCommand = /* @__PURE__ */ __name(async (input, context) => {
267
- const b = (0, import_core.requestBuilder)(input, context);
268
- const headers = {
269
- "content-type": "application/json"
270
- };
271
- b.bp("/GetDeviceRegistration");
272
- let body;
273
- body = JSON.stringify(
274
- (0, import_smithy_client.take)(input, {
275
- DeviceFleetName: [],
276
- DeviceName: []
277
- })
278
- );
279
- b.m("POST").h(headers).b(body);
280
- return b.build();
281
- }, "se_GetDeviceRegistrationCommand");
282
- var se_SendHeartbeatCommand = /* @__PURE__ */ __name(async (input, context) => {
283
- const b = (0, import_core.requestBuilder)(input, context);
284
- const headers = {
285
- "content-type": "application/json"
286
- };
287
- b.bp("/SendHeartbeat");
288
- let body;
289
- body = JSON.stringify(
290
- (0, import_smithy_client.take)(input, {
291
- AgentMetrics: /* @__PURE__ */ __name((_) => se_EdgeMetrics(_, context), "AgentMetrics"),
292
- AgentVersion: [],
293
- DeploymentResult: /* @__PURE__ */ __name((_) => se_DeploymentResult(_, context), "DeploymentResult"),
294
- DeviceFleetName: [],
295
- DeviceName: [],
296
- Models: /* @__PURE__ */ __name((_) => se_Models(_, context), "Models")
297
- })
298
- );
299
- b.m("POST").h(headers).b(body);
300
- return b.build();
301
- }, "se_SendHeartbeatCommand");
302
- var de_GetDeploymentsCommand = /* @__PURE__ */ __name(async (output, context) => {
303
- if (output.statusCode !== 200 && output.statusCode >= 300) {
304
- return de_CommandError(output, context);
305
- }
306
- const contents = (0, import_smithy_client.map)({
307
- $metadata: deserializeMetadata(output)
308
- });
309
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
310
- const doc = (0, import_smithy_client.take)(data, {
311
- Deployments: import_smithy_client._json
312
- });
313
- Object.assign(contents, doc);
314
- return contents;
315
- }, "de_GetDeploymentsCommand");
316
- var de_GetDeviceRegistrationCommand = /* @__PURE__ */ __name(async (output, context) => {
317
- if (output.statusCode !== 200 && output.statusCode >= 300) {
318
- return de_CommandError(output, context);
319
- }
320
- const contents = (0, import_smithy_client.map)({
321
- $metadata: deserializeMetadata(output)
322
- });
323
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
324
- const doc = (0, import_smithy_client.take)(data, {
325
- CacheTTL: import_smithy_client.expectString,
326
- DeviceRegistration: import_smithy_client.expectString
327
- });
328
- Object.assign(contents, doc);
329
- return contents;
330
- }, "de_GetDeviceRegistrationCommand");
331
- var de_SendHeartbeatCommand = /* @__PURE__ */ __name(async (output, context) => {
332
- if (output.statusCode !== 200 && output.statusCode >= 300) {
333
- return de_CommandError(output, context);
334
- }
335
- const contents = (0, import_smithy_client.map)({
336
- $metadata: deserializeMetadata(output)
337
- });
338
- await (0, import_smithy_client.collectBody)(output.body, context);
339
- return contents;
340
- }, "de_SendHeartbeatCommand");
341
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
342
- const parsedOutput = {
343
- ...output,
344
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
345
- };
346
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
347
- switch (errorCode) {
348
- case "InternalServiceException":
349
- case "com.amazonaws.sagemakeredge#InternalServiceException":
350
- throw await de_InternalServiceExceptionRes(parsedOutput, context);
351
- default:
352
- const parsedBody = parsedOutput.body;
353
- return throwDefaultError({
354
- output,
355
- parsedBody,
356
- errorCode
357
- });
358
- }
359
- }, "de_CommandError");
360
- var throwDefaultError = (0, import_smithy_client.withBaseException)(SagemakerEdgeServiceException);
361
- var de_InternalServiceExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
362
- const contents = (0, import_smithy_client.map)({});
363
- const data = parsedOutput.body;
364
- const doc = (0, import_smithy_client.take)(data, {
365
- Message: import_smithy_client.expectString
366
- });
367
- Object.assign(contents, doc);
368
- const exception = new InternalServiceException({
369
- $metadata: deserializeMetadata(parsedOutput),
370
- ...contents
371
- });
372
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
373
- }, "de_InternalServiceExceptionRes");
374
- var se_DeploymentResult = /* @__PURE__ */ __name((input, context) => {
375
- return (0, import_smithy_client.take)(input, {
376
- DeploymentEndTime: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "DeploymentEndTime"),
377
- DeploymentModels: import_smithy_client._json,
378
- DeploymentName: [],
379
- DeploymentStartTime: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "DeploymentStartTime"),
380
- DeploymentStatus: [],
381
- DeploymentStatusMessage: []
382
- });
383
- }, "se_DeploymentResult");
384
- var se_EdgeMetric = /* @__PURE__ */ __name((input, context) => {
385
- return (0, import_smithy_client.take)(input, {
386
- Dimension: [],
387
- MetricName: [],
388
- Timestamp: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "Timestamp"),
389
- Value: import_smithy_client.serializeFloat
390
- });
391
- }, "se_EdgeMetric");
392
- var se_EdgeMetrics = /* @__PURE__ */ __name((input, context) => {
393
- return input.filter((e) => e != null).map((entry) => {
394
- return se_EdgeMetric(entry, context);
395
- });
396
- }, "se_EdgeMetrics");
397
- var se_Model = /* @__PURE__ */ __name((input, context) => {
398
- return (0, import_smithy_client.take)(input, {
399
- LatestInference: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "LatestInference"),
400
- LatestSampleTime: /* @__PURE__ */ __name((_) => _.getTime() / 1e3, "LatestSampleTime"),
401
- ModelMetrics: /* @__PURE__ */ __name((_) => se_EdgeMetrics(_, context), "ModelMetrics"),
402
- ModelName: [],
403
- ModelVersion: []
404
- });
405
- }, "se_Model");
406
- var se_Models = /* @__PURE__ */ __name((input, context) => {
407
- return input.filter((e) => e != null).map((entry) => {
408
- return se_Model(entry, context);
409
- });
410
- }, "se_Models");
411
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
412
- httpStatusCode: output.statusCode,
413
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
414
- extendedRequestId: output.headers["x-amz-id-2"],
415
- cfId: output.headers["x-amz-cf-id"]
416
- }), "deserializeMetadata");
417
-
418
- // src/commands/GetDeploymentsCommand.ts
419
- var GetDeploymentsCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
420
- return [
421
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
422
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
423
- ];
424
- }).s("AmazonSageMakerEdge", "GetDeployments", {}).n("SagemakerEdgeClient", "GetDeploymentsCommand").f(void 0, void 0).ser(se_GetDeploymentsCommand).de(de_GetDeploymentsCommand).build() {
425
- static {
426
- __name(this, "GetDeploymentsCommand");
427
- }
238
+ const de_CommandError = async (output, context) => {
239
+ const parsedOutput = {
240
+ ...output,
241
+ body: await core$1.parseJsonErrorBody(output.body, context),
242
+ };
243
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
244
+ switch (errorCode) {
245
+ case "InternalServiceException":
246
+ case "com.amazonaws.sagemakeredge#InternalServiceException":
247
+ throw await de_InternalServiceExceptionRes(parsedOutput);
248
+ default:
249
+ const parsedBody = parsedOutput.body;
250
+ return throwDefaultError({
251
+ output,
252
+ parsedBody,
253
+ errorCode,
254
+ });
255
+ }
428
256
  };
429
-
430
- // src/commands/GetDeviceRegistrationCommand.ts
431
-
432
-
433
-
434
- var GetDeviceRegistrationCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
435
- return [
436
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
437
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
438
- ];
439
- }).s("AmazonSageMakerEdge", "GetDeviceRegistration", {}).n("SagemakerEdgeClient", "GetDeviceRegistrationCommand").f(void 0, void 0).ser(se_GetDeviceRegistrationCommand).de(de_GetDeviceRegistrationCommand).build() {
440
- static {
441
- __name(this, "GetDeviceRegistrationCommand");
442
- }
257
+ const throwDefaultError = smithyClient.withBaseException(SagemakerEdgeServiceException);
258
+ const de_InternalServiceExceptionRes = async (parsedOutput, context) => {
259
+ const contents = smithyClient.map({});
260
+ const data = parsedOutput.body;
261
+ const doc = smithyClient.take(data, {
262
+ Message: smithyClient.expectString,
263
+ });
264
+ Object.assign(contents, doc);
265
+ const exception = new InternalServiceException({
266
+ $metadata: deserializeMetadata(parsedOutput),
267
+ ...contents,
268
+ });
269
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
443
270
  };
444
-
445
- // src/commands/SendHeartbeatCommand.ts
446
-
447
-
448
-
449
- var SendHeartbeatCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
450
- return [
451
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
452
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
453
- ];
454
- }).s("AmazonSageMakerEdge", "SendHeartbeat", {}).n("SagemakerEdgeClient", "SendHeartbeatCommand").f(void 0, void 0).ser(se_SendHeartbeatCommand).de(de_SendHeartbeatCommand).build() {
455
- static {
456
- __name(this, "SendHeartbeatCommand");
457
- }
271
+ const se_DeploymentResult = (input, context) => {
272
+ return smithyClient.take(input, {
273
+ DeploymentEndTime: (_) => _.getTime() / 1_000,
274
+ DeploymentModels: smithyClient._json,
275
+ DeploymentName: [],
276
+ DeploymentStartTime: (_) => _.getTime() / 1_000,
277
+ DeploymentStatus: [],
278
+ DeploymentStatusMessage: [],
279
+ });
458
280
  };
459
-
460
- // src/SagemakerEdge.ts
461
- var commands = {
462
- GetDeploymentsCommand,
463
- GetDeviceRegistrationCommand,
464
- SendHeartbeatCommand
281
+ const se_EdgeMetric = (input, context) => {
282
+ return smithyClient.take(input, {
283
+ Dimension: [],
284
+ MetricName: [],
285
+ Timestamp: (_) => _.getTime() / 1_000,
286
+ Value: smithyClient.serializeFloat,
287
+ });
465
288
  };
466
- var SagemakerEdge = class extends SagemakerEdgeClient {
467
- static {
468
- __name(this, "SagemakerEdge");
469
- }
289
+ const se_EdgeMetrics = (input, context) => {
290
+ return input
291
+ .filter((e) => e != null)
292
+ .map((entry) => {
293
+ return se_EdgeMetric(entry);
294
+ });
470
295
  };
471
- (0, import_smithy_client.createAggregatedClient)(commands, SagemakerEdge);
472
- // Annotate the CommonJS export names for ESM import in node:
473
-
474
- 0 && (module.exports = {
475
- SagemakerEdgeServiceException,
476
- __Client,
477
- SagemakerEdgeClient,
478
- SagemakerEdge,
479
- $Command,
480
- GetDeploymentsCommand,
481
- GetDeviceRegistrationCommand,
482
- SendHeartbeatCommand,
483
- ChecksumType,
484
- ModelState,
485
- FailureHandlingPolicy,
486
- DeploymentType,
487
- InternalServiceException,
488
- DeploymentStatus
296
+ const se_Model = (input, context) => {
297
+ return smithyClient.take(input, {
298
+ LatestInference: (_) => _.getTime() / 1_000,
299
+ LatestSampleTime: (_) => _.getTime() / 1_000,
300
+ ModelMetrics: (_) => se_EdgeMetrics(_),
301
+ ModelName: [],
302
+ ModelVersion: [],
303
+ });
304
+ };
305
+ const se_Models = (input, context) => {
306
+ return input
307
+ .filter((e) => e != null)
308
+ .map((entry) => {
309
+ return se_Model(entry);
310
+ });
311
+ };
312
+ const deserializeMetadata = (output) => ({
313
+ httpStatusCode: output.statusCode,
314
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
315
+ extendedRequestId: output.headers["x-amz-id-2"],
316
+ cfId: output.headers["x-amz-cf-id"],
489
317
  });
490
318
 
319
+ class GetDeploymentsCommand extends smithyClient.Command
320
+ .classBuilder()
321
+ .ep(commonParams)
322
+ .m(function (Command, cs, config, o) {
323
+ return [
324
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
325
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
326
+ ];
327
+ })
328
+ .s("AmazonSageMakerEdge", "GetDeployments", {})
329
+ .n("SagemakerEdgeClient", "GetDeploymentsCommand")
330
+ .f(void 0, void 0)
331
+ .ser(se_GetDeploymentsCommand)
332
+ .de(de_GetDeploymentsCommand)
333
+ .build() {
334
+ }
335
+
336
+ class GetDeviceRegistrationCommand extends smithyClient.Command
337
+ .classBuilder()
338
+ .ep(commonParams)
339
+ .m(function (Command, cs, config, o) {
340
+ return [
341
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
342
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
343
+ ];
344
+ })
345
+ .s("AmazonSageMakerEdge", "GetDeviceRegistration", {})
346
+ .n("SagemakerEdgeClient", "GetDeviceRegistrationCommand")
347
+ .f(void 0, void 0)
348
+ .ser(se_GetDeviceRegistrationCommand)
349
+ .de(de_GetDeviceRegistrationCommand)
350
+ .build() {
351
+ }
352
+
353
+ class SendHeartbeatCommand extends smithyClient.Command
354
+ .classBuilder()
355
+ .ep(commonParams)
356
+ .m(function (Command, cs, config, o) {
357
+ return [
358
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
359
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
360
+ ];
361
+ })
362
+ .s("AmazonSageMakerEdge", "SendHeartbeat", {})
363
+ .n("SagemakerEdgeClient", "SendHeartbeatCommand")
364
+ .f(void 0, void 0)
365
+ .ser(se_SendHeartbeatCommand)
366
+ .de(de_SendHeartbeatCommand)
367
+ .build() {
368
+ }
369
+
370
+ const commands = {
371
+ GetDeploymentsCommand,
372
+ GetDeviceRegistrationCommand,
373
+ SendHeartbeatCommand,
374
+ };
375
+ class SagemakerEdge extends SagemakerEdgeClient {
376
+ }
377
+ smithyClient.createAggregatedClient(commands, SagemakerEdge);
378
+
379
+ Object.defineProperty(exports, "$Command", {
380
+ enumerable: true,
381
+ get: function () { return smithyClient.Command; }
382
+ });
383
+ Object.defineProperty(exports, "__Client", {
384
+ enumerable: true,
385
+ get: function () { return smithyClient.Client; }
386
+ });
387
+ exports.ChecksumType = ChecksumType;
388
+ exports.DeploymentStatus = DeploymentStatus;
389
+ exports.DeploymentType = DeploymentType;
390
+ exports.FailureHandlingPolicy = FailureHandlingPolicy;
391
+ exports.GetDeploymentsCommand = GetDeploymentsCommand;
392
+ exports.GetDeviceRegistrationCommand = GetDeviceRegistrationCommand;
393
+ exports.InternalServiceException = InternalServiceException;
394
+ exports.ModelState = ModelState;
395
+ exports.SagemakerEdge = SagemakerEdge;
396
+ exports.SagemakerEdgeClient = SagemakerEdgeClient;
397
+ exports.SagemakerEdgeServiceException = SagemakerEdgeServiceException;
398
+ exports.SendHeartbeatCommand = SendHeartbeatCommand;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-edge",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Edge Client for Node.js, Browser and React Native",
4
- "version": "3.901.0",
4
+ "version": "3.907.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-sagemaker-edge",
@@ -20,17 +20,17 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/core": "3.901.0",
24
- "@aws-sdk/credential-provider-node": "3.901.0",
23
+ "@aws-sdk/core": "3.907.0",
24
+ "@aws-sdk/credential-provider-node": "3.907.0",
25
25
  "@aws-sdk/middleware-host-header": "3.901.0",
26
26
  "@aws-sdk/middleware-logger": "3.901.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.901.0",
28
- "@aws-sdk/middleware-user-agent": "3.901.0",
28
+ "@aws-sdk/middleware-user-agent": "3.907.0",
29
29
  "@aws-sdk/region-config-resolver": "3.901.0",
30
30
  "@aws-sdk/types": "3.901.0",
31
31
  "@aws-sdk/util-endpoints": "3.901.0",
32
- "@aws-sdk/util-user-agent-browser": "3.901.0",
33
- "@aws-sdk/util-user-agent-node": "3.901.0",
32
+ "@aws-sdk/util-user-agent-browser": "3.907.0",
33
+ "@aws-sdk/util-user-agent-node": "3.907.0",
34
34
  "@smithy/config-resolver": "^4.3.0",
35
35
  "@smithy/core": "^3.14.0",
36
36
  "@smithy/fetch-http-handler": "^5.3.0",