@aws-sdk/client-amp 3.509.0 → 3.513.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 (56) hide show
  1. package/README.md +18 -1
  2. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +1 -0
  3. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  4. package/dist-cjs/index.js +103 -45
  5. package/dist-cjs/runtimeConfig.shared.js +10 -0
  6. package/dist-es/AmpClient.js +17 -4
  7. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  8. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  9. package/dist-es/runtimeConfig.shared.js +10 -0
  10. package/dist-es/runtimeExtensions.js +3 -0
  11. package/dist-types/Amp.d.ts +18 -1
  12. package/dist-types/AmpClient.d.ts +31 -12
  13. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  14. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  15. package/dist-types/commands/CreateAlertManagerDefinitionCommand.d.ts +12 -8
  16. package/dist-types/commands/CreateLoggingConfigurationCommand.d.ts +8 -5
  17. package/dist-types/commands/CreateRuleGroupsNamespaceCommand.d.ts +13 -8
  18. package/dist-types/commands/CreateScraperCommand.d.ts +26 -8
  19. package/dist-types/commands/CreateWorkspaceCommand.d.ts +10 -7
  20. package/dist-types/commands/DeleteAlertManagerDefinitionCommand.d.ts +8 -7
  21. package/dist-types/commands/DeleteLoggingConfigurationCommand.d.ts +7 -6
  22. package/dist-types/commands/DeleteRuleGroupsNamespaceCommand.d.ts +8 -7
  23. package/dist-types/commands/DeleteScraperCommand.d.ts +9 -7
  24. package/dist-types/commands/DeleteWorkspaceCommand.d.ts +12 -7
  25. package/dist-types/commands/DescribeAlertManagerDefinitionCommand.d.ts +8 -6
  26. package/dist-types/commands/DescribeLoggingConfigurationCommand.d.ts +7 -5
  27. package/dist-types/commands/DescribeRuleGroupsNamespaceCommand.d.ts +8 -6
  28. package/dist-types/commands/DescribeScraperCommand.d.ts +8 -6
  29. package/dist-types/commands/DescribeWorkspaceCommand.d.ts +7 -6
  30. package/dist-types/commands/GetDefaultScraperConfigurationCommand.d.ts +5 -4
  31. package/dist-types/commands/ListRuleGroupsNamespacesCommand.d.ts +7 -6
  32. package/dist-types/commands/ListScrapersCommand.d.ts +8 -5
  33. package/dist-types/commands/ListTagsForResourceCommand.d.ts +9 -6
  34. package/dist-types/commands/ListWorkspacesCommand.d.ts +7 -5
  35. package/dist-types/commands/PutAlertManagerDefinitionCommand.d.ts +11 -8
  36. package/dist-types/commands/PutRuleGroupsNamespaceCommand.d.ts +15 -8
  37. package/dist-types/commands/TagResourceCommand.d.ts +13 -6
  38. package/dist-types/commands/UntagResourceCommand.d.ts +8 -6
  39. package/dist-types/commands/UpdateLoggingConfigurationCommand.d.ts +8 -6
  40. package/dist-types/commands/UpdateWorkspaceAliasCommand.d.ts +9 -8
  41. package/dist-types/extensionConfiguration.d.ts +2 -1
  42. package/dist-types/index.d.ts +18 -1
  43. package/dist-types/models/models_0.d.ts +360 -260
  44. package/dist-types/runtimeConfig.browser.d.ts +5 -3
  45. package/dist-types/runtimeConfig.d.ts +4 -2
  46. package/dist-types/runtimeConfig.native.d.ts +6 -4
  47. package/dist-types/runtimeConfig.shared.d.ts +2 -0
  48. package/dist-types/ts3.4/AmpClient.d.ts +11 -9
  49. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  50. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +43 -0
  51. package/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  52. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +5 -5
  53. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -4
  54. package/dist-types/ts3.4/runtimeConfig.native.d.ts +8 -8
  55. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
  56. package/package.json +16 -16
package/README.md CHANGED
@@ -6,7 +6,24 @@
6
6
 
7
7
  AWS SDK for JavaScript Amp Client for Node.js, Browser and React Native.
8
8
 
9
- Amazon Managed Service for Prometheus
9
+ <p>Amazon Managed Service for Prometheus is a serverless, Prometheus-compatible monitoring service for
10
+ container metrics that makes it easier to securely monitor container environments at
11
+ scale. With Amazon Managed Service for Prometheus, you can use the same open-source Prometheus data
12
+ model and query language that you use today to monitor the performance of your
13
+ containerized workloads, and also enjoy improved scalability, availability, and security
14
+ without having to manage the underlying infrastructure.</p>
15
+ <p>For more information about Amazon Managed Service for Prometheus, see the <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/what-is-Amazon-Managed-Service-Prometheus.html">Amazon Managed Service for Prometheus</a> User Guide.</p>
16
+ <p>Amazon Managed Service for Prometheus includes two APIs.</p>
17
+ <ul>
18
+ <li>
19
+ <p>Use the Amazon Web Services API described in this guide to manage Amazon Managed Service for Prometheus resources, such as workspaces, rule groups, and alert
20
+ managers.</p>
21
+ </li>
22
+ <li>
23
+ <p>Use the <a href="https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-APIReference.html#AMP-APIReference-Prometheus-Compatible-Apis">Prometheus-compatible API</a> to work within your Prometheus
24
+ workspace.</p>
25
+ </li>
26
+ </ul>
10
27
 
11
28
  ## Installing
12
29
 
@@ -0,0 +1 @@
1
+ module.exports = require("../index.js");
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveHttpAuthSchemeConfig = exports.defaultAmpHttpAuthSchemeProvider = exports.defaultAmpHttpAuthSchemeParametersProvider = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const util_middleware_1 = require("@smithy/util-middleware");
6
+ const defaultAmpHttpAuthSchemeParametersProvider = async (config, context, input) => {
7
+ return {
8
+ operation: (0, util_middleware_1.getSmithyContext)(context).operation,
9
+ region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
10
+ (() => {
11
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
12
+ })(),
13
+ };
14
+ };
15
+ exports.defaultAmpHttpAuthSchemeParametersProvider = defaultAmpHttpAuthSchemeParametersProvider;
16
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
17
+ return {
18
+ schemeId: "aws.auth#sigv4",
19
+ signingProperties: {
20
+ name: "aps",
21
+ region: authParameters.region,
22
+ },
23
+ propertiesExtractor: (config, context) => ({
24
+ signingProperties: {
25
+ config,
26
+ context,
27
+ },
28
+ }),
29
+ };
30
+ }
31
+ const defaultAmpHttpAuthSchemeProvider = (authParameters) => {
32
+ const options = [];
33
+ switch (authParameters.operation) {
34
+ default: {
35
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
36
+ }
37
+ }
38
+ return options;
39
+ };
40
+ exports.defaultAmpHttpAuthSchemeProvider = defaultAmpHttpAuthSchemeProvider;
41
+ const resolveHttpAuthSchemeConfig = (config) => {
42
+ const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
43
+ return {
44
+ ...config_0,
45
+ };
46
+ };
47
+ exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
package/dist-cjs/index.js CHANGED
@@ -85,13 +85,14 @@ module.exports = __toCommonJS(src_exports);
85
85
  var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
86
86
  var import_middleware_logger = require("@aws-sdk/middleware-logger");
87
87
  var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
88
- var import_middleware_signing = require("@aws-sdk/middleware-signing");
89
88
  var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
90
89
  var import_config_resolver = require("@smithy/config-resolver");
90
+ var import_core = require("@smithy/core");
91
91
  var import_middleware_content_length = require("@smithy/middleware-content-length");
92
92
  var import_middleware_endpoint = require("@smithy/middleware-endpoint");
93
93
  var import_middleware_retry = require("@smithy/middleware-retry");
94
94
 
95
+ var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
95
96
 
96
97
  // src/endpoint/EndpointParameters.ts
97
98
  var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
@@ -116,19 +117,62 @@ var import_runtimeConfig = require("././runtimeConfig");
116
117
  var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
117
118
  var import_protocol_http = require("@smithy/protocol-http");
118
119
  var import_smithy_client = require("@smithy/smithy-client");
120
+
121
+ // src/auth/httpAuthExtensionConfiguration.ts
122
+ var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
123
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
124
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
125
+ let _credentials = runtimeConfig.credentials;
126
+ return {
127
+ setHttpAuthScheme(httpAuthScheme) {
128
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
129
+ if (index === -1) {
130
+ _httpAuthSchemes.push(httpAuthScheme);
131
+ } else {
132
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
133
+ }
134
+ },
135
+ httpAuthSchemes() {
136
+ return _httpAuthSchemes;
137
+ },
138
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
139
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
140
+ },
141
+ httpAuthSchemeProvider() {
142
+ return _httpAuthSchemeProvider;
143
+ },
144
+ setCredentials(credentials) {
145
+ _credentials = credentials;
146
+ },
147
+ credentials() {
148
+ return _credentials;
149
+ }
150
+ };
151
+ }, "getHttpAuthExtensionConfiguration");
152
+ var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
153
+ return {
154
+ httpAuthSchemes: config.httpAuthSchemes(),
155
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
156
+ credentials: config.credentials()
157
+ };
158
+ }, "resolveHttpAuthRuntimeConfig");
159
+
160
+ // src/runtimeExtensions.ts
119
161
  var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
120
162
  var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
121
163
  const extensionConfiguration = {
122
164
  ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
123
165
  ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
124
- ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
166
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
167
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
125
168
  };
126
169
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
127
170
  return {
128
171
  ...runtimeConfig,
129
172
  ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
130
173
  ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
131
- ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
174
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
175
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
132
176
  };
133
177
  }, "resolveRuntimeExtensions");
134
178
 
@@ -141,8 +185,8 @@ var _AmpClient = class _AmpClient extends import_smithy_client.Client {
141
185
  const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
142
186
  const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
143
187
  const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
144
- const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
145
- const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
188
+ const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
189
+ const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
146
190
  const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
147
191
  super(_config_8);
148
192
  this.config = _config_8;
@@ -151,8 +195,14 @@ var _AmpClient = class _AmpClient extends import_smithy_client.Client {
151
195
  this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
152
196
  this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
153
197
  this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
154
- this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
155
198
  this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
199
+ this.middlewareStack.use(
200
+ (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
201
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
202
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider()
203
+ })
204
+ );
205
+ this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
156
206
  }
157
207
  /**
158
208
  * Destroy underlying resources, like sockets. It's usually not necessary to do this.
@@ -162,6 +212,14 @@ var _AmpClient = class _AmpClient extends import_smithy_client.Client {
162
212
  destroy() {
163
213
  super.destroy();
164
214
  }
215
+ getDefaultHttpAuthSchemeParametersProvider() {
216
+ return import_httpAuthSchemeProvider.defaultAmpHttpAuthSchemeParametersProvider;
217
+ }
218
+ getIdentityProviderConfigProvider() {
219
+ return async (config) => new import_core.DefaultIdentityProviderConfig({
220
+ "aws.auth#sigv4": config.credentials
221
+ });
222
+ }
165
223
  };
166
224
  __name(_AmpClient, "AmpClient");
167
225
  var AmpClient = _AmpClient;
@@ -176,8 +234,8 @@ var import_middleware_serde = require("@smithy/middleware-serde");
176
234
  var import_types = require("@smithy/types");
177
235
 
178
236
  // src/protocols/Aws_restJson1.ts
179
- var import_core = require("@aws-sdk/core");
180
- var import_core2 = require("@smithy/core");
237
+ var import_core2 = require("@aws-sdk/core");
238
+
181
239
 
182
240
  var import_uuid = require("uuid");
183
241
 
@@ -486,7 +544,7 @@ var RuleGroupsNamespaceStatusCode = {
486
544
 
487
545
  // src/protocols/Aws_restJson1.ts
488
546
  var se_CreateAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => {
489
- const b = (0, import_core2.requestBuilder)(input, context);
547
+ const b = (0, import_core.requestBuilder)(input, context);
490
548
  const headers = {
491
549
  "content-type": "application/json"
492
550
  };
@@ -503,7 +561,7 @@ var se_CreateAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (input
503
561
  return b.build();
504
562
  }, "se_CreateAlertManagerDefinitionCommand");
505
563
  var se_CreateLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
506
- const b = (0, import_core2.requestBuilder)(input, context);
564
+ const b = (0, import_core.requestBuilder)(input, context);
507
565
  const headers = {
508
566
  "content-type": "application/json"
509
567
  };
@@ -520,7 +578,7 @@ var se_CreateLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input,
520
578
  return b.build();
521
579
  }, "se_CreateLoggingConfigurationCommand");
522
580
  var se_CreateRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input, context) => {
523
- const b = (0, import_core2.requestBuilder)(input, context);
581
+ const b = (0, import_core.requestBuilder)(input, context);
524
582
  const headers = {
525
583
  "content-type": "application/json"
526
584
  };
@@ -539,7 +597,7 @@ var se_CreateRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input, c
539
597
  return b.build();
540
598
  }, "se_CreateRuleGroupsNamespaceCommand");
541
599
  var se_CreateScraperCommand = /* @__PURE__ */ __name(async (input, context) => {
542
- const b = (0, import_core2.requestBuilder)(input, context);
600
+ const b = (0, import_core.requestBuilder)(input, context);
543
601
  const headers = {
544
602
  "content-type": "application/json"
545
603
  };
@@ -559,7 +617,7 @@ var se_CreateScraperCommand = /* @__PURE__ */ __name(async (input, context) => {
559
617
  return b.build();
560
618
  }, "se_CreateScraperCommand");
561
619
  var se_CreateWorkspaceCommand = /* @__PURE__ */ __name(async (input, context) => {
562
- const b = (0, import_core2.requestBuilder)(input, context);
620
+ const b = (0, import_core.requestBuilder)(input, context);
563
621
  const headers = {
564
622
  "content-type": "application/json"
565
623
  };
@@ -577,7 +635,7 @@ var se_CreateWorkspaceCommand = /* @__PURE__ */ __name(async (input, context) =>
577
635
  return b.build();
578
636
  }, "se_CreateWorkspaceCommand");
579
637
  var se_DeleteAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => {
580
- const b = (0, import_core2.requestBuilder)(input, context);
638
+ const b = (0, import_core.requestBuilder)(input, context);
581
639
  const headers = {};
582
640
  b.bp("/workspaces/{workspaceId}/alertmanager/definition");
583
641
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -589,7 +647,7 @@ var se_DeleteAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (input
589
647
  return b.build();
590
648
  }, "se_DeleteAlertManagerDefinitionCommand");
591
649
  var se_DeleteLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
592
- const b = (0, import_core2.requestBuilder)(input, context);
650
+ const b = (0, import_core.requestBuilder)(input, context);
593
651
  const headers = {};
594
652
  b.bp("/workspaces/{workspaceId}/logging");
595
653
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -601,7 +659,7 @@ var se_DeleteLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input,
601
659
  return b.build();
602
660
  }, "se_DeleteLoggingConfigurationCommand");
603
661
  var se_DeleteRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input, context) => {
604
- const b = (0, import_core2.requestBuilder)(input, context);
662
+ const b = (0, import_core.requestBuilder)(input, context);
605
663
  const headers = {};
606
664
  b.bp("/workspaces/{workspaceId}/rulegroupsnamespaces/{name}");
607
665
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -614,7 +672,7 @@ var se_DeleteRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input, c
614
672
  return b.build();
615
673
  }, "se_DeleteRuleGroupsNamespaceCommand");
616
674
  var se_DeleteScraperCommand = /* @__PURE__ */ __name(async (input, context) => {
617
- const b = (0, import_core2.requestBuilder)(input, context);
675
+ const b = (0, import_core.requestBuilder)(input, context);
618
676
  const headers = {};
619
677
  b.bp("/scrapers/{scraperId}");
620
678
  b.p("scraperId", () => input.scraperId, "{scraperId}", false);
@@ -626,7 +684,7 @@ var se_DeleteScraperCommand = /* @__PURE__ */ __name(async (input, context) => {
626
684
  return b.build();
627
685
  }, "se_DeleteScraperCommand");
628
686
  var se_DeleteWorkspaceCommand = /* @__PURE__ */ __name(async (input, context) => {
629
- const b = (0, import_core2.requestBuilder)(input, context);
687
+ const b = (0, import_core.requestBuilder)(input, context);
630
688
  const headers = {};
631
689
  b.bp("/workspaces/{workspaceId}");
632
690
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -638,7 +696,7 @@ var se_DeleteWorkspaceCommand = /* @__PURE__ */ __name(async (input, context) =>
638
696
  return b.build();
639
697
  }, "se_DeleteWorkspaceCommand");
640
698
  var se_DescribeAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => {
641
- const b = (0, import_core2.requestBuilder)(input, context);
699
+ const b = (0, import_core.requestBuilder)(input, context);
642
700
  const headers = {};
643
701
  b.bp("/workspaces/{workspaceId}/alertmanager/definition");
644
702
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -647,7 +705,7 @@ var se_DescribeAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (inp
647
705
  return b.build();
648
706
  }, "se_DescribeAlertManagerDefinitionCommand");
649
707
  var se_DescribeLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
650
- const b = (0, import_core2.requestBuilder)(input, context);
708
+ const b = (0, import_core.requestBuilder)(input, context);
651
709
  const headers = {};
652
710
  b.bp("/workspaces/{workspaceId}/logging");
653
711
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -656,7 +714,7 @@ var se_DescribeLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input
656
714
  return b.build();
657
715
  }, "se_DescribeLoggingConfigurationCommand");
658
716
  var se_DescribeRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input, context) => {
659
- const b = (0, import_core2.requestBuilder)(input, context);
717
+ const b = (0, import_core.requestBuilder)(input, context);
660
718
  const headers = {};
661
719
  b.bp("/workspaces/{workspaceId}/rulegroupsnamespaces/{name}");
662
720
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -666,7 +724,7 @@ var se_DescribeRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input,
666
724
  return b.build();
667
725
  }, "se_DescribeRuleGroupsNamespaceCommand");
668
726
  var se_DescribeScraperCommand = /* @__PURE__ */ __name(async (input, context) => {
669
- const b = (0, import_core2.requestBuilder)(input, context);
727
+ const b = (0, import_core.requestBuilder)(input, context);
670
728
  const headers = {};
671
729
  b.bp("/scrapers/{scraperId}");
672
730
  b.p("scraperId", () => input.scraperId, "{scraperId}", false);
@@ -675,7 +733,7 @@ var se_DescribeScraperCommand = /* @__PURE__ */ __name(async (input, context) =>
675
733
  return b.build();
676
734
  }, "se_DescribeScraperCommand");
677
735
  var se_DescribeWorkspaceCommand = /* @__PURE__ */ __name(async (input, context) => {
678
- const b = (0, import_core2.requestBuilder)(input, context);
736
+ const b = (0, import_core.requestBuilder)(input, context);
679
737
  const headers = {};
680
738
  b.bp("/workspaces/{workspaceId}");
681
739
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -684,7 +742,7 @@ var se_DescribeWorkspaceCommand = /* @__PURE__ */ __name(async (input, context)
684
742
  return b.build();
685
743
  }, "se_DescribeWorkspaceCommand");
686
744
  var se_GetDefaultScraperConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
687
- const b = (0, import_core2.requestBuilder)(input, context);
745
+ const b = (0, import_core.requestBuilder)(input, context);
688
746
  const headers = {
689
747
  "content-type": "application/json"
690
748
  };
@@ -695,7 +753,7 @@ var se_GetDefaultScraperConfigurationCommand = /* @__PURE__ */ __name(async (inp
695
753
  return b.build();
696
754
  }, "se_GetDefaultScraperConfigurationCommand");
697
755
  var se_ListRuleGroupsNamespacesCommand = /* @__PURE__ */ __name(async (input, context) => {
698
- const b = (0, import_core2.requestBuilder)(input, context);
756
+ const b = (0, import_core.requestBuilder)(input, context);
699
757
  const headers = {};
700
758
  b.bp("/workspaces/{workspaceId}/rulegroupsnamespaces");
701
759
  b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
@@ -709,7 +767,7 @@ var se_ListRuleGroupsNamespacesCommand = /* @__PURE__ */ __name(async (input, co
709
767
  return b.build();
710
768
  }, "se_ListRuleGroupsNamespacesCommand");
711
769
  var se_ListScrapersCommand = /* @__PURE__ */ __name(async (input, context) => {
712
- const b = (0, import_core2.requestBuilder)(input, context);
770
+ const b = (0, import_core.requestBuilder)(input, context);
713
771
  const headers = {};
714
772
  b.bp("/scrapers");
715
773
  const query = (0, import_smithy_client.map)({
@@ -722,7 +780,7 @@ var se_ListScrapersCommand = /* @__PURE__ */ __name(async (input, context) => {
722
780
  return b.build();
723
781
  }, "se_ListScrapersCommand");
724
782
  var se_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
725
- const b = (0, import_core2.requestBuilder)(input, context);
783
+ const b = (0, import_core.requestBuilder)(input, context);
726
784
  const headers = {};
727
785
  b.bp("/tags/{resourceArn}");
728
786
  b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
@@ -731,7 +789,7 @@ var se_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (input, context
731
789
  return b.build();
732
790
  }, "se_ListTagsForResourceCommand");
733
791
  var se_ListWorkspacesCommand = /* @__PURE__ */ __name(async (input, context) => {
734
- const b = (0, import_core2.requestBuilder)(input, context);
792
+ const b = (0, import_core.requestBuilder)(input, context);
735
793
  const headers = {};
736
794
  b.bp("/workspaces");
737
795
  const query = (0, import_smithy_client.map)({
@@ -744,7 +802,7 @@ var se_ListWorkspacesCommand = /* @__PURE__ */ __name(async (input, context) =>
744
802
  return b.build();
745
803
  }, "se_ListWorkspacesCommand");
746
804
  var se_PutAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (input, context) => {
747
- const b = (0, import_core2.requestBuilder)(input, context);
805
+ const b = (0, import_core.requestBuilder)(input, context);
748
806
  const headers = {
749
807
  "content-type": "application/json"
750
808
  };
@@ -761,7 +819,7 @@ var se_PutAlertManagerDefinitionCommand = /* @__PURE__ */ __name(async (input, c
761
819
  return b.build();
762
820
  }, "se_PutAlertManagerDefinitionCommand");
763
821
  var se_PutRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input, context) => {
764
- const b = (0, import_core2.requestBuilder)(input, context);
822
+ const b = (0, import_core.requestBuilder)(input, context);
765
823
  const headers = {
766
824
  "content-type": "application/json"
767
825
  };
@@ -779,7 +837,7 @@ var se_PutRuleGroupsNamespaceCommand = /* @__PURE__ */ __name(async (input, cont
779
837
  return b.build();
780
838
  }, "se_PutRuleGroupsNamespaceCommand");
781
839
  var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
782
- const b = (0, import_core2.requestBuilder)(input, context);
840
+ const b = (0, import_core.requestBuilder)(input, context);
783
841
  const headers = {
784
842
  "content-type": "application/json"
785
843
  };
@@ -795,7 +853,7 @@ var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
795
853
  return b.build();
796
854
  }, "se_TagResourceCommand");
797
855
  var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
798
- const b = (0, import_core2.requestBuilder)(input, context);
856
+ const b = (0, import_core.requestBuilder)(input, context);
799
857
  const headers = {};
800
858
  b.bp("/tags/{resourceArn}");
801
859
  b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
@@ -810,7 +868,7 @@ var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => {
810
868
  return b.build();
811
869
  }, "se_UntagResourceCommand");
812
870
  var se_UpdateLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input, context) => {
813
- const b = (0, import_core2.requestBuilder)(input, context);
871
+ const b = (0, import_core.requestBuilder)(input, context);
814
872
  const headers = {
815
873
  "content-type": "application/json"
816
874
  };
@@ -827,7 +885,7 @@ var se_UpdateLoggingConfigurationCommand = /* @__PURE__ */ __name(async (input,
827
885
  return b.build();
828
886
  }, "se_UpdateLoggingConfigurationCommand");
829
887
  var se_UpdateWorkspaceAliasCommand = /* @__PURE__ */ __name(async (input, context) => {
830
- const b = (0, import_core2.requestBuilder)(input, context);
888
+ const b = (0, import_core.requestBuilder)(input, context);
831
889
  const headers = {
832
890
  "content-type": "application/json"
833
891
  };
@@ -1404,12 +1462,12 @@ var de_ScraperDescription = /* @__PURE__ */ __name((output, context) => {
1404
1462
  alias: import_smithy_client.expectString,
1405
1463
  arn: import_smithy_client.expectString,
1406
1464
  createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1407
- destination: (_) => (0, import_smithy_client._json)((0, import_core.awsExpectUnion)(_)),
1465
+ destination: (_) => (0, import_smithy_client._json)((0, import_core2.awsExpectUnion)(_)),
1408
1466
  lastModifiedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1409
1467
  roleArn: import_smithy_client.expectString,
1410
- scrapeConfiguration: (_) => de_ScrapeConfiguration((0, import_core.awsExpectUnion)(_), context),
1468
+ scrapeConfiguration: (_) => de_ScrapeConfiguration((0, import_core2.awsExpectUnion)(_), context),
1411
1469
  scraperId: import_smithy_client.expectString,
1412
- source: (_) => (0, import_smithy_client._json)((0, import_core.awsExpectUnion)(_)),
1470
+ source: (_) => (0, import_smithy_client._json)((0, import_core2.awsExpectUnion)(_)),
1413
1471
  status: import_smithy_client._json,
1414
1472
  statusReason: import_smithy_client.expectString,
1415
1473
  tags: import_smithy_client._json
@@ -1420,11 +1478,11 @@ var de_ScraperSummary = /* @__PURE__ */ __name((output, context) => {
1420
1478
  alias: import_smithy_client.expectString,
1421
1479
  arn: import_smithy_client.expectString,
1422
1480
  createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1423
- destination: (_) => (0, import_smithy_client._json)((0, import_core.awsExpectUnion)(_)),
1481
+ destination: (_) => (0, import_smithy_client._json)((0, import_core2.awsExpectUnion)(_)),
1424
1482
  lastModifiedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
1425
1483
  roleArn: import_smithy_client.expectString,
1426
1484
  scraperId: import_smithy_client.expectString,
1427
- source: (_) => (0, import_smithy_client._json)((0, import_core.awsExpectUnion)(_)),
1485
+ source: (_) => (0, import_smithy_client._json)((0, import_core2.awsExpectUnion)(_)),
1428
1486
  status: import_smithy_client._json,
1429
1487
  statusReason: import_smithy_client.expectString,
1430
1488
  tags: import_smithy_client._json
@@ -1995,16 +2053,16 @@ var Amp = _Amp;
1995
2053
  (0, import_smithy_client.createAggregatedClient)(commands, Amp);
1996
2054
 
1997
2055
  // src/pagination/ListRuleGroupsNamespacesPaginator.ts
1998
- var import_core3 = require("@smithy/core");
1999
- var paginateListRuleGroupsNamespaces = (0, import_core3.createPaginator)(AmpClient, ListRuleGroupsNamespacesCommand, "nextToken", "nextToken", "maxResults");
2056
+
2057
+ var paginateListRuleGroupsNamespaces = (0, import_core.createPaginator)(AmpClient, ListRuleGroupsNamespacesCommand, "nextToken", "nextToken", "maxResults");
2000
2058
 
2001
2059
  // src/pagination/ListScrapersPaginator.ts
2002
- var import_core4 = require("@smithy/core");
2003
- var paginateListScrapers = (0, import_core4.createPaginator)(AmpClient, ListScrapersCommand, "nextToken", "nextToken", "maxResults");
2060
+
2061
+ var paginateListScrapers = (0, import_core.createPaginator)(AmpClient, ListScrapersCommand, "nextToken", "nextToken", "maxResults");
2004
2062
 
2005
2063
  // src/pagination/ListWorkspacesPaginator.ts
2006
- var import_core5 = require("@smithy/core");
2007
- var paginateListWorkspaces = (0, import_core5.createPaginator)(AmpClient, ListWorkspacesCommand, "nextToken", "nextToken", "maxResults");
2064
+
2065
+ var paginateListWorkspaces = (0, import_core.createPaginator)(AmpClient, ListWorkspacesCommand, "nextToken", "nextToken", "maxResults");
2008
2066
 
2009
2067
  // src/waiters/waitForScraperActive.ts
2010
2068
  var import_util_waiter = require("@smithy/util-waiter");
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
4
5
  const smithy_client_1 = require("@smithy/smithy-client");
5
6
  const url_parser_1 = require("@smithy/url-parser");
6
7
  const util_base64_1 = require("@smithy/util-base64");
7
8
  const util_utf8_1 = require("@smithy/util-utf8");
9
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
8
10
  const endpointResolver_1 = require("./endpoint/endpointResolver");
9
11
  const getRuntimeConfig = (config) => {
10
12
  return {
@@ -14,6 +16,14 @@ const getRuntimeConfig = (config) => {
14
16
  disableHostPrefix: config?.disableHostPrefix ?? false,
15
17
  endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
16
18
  extensions: config?.extensions ?? [],
19
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultAmpHttpAuthSchemeProvider,
20
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
21
+ {
22
+ schemeId: "aws.auth#sigv4",
23
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
24
+ signer: new core_1.AwsSdkSigV4Signer(),
25
+ },
26
+ ],
17
27
  logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
18
28
  serviceId: config?.serviceId ?? "amp",
19
29
  urlParser: config?.urlParser ?? url_parser_1.parseUrl,
@@ -1,13 +1,14 @@
1
1
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
2
2
  import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3
3
  import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
4
- import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
5
4
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
6
5
  import { resolveRegionConfig } from "@smithy/config-resolver";
6
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
7
7
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
8
8
  import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
9
9
  import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
10
10
  import { Client as __Client, } from "@smithy/smithy-client";
11
+ import { defaultAmpHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
11
12
  import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
12
13
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
13
14
  import { resolveRuntimeExtensions } from "./runtimeExtensions";
@@ -20,8 +21,8 @@ export class AmpClient extends __Client {
20
21
  const _config_3 = resolveEndpointConfig(_config_2);
21
22
  const _config_4 = resolveRetryConfig(_config_3);
22
23
  const _config_5 = resolveHostHeaderConfig(_config_4);
23
- const _config_6 = resolveAwsAuthConfig(_config_5);
24
- const _config_7 = resolveUserAgentConfig(_config_6);
24
+ const _config_6 = resolveUserAgentConfig(_config_5);
25
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
25
26
  const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
26
27
  super(_config_8);
27
28
  this.config = _config_8;
@@ -30,10 +31,22 @@ export class AmpClient extends __Client {
30
31
  this.middlewareStack.use(getHostHeaderPlugin(this.config));
31
32
  this.middlewareStack.use(getLoggerPlugin(this.config));
32
33
  this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
33
- this.middlewareStack.use(getAwsAuthPlugin(this.config));
34
34
  this.middlewareStack.use(getUserAgentPlugin(this.config));
35
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
36
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
37
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
38
+ }));
39
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
35
40
  }
36
41
  destroy() {
37
42
  super.destroy();
38
43
  }
44
+ getDefaultHttpAuthSchemeParametersProvider() {
45
+ return defaultAmpHttpAuthSchemeParametersProvider;
46
+ }
47
+ getIdentityProviderConfigProvider() {
48
+ return async (config) => new DefaultIdentityProviderConfig({
49
+ "aws.auth#sigv4": config.credentials,
50
+ });
51
+ }
39
52
  }
@@ -0,0 +1,38 @@
1
+ export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
2
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
4
+ let _credentials = runtimeConfig.credentials;
5
+ return {
6
+ setHttpAuthScheme(httpAuthScheme) {
7
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
8
+ if (index === -1) {
9
+ _httpAuthSchemes.push(httpAuthScheme);
10
+ }
11
+ else {
12
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
13
+ }
14
+ },
15
+ httpAuthSchemes() {
16
+ return _httpAuthSchemes;
17
+ },
18
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
19
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
20
+ },
21
+ httpAuthSchemeProvider() {
22
+ return _httpAuthSchemeProvider;
23
+ },
24
+ setCredentials(credentials) {
25
+ _credentials = credentials;
26
+ },
27
+ credentials() {
28
+ return _credentials;
29
+ },
30
+ };
31
+ };
32
+ export const resolveHttpAuthRuntimeConfig = (config) => {
33
+ return {
34
+ httpAuthSchemes: config.httpAuthSchemes(),
35
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
36
+ credentials: config.credentials(),
37
+ };
38
+ };
@@ -0,0 +1,41 @@
1
+ import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
2
+ import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
3
+ export const defaultAmpHttpAuthSchemeParametersProvider = async (config, context, input) => {
4
+ return {
5
+ operation: getSmithyContext(context).operation,
6
+ region: (await normalizeProvider(config.region)()) ||
7
+ (() => {
8
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
9
+ })(),
10
+ };
11
+ };
12
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
13
+ return {
14
+ schemeId: "aws.auth#sigv4",
15
+ signingProperties: {
16
+ name: "aps",
17
+ region: authParameters.region,
18
+ },
19
+ propertiesExtractor: (config, context) => ({
20
+ signingProperties: {
21
+ config,
22
+ context,
23
+ },
24
+ }),
25
+ };
26
+ }
27
+ export const defaultAmpHttpAuthSchemeProvider = (authParameters) => {
28
+ const options = [];
29
+ switch (authParameters.operation) {
30
+ default: {
31
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
32
+ }
33
+ }
34
+ return options;
35
+ };
36
+ export const resolveHttpAuthSchemeConfig = (config) => {
37
+ const config_0 = resolveAwsSdkSigV4Config(config);
38
+ return {
39
+ ...config_0,
40
+ };
41
+ };