@aws-sdk/middleware-user-agent 3.18.0 → 3.25.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.25.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.24.0...v3.25.0) (2021-08-05)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/middleware-user-agent
9
+
10
+
11
+
12
+
13
+
14
+ # [3.23.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.22.0...v3.23.0) (2021-07-23)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * bump up tslib to 2.3.0 ([#2601](https://github.com/aws/aws-sdk-js-v3/issues/2601)) ([7040faa](https://github.com/aws/aws-sdk-js-v3/commit/7040faac07976c1dcfd5240675b82a2f275b2a55))
20
+
21
+
22
+
23
+
24
+
25
+ # [3.22.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.21.0...v3.22.0) (2021-07-16)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **clients:** prefix `dist/` for typesVersions TS<4 ([#2580](https://github.com/aws/aws-sdk-js-v3/issues/2580)) ([dff5cd4](https://github.com/aws/aws-sdk-js-v3/commit/dff5cd4b6fa00453e938ce8f238c1542ee7ba3d6))
31
+
32
+
33
+
34
+
35
+
36
+ # [3.20.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.19.0...v3.20.0) (2021-07-02)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * replace prepublishOnly script with downlevel-dts ([#2537](https://github.com/aws/aws-sdk-js-v3/issues/2537)) ([63818a1](https://github.com/aws/aws-sdk-js-v3/commit/63818a1e47b08af56f092031a01bbbff0a9af590))
42
+
43
+
44
+
45
+
46
+
6
47
  # [3.18.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.17.0...v3.18.0) (2021-06-04)
7
48
 
8
49
  **Note:** Version bump only for package @aws-sdk/middleware-user-agent
@@ -0,0 +1,28 @@
1
+ import { Provider, UserAgent } from "@aws-sdk/types";
2
+ export interface UserAgentInputConfig {
3
+ /**
4
+ * The custom user agent header that would be appended to default one
5
+ */
6
+ customUserAgent?: string | UserAgent;
7
+ }
8
+ interface PreviouslyResolved {
9
+ defaultUserAgentProvider: Provider<UserAgent>;
10
+ runtime: string;
11
+ }
12
+ export interface UserAgentResolvedConfig {
13
+ /**
14
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header.
15
+ * @internal
16
+ */
17
+ defaultUserAgentProvider: Provider<UserAgent>;
18
+ /**
19
+ * The custom user agent header that would be appended to default one
20
+ */
21
+ customUserAgent?: UserAgent;
22
+ /**
23
+ * The runtime environment
24
+ */
25
+ runtime: string;
26
+ }
27
+ export declare function resolveUserAgentConfig<T>(input: T & PreviouslyResolved & UserAgentInputConfig): T & UserAgentResolvedConfig;
28
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const USER_AGENT = "user-agent";
2
+ export declare const X_AMZ_USER_AGENT = "x-amz-user-agent";
3
+ export declare const SPACE = " ";
4
+ export declare const UA_ESCAPE_REGEX: RegExp;
@@ -0,0 +1,2 @@
1
+ export * from "./configurations";
2
+ export * from "./user-agent-middleware";
@@ -0,0 +1,17 @@
1
+ import { AbsoluteLocation, BuildHandler, BuildHandlerOptions, HandlerExecutionContext, MetadataBearer, Pluggable } from "@aws-sdk/types";
2
+ import { UserAgentResolvedConfig } from "./configurations";
3
+ /**
4
+ * Build user agent header sections from:
5
+ * 1. runtime-specific default user agent provider;
6
+ * 2. custom user agent from `customUserAgent` client config;
7
+ * 3. handler execution context set by internal SDK components;
8
+ * The built user agent will be set to `x-amz-user-agent` header for ALL the
9
+ * runtimes.
10
+ * Please note that any override to the `user-agent` or `x-amz-user-agent` header
11
+ * in the HTTP request is discouraged. Please use `customUserAgent` client
12
+ * config or middleware setting the `userAgent` context to generate desired user
13
+ * agent.
14
+ */
15
+ export declare const userAgentMiddleware: (options: UserAgentResolvedConfig) => <Output extends MetadataBearer>(next: BuildHandler<any, any>, context: HandlerExecutionContext) => BuildHandler<any, any>;
16
+ export declare const getUserAgentMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation;
17
+ export declare const getUserAgentPlugin: (config: UserAgentResolvedConfig) => Pluggable<any, any>;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-user-agent",
3
- "version": "3.18.0",
3
+ "version": "3.25.0",
4
4
  "scripts": {
5
- "prepublishOnly": "yarn build && downlevel-dts dist/types dist/types/ts3.4",
6
5
  "build:cjs": "tsc -p tsconfig.cjs.json",
7
6
  "build:es": "tsc -p tsconfig.es.json",
8
7
  "build": "yarn build:es && yarn build:cjs",
8
+ "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4",
9
9
  "test": "jest --passWithNoTests"
10
10
  },
11
11
  "main": "./dist/cjs/index.js",
@@ -17,12 +17,12 @@
17
17
  },
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@aws-sdk/protocol-http": "3.18.0",
21
- "@aws-sdk/types": "3.18.0",
22
- "tslib": "^2.0.0"
20
+ "@aws-sdk/protocol-http": "3.25.0",
21
+ "@aws-sdk/types": "3.25.0",
22
+ "tslib": "^2.3.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@aws-sdk/middleware-stack": "3.18.0",
25
+ "@aws-sdk/middleware-stack": "3.25.0",
26
26
  "@types/jest": "^26.0.4",
27
27
  "jest": "^26.1.0",
28
28
  "typescript": "~4.3.2"
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "typesVersions": {
34
34
  "<4.0": {
35
- "types/*": [
36
- "types/ts3.4/*"
35
+ "dist/types/*": [
36
+ "dist/types/ts3.4/*"
37
37
  ]
38
38
  }
39
39
  },