@microsoft/power-apps-native-common 0.3.2 → 0.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.
package/lib/NOTICE.txt CHANGED
@@ -4,7 +4,7 @@ This repository incorporates material as listed below or described in the code.
4
4
 
5
5
  ========================================================================
6
6
 
7
- @microsoft/1ds-post-js 4.4.1
7
+ @microsoft/1ds-post-js 4.4.5
8
8
  --
9
9
  The MIT License (MIT)
10
10
 
@@ -30,7 +30,7 @@ SOFTWARE.
30
30
 
31
31
  ========================================================================
32
32
 
33
- @microsoft/applicationinsights-channel-js 3.4.3
33
+ @microsoft/applicationinsights-analytics-js 3.4.5
34
34
  --
35
35
  The MIT License (MIT)
36
36
 
@@ -56,7 +56,91 @@ SOFTWARE.
56
56
 
57
57
  ========================================================================
58
58
 
59
- @microsoft/applicationinsights-core-js 3.4.3
59
+ @microsoft/applicationinsights-cfgsync-js 3.4.5
60
+ --
61
+ Copyright Microsoft Application Insights Team; licensed under MIT (https://spdx.org/licenses/MIT.html)
62
+
63
+ ========================================================================
64
+
65
+ @microsoft/applicationinsights-channel-js 3.4.5
66
+ --
67
+ The MIT License (MIT)
68
+
69
+ Copyright (c) Microsoft Corporation
70
+
71
+ Permission is hereby granted, free of charge, to any person obtaining a copy
72
+ of this software and associated documentation files (the "Software"), to deal
73
+ in the Software without restriction, including without limitation the rights
74
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
75
+ copies of the Software, and to permit persons to whom the Software is
76
+ furnished to do so, subject to the following conditions:
77
+
78
+ The above copyright notice and this permission notice shall be included in all
79
+ copies or substantial portions of the Software.
80
+
81
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
82
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
84
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
85
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
86
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
87
+ SOFTWARE.
88
+
89
+ ========================================================================
90
+
91
+ @microsoft/applicationinsights-core-js 3.4.5
92
+ --
93
+ The MIT License (MIT)
94
+
95
+ Copyright (c) Microsoft Corporation
96
+
97
+ Permission is hereby granted, free of charge, to any person obtaining a copy
98
+ of this software and associated documentation files (the "Software"), to deal
99
+ in the Software without restriction, including without limitation the rights
100
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
101
+ copies of the Software, and to permit persons to whom the Software is
102
+ furnished to do so, subject to the following conditions:
103
+
104
+ The above copyright notice and this permission notice shall be included in all
105
+ copies or substantial portions of the Software.
106
+
107
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
108
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
109
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
110
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
111
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
112
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
113
+ SOFTWARE.
114
+
115
+ ========================================================================
116
+
117
+ @microsoft/applicationinsights-dependencies-js 3.4.5
118
+ --
119
+ The MIT License (MIT)
120
+
121
+ Copyright (c) Microsoft Corporation
122
+
123
+ Permission is hereby granted, free of charge, to any person obtaining a copy
124
+ of this software and associated documentation files (the "Software"), to deal
125
+ in the Software without restriction, including without limitation the rights
126
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
127
+ copies of the Software, and to permit persons to whom the Software is
128
+ furnished to do so, subject to the following conditions:
129
+
130
+ The above copyright notice and this permission notice shall be included in all
131
+ copies or substantial portions of the Software.
132
+
133
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
134
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
135
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
136
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
137
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
138
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
139
+ SOFTWARE.
140
+
141
+ ========================================================================
142
+
143
+ @microsoft/applicationinsights-properties-js 3.4.5
60
144
  --
61
145
  The MIT License (MIT)
62
146
 
@@ -134,7 +218,7 @@ SOFTWARE.
134
218
 
135
219
  ========================================================================
136
220
 
137
- @microsoft/applicationinsights-web 3.4.3
221
+ @microsoft/applicationinsights-web 3.4.5
138
222
  --
139
223
  The MIT License (MIT)
140
224
 
@@ -4,8 +4,29 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.buildAnonymousTelemetryData = buildAnonymousTelemetryData;
7
- function buildAnonymousTelemetryData(event, appName, clusterCategory) {
7
+ var _TelemetryTypes = require("./TelemetryTypes.js");
8
+ const HTTP_METHODS = new Set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']);
9
+ function buildAnonymousTelemetryData(event, appName, clusterCategory, defaultProperties = {}) {
8
10
  const operationName = typeof event.properties.operationName === 'string' ? event.properties.operationName : undefined;
11
+ const dimensions = operationName ? {
12
+ operationName
13
+ } : {};
14
+ for (const key of ['devTunnel', 'multiTenant']) {
15
+ const value = defaultProperties[key];
16
+ if (value === 'true' || value === 'false') dimensions[key] = value;
17
+ }
18
+ const scenarioResult = event.properties.scenarioResult;
19
+ if (scenarioResult === _TelemetryTypes.ScenarioResults.Success || scenarioResult === _TelemetryTypes.ScenarioResults.Failed || scenarioResult === _TelemetryTypes.ScenarioResults.SuccessWithErrors) {
20
+ dimensions.scenarioResult = scenarioResult;
21
+ }
22
+ const httpMethod = event.properties.httpMethod;
23
+ if (typeof httpMethod === 'string' && HTTP_METHODS.has(httpMethod.toUpperCase())) {
24
+ dimensions.httpMethod = httpMethod.toUpperCase();
25
+ }
26
+ const httpStatus = event.properties.httpStatus;
27
+ if (typeof httpStatus === 'number' && Number.isInteger(httpStatus) && httpStatus >= 100 && httpStatus <= 599) {
28
+ dimensions.httpStatus = String(httpStatus);
29
+ }
9
30
  return {
10
31
  app_Name: appName,
11
32
  clusterCategory,
@@ -18,8 +39,6 @@ function buildAnonymousTelemetryData(event, appName, clusterCategory) {
18
39
  ...(operationName ? {
19
40
  operation_Name: operationName
20
41
  } : {}),
21
- customDimensions: JSON.stringify(operationName ? {
22
- operationName
23
- } : {})
42
+ customDimensions: JSON.stringify(dimensions)
24
43
  };
25
44
  }
@@ -203,7 +203,7 @@ class OneDsTelemetryProvider {
203
203
  name: 'event',
204
204
  time: event.timestamp,
205
205
  baseType: 'custom',
206
- data: (0, _AnonymousTelemetry.buildAnonymousTelemetryData)(event, this.appName, this.clusterCategory)
206
+ data: (0, _AnonymousTelemetry.buildAnonymousTelemetryData)(event, this.appName, this.clusterCategory, this.defaultProperties)
207
207
  });
208
208
  return;
209
209
  }
@@ -1,7 +1,28 @@
1
1
  "use strict";
2
2
 
3
- export function buildAnonymousTelemetryData(event, appName, clusterCategory) {
3
+ import { ScenarioResults } from "./TelemetryTypes.js";
4
+ const HTTP_METHODS = new Set(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']);
5
+ export function buildAnonymousTelemetryData(event, appName, clusterCategory, defaultProperties = {}) {
4
6
  const operationName = typeof event.properties.operationName === 'string' ? event.properties.operationName : undefined;
7
+ const dimensions = operationName ? {
8
+ operationName
9
+ } : {};
10
+ for (const key of ['devTunnel', 'multiTenant']) {
11
+ const value = defaultProperties[key];
12
+ if (value === 'true' || value === 'false') dimensions[key] = value;
13
+ }
14
+ const scenarioResult = event.properties.scenarioResult;
15
+ if (scenarioResult === ScenarioResults.Success || scenarioResult === ScenarioResults.Failed || scenarioResult === ScenarioResults.SuccessWithErrors) {
16
+ dimensions.scenarioResult = scenarioResult;
17
+ }
18
+ const httpMethod = event.properties.httpMethod;
19
+ if (typeof httpMethod === 'string' && HTTP_METHODS.has(httpMethod.toUpperCase())) {
20
+ dimensions.httpMethod = httpMethod.toUpperCase();
21
+ }
22
+ const httpStatus = event.properties.httpStatus;
23
+ if (typeof httpStatus === 'number' && Number.isInteger(httpStatus) && httpStatus >= 100 && httpStatus <= 599) {
24
+ dimensions.httpStatus = String(httpStatus);
25
+ }
5
26
  return {
6
27
  app_Name: appName,
7
28
  clusterCategory,
@@ -14,8 +35,6 @@ export function buildAnonymousTelemetryData(event, appName, clusterCategory) {
14
35
  ...(operationName ? {
15
36
  operation_Name: operationName
16
37
  } : {}),
17
- customDimensions: JSON.stringify(operationName ? {
18
- operationName
19
- } : {})
38
+ customDimensions: JSON.stringify(dimensions)
20
39
  };
21
40
  }
@@ -199,7 +199,7 @@ export class OneDsTelemetryProvider {
199
199
  name: 'event',
200
200
  time: event.timestamp,
201
201
  baseType: 'custom',
202
- data: buildAnonymousTelemetryData(event, this.appName, this.clusterCategory)
202
+ data: buildAnonymousTelemetryData(event, this.appName, this.clusterCategory, this.defaultProperties)
203
203
  });
204
204
  return;
205
205
  }
@@ -1,4 +1,4 @@
1
1
  import type { ClusterCategory } from '../types/ClusterCategory';
2
- import type { TelemetryEvent } from './TelemetryTypes';
3
- export declare function buildAnonymousTelemetryData(event: TelemetryEvent, appName: string, clusterCategory: ClusterCategory): Record<string, unknown>;
2
+ import { type TelemetryEvent } from './TelemetryTypes';
3
+ export declare function buildAnonymousTelemetryData(event: TelemetryEvent, appName: string, clusterCategory: ClusterCategory, defaultProperties?: Readonly<Record<string, string>>): Record<string, unknown>;
4
4
  //# sourceMappingURL=AnonymousTelemetry.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import type { ClusterCategory } from '../types/ClusterCategory.js';
2
- import type { TelemetryEvent } from './TelemetryTypes.js';
3
- export declare function buildAnonymousTelemetryData(event: TelemetryEvent, appName: string, clusterCategory: ClusterCategory): Record<string, unknown>;
2
+ import { type TelemetryEvent } from './TelemetryTypes.js';
3
+ export declare function buildAnonymousTelemetryData(event: TelemetryEvent, appName: string, clusterCategory: ClusterCategory, defaultProperties?: Readonly<Record<string, string>>): Record<string, unknown>;
4
4
  //# sourceMappingURL=AnonymousTelemetry.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/power-apps-native-common",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "description": "Shared utilities and types for Power Apps native packages",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -44,26 +44,25 @@
44
44
  "type-check": "tsc --noEmit"
45
45
  },
46
46
  "peerDependencies": {
47
- "expo-application": ">=6.0.0",
48
- "expo-device": ">=6.0.0",
49
- "expo-secure-store": ">=14.0.0",
50
- "react": ">=19.2.0",
51
- "react-native": ">=0.83.4",
52
- "react-native-get-random-values": ">=1.9.0"
47
+ "expo-application": ">=57.0.2",
48
+ "expo-device": ">=57.0.1",
49
+ "expo-secure-store": ">=57.0.3",
50
+ "react": ">=19.2.3",
51
+ "react-native": ">=0.86.3 <0.87",
52
+ "react-native-get-random-values": ">=1.11.0"
53
53
  },
54
54
  "dependencies": {
55
- "@microsoft/1ds-post-js": "4.4.1",
56
- "@microsoft/applicationinsights-channel-js": "3.4.3",
57
- "@microsoft/applicationinsights-core-js": "3.4.3",
55
+ "@microsoft/1ds-post-js": "4.4.5",
56
+ "@microsoft/applicationinsights-channel-js": "3.4.5",
57
+ "@microsoft/applicationinsights-core-js": "3.4.5",
58
58
  "@microsoft/applicationinsights-react-native": "4.4.1",
59
- "@microsoft/applicationinsights-web": "3.4.3",
59
+ "@microsoft/applicationinsights-web": "3.4.5",
60
60
  "uuid": "^11.1.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@microsoft/power-apps-cli": "0.15.3",
64
63
  "@types/react": "19.2.14",
65
64
  "@types/uuid": "^10.0.0",
66
- "typescript": "5.8.3"
65
+ "typescript": "6.0.3"
67
66
  },
68
67
  "publishConfig": {
69
68
  "access": "public"