@microsoft/applicationinsights-common 3.4.0-nightlybeta3.2602-27 → 3.4.1

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,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.2602-27
2
+ * Application Insights JavaScript SDK - Common, 3.4.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,65 +1,62 @@
1
- {
2
- "name": "@microsoft/applicationinsights-common",
3
- "version": "3.4.0-nightlybeta3.2602-27",
4
- "description": "Microsoft Application Insights Common JavaScript Library",
5
- "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
6
- "author": "Microsoft Application Insights Team",
7
- "main": "dist/es5/applicationinsights-common.js",
8
- "module": "dist-es5/applicationinsights-common.js",
9
- "types": "types/applicationinsights-common.d.ts",
10
- "sideEffects": false,
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/AppInsightsCommon"
14
- },
15
- "scripts": {
16
- "clean": "git clean -xdf",
17
- "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
18
- "build:esm": "grunt common",
19
- "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
20
- "rebuild": "npm run build",
21
- "test": "",
22
- "mintest": "",
23
- "lint": "tslint -p tsconfig.json",
24
- "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights Common JavaScript Library\"",
25
- "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
26
- "ai-min": "grunt common-min",
27
- "ai-restore": "grunt common-restore",
28
- "npm-pack": "npm pack",
29
- "api-docs": "typedoc"
30
- },
31
- "devDependencies": {
32
- "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
33
- "@microsoft/applicationinsights-rollup-es5": "1.0.2",
34
- "@microsoft/api-extractor": "^7.40.0",
35
- "grunt": "^1.6.1",
36
- "grunt-cli": "^1.5.0",
37
- "@nevware21/grunt-ts-plugin": "^0.5.1",
38
- "@nevware21/grunt-eslint-ts": "^0.5.1",
39
- "@rollup/plugin-commonjs": "^24.0.0",
40
- "@rollup/plugin-node-resolve": "^15.0.1",
41
- "@rollup/plugin-replace": "^5.0.2",
42
- "rollup": "^3.20.0",
43
- "rollup-plugin-cleanup": "^3.2.1",
44
- "rollup-plugin-sourcemaps": "^0.6.3",
45
- "typescript": "^4.9.3",
46
- "tslib": "^2.0.0",
47
- "typedoc": "^0.26.6",
48
- "globby": "^11.0.0",
49
- "magic-string": "^0.25.7",
50
- "sinon": "^7.3.1"
51
- },
52
- "peerDependencies": {
53
- "tslib": ">= 1.0.0"
54
- },
55
- "dependencies": {
56
- "@microsoft/applicationinsights-shims": "3.0.1",
57
- "@microsoft/applicationinsights-core-js": "3.4.0-nightlybeta3.2602-27",
58
- "@microsoft/dynamicproto-js": "^2.0.3",
59
- "@nevware21/ts-utils": ">= 0.12.6 < 2.x"
60
- },
61
- "license": "MIT",
62
- "publishConfig": {
63
- "tag": "nightlybeta3"
64
- }
65
- }
1
+ {
2
+ "name": "@microsoft/applicationinsights-common",
3
+ "version": "3.4.1",
4
+ "description": "Microsoft Application Insights Common JavaScript Library",
5
+ "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
6
+ "author": "Microsoft Application Insights Team",
7
+ "main": "dist/es5/applicationinsights-common.js",
8
+ "module": "dist-es5/applicationinsights-common.js",
9
+ "types": "types/applicationinsights-common.d.ts",
10
+ "sideEffects": false,
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/shared/AppInsightsCommon"
14
+ },
15
+ "scripts": {
16
+ "clean": "git clean -xdf",
17
+ "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
18
+ "build:esm": "grunt common",
19
+ "build:browser": "rollup -c rollup.config.js --bundleConfigAsCjs",
20
+ "rebuild": "npm run build",
21
+ "test": "",
22
+ "mintest": "",
23
+ "lint": "tslint -p tsconfig.json",
24
+ "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights Common JavaScript Library\"",
25
+ "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
26
+ "ai-min": "grunt common-min",
27
+ "ai-restore": "grunt common-restore",
28
+ "npm-pack": "npm pack",
29
+ "api-docs": "typedoc"
30
+ },
31
+ "devDependencies": {
32
+ "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
33
+ "@microsoft/applicationinsights-rollup-es5": "1.0.2",
34
+ "@microsoft/api-extractor": "^7.40.0",
35
+ "grunt": "^1.6.1",
36
+ "grunt-cli": "^1.5.0",
37
+ "@nevware21/grunt-ts-plugin": "^0.5.1",
38
+ "@nevware21/grunt-eslint-ts": "^0.5.1",
39
+ "@rollup/plugin-commonjs": "^24.0.0",
40
+ "@rollup/plugin-node-resolve": "^15.0.1",
41
+ "@rollup/plugin-replace": "^5.0.2",
42
+ "rollup": "^3.20.0",
43
+ "rollup-plugin-cleanup": "^3.2.1",
44
+ "rollup-plugin-sourcemaps": "^0.6.3",
45
+ "typescript": "^4.9.3",
46
+ "tslib": "^2.0.0",
47
+ "typedoc": "^0.26.6",
48
+ "globby": "^11.0.0",
49
+ "magic-string": "^0.25.7",
50
+ "sinon": "^7.3.1"
51
+ },
52
+ "peerDependencies": {
53
+ "tslib": ">= 1.0.0"
54
+ },
55
+ "dependencies": {
56
+ "@microsoft/applicationinsights-shims": "3.0.1",
57
+ "@microsoft/applicationinsights-core-js": "3.4.1",
58
+ "@microsoft/dynamicproto-js": "^2.0.3",
59
+ "@nevware21/ts-utils": ">= 0.12.6 < 2.x"
60
+ },
61
+ "license": "MIT"
62
+ }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights Common JavaScript Library, 3.4.0-nightlybeta3.2602-27
2
+ * Microsoft Application Insights Common JavaScript Library, 3.4.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights Common JavaScript Library, 3.4.0-nightlybeta3.2602-27
2
+ * Microsoft Application Insights Common JavaScript Library, 3.4.1
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -697,6 +697,38 @@ declare namespace ApplicationInsights {
697
697
  All = 3
698
698
  }
699
699
 
700
+ /**
701
+ * Controls how the user can configure which parts of the URL should be redacted. Example, certain query parameters, username and password, etc.
702
+ */
703
+ const enum eUrlRedactionOptions {
704
+ /**
705
+ * The default value, will redact the username and password as well as the default set of query parameters
706
+ */
707
+ true = 1,
708
+ /**
709
+ * Does not redact username and password or any query parameters, the URL will be left as is. Note: this is not recommended as it may lead
710
+ * to sensitive data being sent in clear text.
711
+ */
712
+ false = 2,
713
+ /**
714
+ * This will append any additional queryParams that the user has provided through redactQueryParams config to the default set i.e to
715
+ * @defaultValue ["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature"].
716
+ */
717
+ appendToDefault = 3,
718
+ /**
719
+ * This will replace the default set of query parameters to redact with the query parameters defined in redactQueryParams config, if provided by the user.
720
+ */
721
+ replaceDefault = 4,
722
+ /**
723
+ * This will redact username and password in the URL but will not redact any query parameters, even those in the default set.
724
+ */
725
+ usernamePasswordOnly = 5,
726
+ /**
727
+ * This will only redact the query parameter in the default set of query parameters to redact. It will not redact username and password.
728
+ */
729
+ queryParamsOnly = 6
730
+ }
731
+
700
732
  class Event_2 implements IEventData, ISerializable {
701
733
  /**
702
734
  * @deprecated Use the constant EventEnvelopeType instead.
@@ -747,7 +779,7 @@ declare namespace ApplicationInsights {
747
779
  type EventPersistence = number | EventPersistenceValue;
748
780
 
749
781
  /**
750
- * The EventPersistence contains a set of values that specify the event's persistence.
782
+ * The EventPersistenceValue contains a set of values that specify the event's persistence.
751
783
  */
752
784
  const enum EventPersistenceValue {
753
785
  /**
@@ -2014,10 +2046,10 @@ declare namespace ApplicationInsights {
2014
2046
  */
2015
2047
  expCfg?: IExceptionConfig;
2016
2048
  /**
2017
- * [Optional] A flag to enable or disable the use of the field redaction for urls.
2049
+ * [Optional] A flag to enable or disable redaction for query parameters and username/password.
2018
2050
  * @defaultValue true
2019
2051
  */
2020
- redactUrls?: boolean;
2052
+ redactUrls?: UrlRedactionOptions;
2021
2053
  /**
2022
2054
  * [Optional] Additional query parameters to redact beyond the default set.
2023
2055
  * Use this to specify custom parameters that contain sensitive information.
@@ -5710,24 +5742,92 @@ declare namespace ApplicationInsights {
5710
5742
 
5711
5743
  /**
5712
5744
  * Interface for telemetry trace context.
5713
- * @deprecated Use the core getTraceCtx method instead to get / set the current trace context, this is required to
5714
- * support distributed tracing and allows the core to manage the trace context.
5745
+ * @deprecated Use {@link ITraceHost.getTraceCtx | appInsights.getTraceCtx()} or {@link ITraceHost.getTraceCtx | appInsights.core.getTraceCtx()} instead to get / set the
5746
+ * current trace context. This returns an {@link IDistributedTraceContext} which supports distributed tracing and
5747
+ * allows the core to manage the trace context.
5748
+ *
5749
+ * To replace the entire trace context, use {@link ITraceHost.setTraceCtx | appInsights.core.setTraceCtx()}.
5750
+ *
5751
+ * @see {@link https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/IDistributedTraceContext.html | IDistributedTraceContext Typedoc}
5752
+ * @see {@link https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ITraceHost.html#getTraceCtx | getTraceCtx Typedoc}
5715
5753
  */
5716
5754
  interface ITelemetryTrace {
5717
5755
  /**
5718
- * Trace id
5756
+ * The trace ID for this telemetry context. A 32 lowercase hex character string.
5757
+ * @deprecated Use {@link IDistributedTraceContext.traceId} instead via `appInsights.getTraceCtx().traceId`.
5758
+ *
5759
+ * @example
5760
+ * ```typescript
5761
+ * // Old (deprecated)
5762
+ * let traceId = context.telemetryTrace.traceID;
5763
+ *
5764
+ * // New (recommended) - using the standard SKU (AISKU)
5765
+ * let traceCtx = appInsights.getTraceCtx();
5766
+ * let traceId = traceCtx.traceId;
5767
+ * traceCtx.traceId = "00000000000000000000000000000001";
5768
+ *
5769
+ * // Or when using the core directly
5770
+ * let traceCtx = appInsights.core.getTraceCtx();
5771
+ * ```
5719
5772
  */
5720
5773
  traceID?: string;
5721
5774
  /**
5722
- * Parent id
5775
+ * The parent span ID. A 16 lowercase hex character string.
5776
+ * @deprecated Use {@link IDistributedTraceContext.spanId} instead via `appInsights.getTraceCtx().spanId`.
5777
+ *
5778
+ * @example
5779
+ * ```typescript
5780
+ * // Old (deprecated)
5781
+ * let parentId = context.telemetryTrace.parentID;
5782
+ *
5783
+ * // New (recommended) - using the standard SKU (AISKU)
5784
+ * let traceCtx = appInsights.getTraceCtx();
5785
+ * let spanId = traceCtx.spanId;
5786
+ * traceCtx.spanId = "0000000000000001";
5787
+ *
5788
+ * // Or when using the core directly
5789
+ * let traceCtx = appInsights.core.getTraceCtx();
5790
+ * ```
5723
5791
  */
5724
5792
  parentID?: string;
5725
5793
  /**
5726
- * An integer representation of the W3C TraceContext trace-flags. https://www.w3.org/TR/trace-context/#trace-flags
5794
+ * An integer representation of the W3C TraceContext trace-flags.
5795
+ * @deprecated Use {@link IDistributedTraceContext.traceFlags} instead via `appInsights.getTraceCtx().traceFlags`.
5796
+ *
5797
+ * @example
5798
+ * ```typescript
5799
+ * // Old (deprecated)
5800
+ * let flags = context.telemetryTrace.traceFlags;
5801
+ *
5802
+ * // New (recommended) - using the standard SKU (AISKU)
5803
+ * let traceCtx = appInsights.getTraceCtx();
5804
+ * let flags = traceCtx.traceFlags;
5805
+ * traceCtx.traceFlags = 1; // sampled
5806
+ *
5807
+ * // Or when using the core directly
5808
+ * let traceCtx = appInsights.core.getTraceCtx();
5809
+ * ```
5810
+ *
5811
+ * @see {@link https://www.w3.org/TR/trace-context/#trace-flags | W3C TraceContext trace-flags}
5727
5812
  */
5728
5813
  traceFlags?: number;
5729
5814
  /**
5730
- * Name
5815
+ * The operation/page name for this trace context.
5816
+ * @deprecated Use {@link IDistributedTraceContext.pageName} instead via `appInsights.getTraceCtx().pageName`.
5817
+ *
5818
+ * @example
5819
+ * ```typescript
5820
+ * // Old (deprecated)
5821
+ * let name = context.telemetryTrace.name;
5822
+ *
5823
+ * // New (recommended) - using the standard SKU (AISKU)
5824
+ * let traceCtx = appInsights.getTraceCtx();
5825
+ * let pageName = traceCtx.pageName;
5826
+ * traceCtx.pageName = "my-page";
5827
+ *
5828
+ * // Or when using the core directly
5829
+ * let traceCtx = appInsights.core.getTraceCtx();
5830
+ * ```
5731
5831
  */
5732
5832
  name?: string;
5733
5833
  }
@@ -7028,6 +7128,10 @@ declare namespace ApplicationInsights {
7028
7128
 
7029
7129
  function urlParseUrl(url: string): HTMLAnchorElement;
7030
7130
 
7131
+ const UrlRedactionOptions: EnumValue<typeof eUrlRedactionOptions>;
7132
+
7133
+ type UrlRedactionOptions = boolean | eUrlRedactionOptions;
7134
+
7031
7135
  /**
7032
7136
  * Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override
7033
7137
  * any previous disable calls.