@microsoft/power-apps-native-common 0.1.8

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 (72) hide show
  1. package/LICENSE +112 -0
  2. package/README.md +15 -0
  3. package/lib/NOTICE.txt +179 -0
  4. package/lib/commonjs/TelemetryTypes.js +29 -0
  5. package/lib/commonjs/index.js +112 -0
  6. package/lib/commonjs/package.json +1 -0
  7. package/lib/commonjs/telemetry/AppLogger.js +49 -0
  8. package/lib/commonjs/telemetry/ConsoleAdapter.js +64 -0
  9. package/lib/commonjs/telemetry/ILogger.js +5 -0
  10. package/lib/commonjs/telemetry/Logger.js +151 -0
  11. package/lib/commonjs/telemetry/OneDsTelemetryProvider.js +276 -0
  12. package/lib/commonjs/telemetry/TelemetrySanitizer.js +100 -0
  13. package/lib/commonjs/telemetry/TelemetryTypes.js +29 -0
  14. package/lib/commonjs/telemetry/resolveTelemetryLocation.js +42 -0
  15. package/lib/commonjs/telemetry/stringifyError.js +31 -0
  16. package/lib/commonjs/telemetry/suppressKnownWarnings.js +28 -0
  17. package/lib/commonjs/types/ClusterCategory.js +54 -0
  18. package/lib/commonjs/utils/DeviceIdUtils.js +66 -0
  19. package/lib/commonjs/utils/GuidUtils.js +23 -0
  20. package/lib/commonjs/utils/PlatformInfoUtils.js +60 -0
  21. package/lib/module/TelemetryTypes.js +25 -0
  22. package/lib/module/index.js +18 -0
  23. package/lib/module/package.json +1 -0
  24. package/lib/module/telemetry/AppLogger.js +44 -0
  25. package/lib/module/telemetry/ConsoleAdapter.js +59 -0
  26. package/lib/module/telemetry/ILogger.js +3 -0
  27. package/lib/module/telemetry/Logger.js +146 -0
  28. package/lib/module/telemetry/OneDsTelemetryProvider.js +271 -0
  29. package/lib/module/telemetry/TelemetrySanitizer.js +94 -0
  30. package/lib/module/telemetry/TelemetryTypes.js +25 -0
  31. package/lib/module/telemetry/resolveTelemetryLocation.js +38 -0
  32. package/lib/module/telemetry/stringifyError.js +28 -0
  33. package/lib/module/telemetry/suppressKnownWarnings.js +25 -0
  34. package/lib/module/types/ClusterCategory.js +49 -0
  35. package/lib/module/utils/DeviceIdUtils.js +62 -0
  36. package/lib/module/utils/GuidUtils.js +19 -0
  37. package/lib/module/utils/PlatformInfoUtils.js +55 -0
  38. package/lib/typescript/commonjs/TelemetryTypes.d.ts +88 -0
  39. package/lib/typescript/commonjs/index.d.ts +19 -0
  40. package/lib/typescript/commonjs/package.json +1 -0
  41. package/lib/typescript/commonjs/telemetry/AppLogger.d.ts +35 -0
  42. package/lib/typescript/commonjs/telemetry/ConsoleAdapter.d.ts +24 -0
  43. package/lib/typescript/commonjs/telemetry/ILogger.d.ts +45 -0
  44. package/lib/typescript/commonjs/telemetry/Logger.d.ts +28 -0
  45. package/lib/typescript/commonjs/telemetry/OneDsTelemetryProvider.d.ts +39 -0
  46. package/lib/typescript/commonjs/telemetry/TelemetrySanitizer.d.ts +21 -0
  47. package/lib/typescript/commonjs/telemetry/TelemetryTypes.d.ts +88 -0
  48. package/lib/typescript/commonjs/telemetry/resolveTelemetryLocation.d.ts +26 -0
  49. package/lib/typescript/commonjs/telemetry/stringifyError.d.ts +10 -0
  50. package/lib/typescript/commonjs/telemetry/suppressKnownWarnings.d.ts +19 -0
  51. package/lib/typescript/commonjs/types/ClusterCategory.d.ts +37 -0
  52. package/lib/typescript/commonjs/utils/DeviceIdUtils.d.ts +29 -0
  53. package/lib/typescript/commonjs/utils/GuidUtils.d.ts +11 -0
  54. package/lib/typescript/commonjs/utils/PlatformInfoUtils.d.ts +33 -0
  55. package/lib/typescript/module/TelemetryTypes.d.ts +88 -0
  56. package/lib/typescript/module/index.d.ts +19 -0
  57. package/lib/typescript/module/package.json +1 -0
  58. package/lib/typescript/module/telemetry/AppLogger.d.ts +35 -0
  59. package/lib/typescript/module/telemetry/ConsoleAdapter.d.ts +24 -0
  60. package/lib/typescript/module/telemetry/ILogger.d.ts +45 -0
  61. package/lib/typescript/module/telemetry/Logger.d.ts +28 -0
  62. package/lib/typescript/module/telemetry/OneDsTelemetryProvider.d.ts +39 -0
  63. package/lib/typescript/module/telemetry/TelemetrySanitizer.d.ts +21 -0
  64. package/lib/typescript/module/telemetry/TelemetryTypes.d.ts +88 -0
  65. package/lib/typescript/module/telemetry/resolveTelemetryLocation.d.ts +26 -0
  66. package/lib/typescript/module/telemetry/stringifyError.d.ts +10 -0
  67. package/lib/typescript/module/telemetry/suppressKnownWarnings.d.ts +19 -0
  68. package/lib/typescript/module/types/ClusterCategory.d.ts +37 -0
  69. package/lib/typescript/module/utils/DeviceIdUtils.d.ts +29 -0
  70. package/lib/typescript/module/utils/GuidUtils.d.ts +11 -0
  71. package/lib/typescript/module/utils/PlatformInfoUtils.d.ts +33 -0
  72. package/package.json +83 -0
package/LICENSE ADDED
@@ -0,0 +1,112 @@
1
+ MICROSOFT SOFTWARE LICENSE TERMS
2
+ Power App Native Libraries
3
+
4
+ June 2026
5
+ These license terms are an agreement between you and Microsoft Corporation (or based
6
+ on where you live, one of its affiliates). They apply to the software named above. The terms
7
+ also apply to any Microsoft services or updates for the software, except to the extent those
8
+ have different terms.
9
+
10
+ IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
11
+ 1. INSTALLATION AND USE RIGHTS.
12
+ a. This software is licensed as a supplement to Microsoft Power Platform (the “Product”).
13
+ Use of the software requires a valid license for the Product.
14
+ b. You may install and use any number of copies of the software to develop and test your
15
+ applications. It will be used as components to be leveraged by AI agents for creating
16
+ applications.
17
+ 2. Third Party Components. The software may include third party components with
18
+ separate legal notices or governed by other agreements, as may be described in the
19
+ notices file(s) accompanying the software.
20
+ 3. DATA.
21
+ a. Data Collection. The software may collect information about you and your use of the
22
+ software and send that to Microsoft. Microsoft may use this information to provide services
23
+ and improve our products and services. There are also some features in the software that
24
+ may enable you and Microsoft to collect data from users of your applications. If you use
25
+ these features, you must comply with applicable law, including providing appropriate
26
+ notices to users of your applications together with a copy of Microsoft’s privacy statement.
27
+ Our privacy statement is located at https://aka.ms/privacy. You can learn more about data
28
+ collection and its use from the software documentation and our privacy statement. Your
29
+ use of the software operates as your consent to these practices.
30
+ b. Processing of Personal Data. To the extent Microsoft is a processor or sub processor of
31
+ personal data in connection with the software, Microsoft makes the commitments in the
32
+ European Union General Data Protection Regulation Terms of the Microsoft Products and
33
+ Services Data Protection Addendum to all customers effective May 25, 2018, at
34
+ https://docs.microsoft.com/legal/gdpr.
35
+ 4. SCOPE OF LICENSE. The software is licensed, not sold. These license terms only give
36
+ you some rights to use the software. Microsoft reserves all other rights. Unless applicable
37
+ law gives you more rights despite this limitation, you may use the software only as
38
+ expressly permitted in these license terms. In doing so, you must comply with any
39
+ technical limitations in the software that only allow you to use it in certain ways. In
40
+ addition, you may not:
41
+ • work around any technical limitations in the software;
42
+ • use it for any other purpose, other than designated in this license;
43
+ • reverse engineer, decompile or disassemble the software, or otherwise attempt to
44
+ derive the source code for the software, except and only to the extent required by
45
+ third party licensing terms governing use of certain open source components that
46
+ may be included with the software;
47
+ • remove, minimize, block or modify any notices of Microsoft or its suppliers in the
48
+ software;
49
+ • use the software in any way that is against the law;
50
+ • share, publish, rent, or lease the software; or
51
+ • provide the software as a stand-alone offering or combine it with any of your
52
+ applications for others to use, or transfer the software or this agreement to any third
53
+ party.
54
+ 5. FEEDBACK. If you give feedback about the software to Microsoft, you give to Microsoft,
55
+ without charge, the right to use, share, and commercialize your feedback in any way and for
56
+ any purpose. You will not give feedback that is subject to a license that requires Microsoft
57
+ to license its software or documentation to third parties because we include your feedback
58
+ in them. These rights survive this agreement.
59
+ 6. SUPPORT SERVICES. Because this software is “as is”, we may not provide support
60
+ services for it.
61
+ 7. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates,
62
+ Internet-based services and support services, are the entire agreement for the software
63
+ and support services.
64
+ 8. EXPORT RESTRICTIONS. You must comply with all domestic and international export
65
+ laws and regulations that apply to the software, which include restrictions on destinations,
66
+ end users, and end use. For further information on export restrictions, visit
67
+ https://www.microsoft.com/exporting.
68
+ 9. APPLICABLE LAW. If you acquired the software in the United States, Washington state
69
+ law applies to interpretation of, and claims for breach of this agreement, and the laws of
70
+ the state where you live apply to all other claims. If you acquired the software in any other
71
+ country, its laws apply.
72
+ 10. CONSUMER RIGHTS; REGIONAL VARIATIONS. These license terms describe certain
73
+ legal rights. You may have other rights, including consumer rights, under the laws of your
74
+ state or country. You may also have rights with respect to the party from which you
75
+ acquired the software. This agreement does not change those other rights if the laws of
76
+ your state or country do not permit it to do so. For example, if you acquired the software in
77
+ one of the below regions, or mandatory country law applies, then the following provisions
78
+ apply to you:
79
+ a. Australia. You have statutory guarantees under the Australian Consumer Law and
80
+ nothing in this agreement is intended to affect those rights.
81
+ b. Canada. You may stop receiving updates on your device by turning off Internet access. If
82
+ and when you re-connect to the Internet, the software will resume checking for and
83
+ installing updates.
84
+ c. Germany and Austria.
85
+ (i) Warranty. The properly licensed software will perform substantially as described in any
86
+ Microsoft materials that accompany the software. However, Microsoft gives no contractual
87
+ guarantee in relation to the licensed software.
88
+ (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based
89
+ on the Product Liability Act, as well as, in the case of death or personal or physical injury,
90
+ Microsoft is liable according to the statutory law.
91
+ Subject to the preceding sentence (ii), Microsoft will only be liable for slight negligence if
92
+ Microsoft is in breach of such material contractual obligations, the fulfillment of which
93
+ facilitate the due performance of this agreement, the breach of which would endanger the
94
+ purpose of this agreement and the compliance with which a party may constantly trust in
95
+ (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be
96
+ liable for slight negligence.
97
+ 11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS”. YOU BEAR THE
98
+ RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR
99
+ CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT
100
+ EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
101
+ PARTICULAR PURPOSE AND NON-INFRINGEMENT.
102
+ 12. LIMITATION ON AND EXCLUSION OF DAMAGES. YOU CAN RECOVER FROM
103
+ MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU
104
+ CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST
105
+ PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
106
+ This limitation applies to (a) anything related to the software, services, content (including
107
+ code) on third party Internet sites, or third party applications; and (b) claims for breach of
108
+ contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort
109
+ to the extent permitted by applicable law.
110
+ It also applies even if Microsoft knew or should have known about the possibility of the
111
+ damages. The above limitation or exclusion may not apply to you because your country
112
+ may not allow the exclusion or limitation of incidental, consequential or other damages.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @microsoft/power-apps-native-common
2
+
3
+ Shared utilities and types for Power Apps native packages.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install @microsoft/power-apps-native-common
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { } from '@microsoft/power-apps-native-common';
15
+ ```
package/lib/NOTICE.txt ADDED
@@ -0,0 +1,179 @@
1
+ NOTICES
2
+
3
+ This repository incorporates material as listed below or described in the code.
4
+
5
+ ========================================================================
6
+
7
+ @microsoft/1ds-core-js 4.3.11
8
+ --
9
+ The MIT License (MIT)
10
+
11
+ Copyright (c) Microsoft Corporation
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+
31
+ ========================================================================
32
+
33
+ @microsoft/1ds-post-js 4.3.11
34
+ --
35
+ The MIT License (MIT)
36
+
37
+ Copyright (c) Microsoft Corporation
38
+
39
+ Permission is hereby granted, free of charge, to any person obtaining a copy
40
+ of this software and associated documentation files (the "Software"), to deal
41
+ in the Software without restriction, including without limitation the rights
42
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43
+ copies of the Software, and to permit persons to whom the Software is
44
+ furnished to do so, subject to the following conditions:
45
+
46
+ The above copyright notice and this permission notice shall be included in all
47
+ copies or substantial portions of the Software.
48
+
49
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
52
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
53
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
54
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
55
+ SOFTWARE.
56
+
57
+ ========================================================================
58
+
59
+ @microsoft/applicationinsights-core-js 3.4.1
60
+ --
61
+ The MIT License (MIT)
62
+
63
+ Copyright (c) Microsoft Corporation
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy
66
+ of this software and associated documentation files (the "Software"), to deal
67
+ in the Software without restriction, including without limitation the rights
68
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69
+ copies of the Software, and to permit persons to whom the Software is
70
+ furnished to do so, subject to the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be included in all
73
+ copies or substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
+ SOFTWARE.
82
+
83
+ ========================================================================
84
+
85
+ @microsoft/applicationinsights-shims 3.0.1
86
+ --
87
+ The MIT License (MIT)
88
+
89
+ Copyright (c) Microsoft Corporation
90
+
91
+ Permission is hereby granted, free of charge, to any person obtaining a copy
92
+ of this software and associated documentation files (the "Software"), to deal
93
+ in the Software without restriction, including without limitation the rights
94
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
95
+ copies of the Software, and to permit persons to whom the Software is
96
+ furnished to do so, subject to the following conditions:
97
+
98
+ The above copyright notice and this permission notice shall be included in all
99
+ copies or substantial portions of the Software.
100
+
101
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
107
+ SOFTWARE.
108
+
109
+ ========================================================================
110
+
111
+ @microsoft/dynamicproto-js 2.0.5
112
+ --
113
+ Copyright Microsoft Application Insights Team; licensed under MIT (https://spdx.org/licenses/MIT.html)
114
+
115
+ ========================================================================
116
+
117
+ @nevware21/ts-async 0.6.1
118
+ --
119
+ MIT License
120
+
121
+ Copyright (c) 2022 NevWare21 Solutions LLC
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
+ @nevware21/ts-utils 0.15.0
144
+ --
145
+ MIT License
146
+
147
+ Copyright (c) 2022 NevWare21 Solutions LLC
148
+
149
+ Permission is hereby granted, free of charge, to any person obtaining a copy
150
+ of this software and associated documentation files (the "Software"), to deal
151
+ in the Software without restriction, including without limitation the rights
152
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
153
+ copies of the Software, and to permit persons to whom the Software is
154
+ furnished to do so, subject to the following conditions:
155
+
156
+ The above copyright notice and this permission notice shall be included in all
157
+ copies or substantial portions of the Software.
158
+
159
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
160
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
161
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
162
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
163
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
164
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
165
+ SOFTWARE.
166
+
167
+ ========================================================================
168
+
169
+ uuid 11.1.1
170
+ --
171
+ The MIT License (MIT)
172
+
173
+ Copyright (c) 2010-2020 Robert Kieffer and other contributors
174
+
175
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
176
+
177
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
178
+
179
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TelemetryEventNames = exports.ScenarioResults = void 0;
7
+ /*!
8
+ * Copyright (C) Microsoft Corporation. All rights reserved.
9
+ */
10
+
11
+ /** Canonical 1DS event names matching webplayer conventions. */
12
+ const TelemetryEventNames = exports.TelemetryEventNames = {
13
+ Activity: 'PowerAppsClient.Activity',
14
+ Error: 'PowerAppsClient.Error',
15
+ StartScenario: 'PowerAppsClient.StartScenario',
16
+ EndScenario: 'PowerAppsClient.EndScenario'
17
+ };
18
+ const ScenarioResults = exports.ScenarioResults = {
19
+ Success: 'Success',
20
+ Failed: 'Failed',
21
+ SuccessWithErrors: 'SuccessWithErrors'
22
+ };
23
+
24
+ /** Telemetry data residency location. EU routes to eu-mobile collector. */
25
+
26
+ /**
27
+ * Structural type for the 1DS telemetry envelope passed to telemetry initializers.
28
+ * Decouples consumers from the internal `ITelemetryItem` type.
29
+ */
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ConsoleAdapter", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ConsoleAdapter.ConsoleAdapter;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Logger", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Logger.Logger;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "OneDsTelemetryProvider", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _OneDsTelemetryProvider.OneDsTelemetryProvider;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "Regions", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _ClusterCategory.Regions;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "ScenarioResults", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _TelemetryTypes.ScenarioResults;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "TelemetryEventNames", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _TelemetryTypes.TelemetryEventNames;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "configureAppLogger", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _AppLogger.configureAppLogger;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "getAppLogger", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _AppLogger.getAppLogger;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "regionToClusterCategory", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _ClusterCategory.regionToClusterCategory;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "resolveDeviceId", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _DeviceIdUtils.resolveDeviceId;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "resolveTelemetryLocation", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _resolveTelemetryLocation.resolveTelemetryLocation;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "sanitizeErrorString", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _TelemetrySanitizer.sanitizeErrorString;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "sanitizeProperties", {
79
+ enumerable: true,
80
+ get: function () {
81
+ return _TelemetrySanitizer.sanitizeProperties;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "sanitizeUrl", {
85
+ enumerable: true,
86
+ get: function () {
87
+ return _TelemetrySanitizer.sanitizeUrl;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "stringifyError", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _stringifyError.stringifyError;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "suppressKnownWarnings", {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _suppressKnownWarnings.suppressKnownWarnings;
100
+ }
101
+ });
102
+ var _ConsoleAdapter = require("./telemetry/ConsoleAdapter.js");
103
+ var _Logger = require("./telemetry/Logger.js");
104
+ var _OneDsTelemetryProvider = require("./telemetry/OneDsTelemetryProvider.js");
105
+ var _resolveTelemetryLocation = require("./telemetry/resolveTelemetryLocation.js");
106
+ var _stringifyError = require("./telemetry/stringifyError.js");
107
+ var _TelemetrySanitizer = require("./telemetry/TelemetrySanitizer.js");
108
+ var _suppressKnownWarnings = require("./telemetry/suppressKnownWarnings.js");
109
+ var _DeviceIdUtils = require("./utils/DeviceIdUtils.js");
110
+ var _AppLogger = require("./telemetry/AppLogger.js");
111
+ var _TelemetryTypes = require("./telemetry/TelemetryTypes.js");
112
+ var _ClusterCategory = require("./types/ClusterCategory.js");
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.configureAppLogger = configureAppLogger;
7
+ exports.getAppLogger = getAppLogger;
8
+ var _Logger = require("./Logger.js");
9
+ /*!
10
+ * Copyright (C) Microsoft Corporation. All rights reserved.
11
+ *
12
+ * power-apps-native-common — app-level logger singleton
13
+ *
14
+ * Provides a single shared `ILogger` instance for the entire app process.
15
+ * The logger starts as a no-op (no providers) and is configured once at
16
+ * startup by the hosting infrastructure (e.g. `PowerAppsProvider`).
17
+ *
18
+ * App code and library packages call `getAppLogger()` to emit telemetry
19
+ * without coupling to a specific provider or needing to pass a logger around.
20
+ *
21
+ * Usage in a library:
22
+ *
23
+ * import { getAppLogger } from '@microsoft/power-apps-native-common';
24
+ * getAppLogger().trackActivityEvent('MyLib.SomeOperation', { … });
25
+ *
26
+ * Usage in the host / root layout (once, at startup):
27
+ *
28
+ * import { configureAppLogger } from '@microsoft/power-apps-native-common';
29
+ * configureAppLogger(new Logger({ providers: [myProvider] }));
30
+ */
31
+
32
+ let _logger = new _Logger.Logger(); // no-op until configured
33
+
34
+ /**
35
+ * Replace the shared app logger with a configured instance.
36
+ * All subsequent `getAppLogger()` calls return the new instance.
37
+ * Idempotent — calling again replaces the previous logger.
38
+ */
39
+ function configureAppLogger(logger) {
40
+ _logger = logger;
41
+ }
42
+
43
+ /**
44
+ * Returns the shared app-level logger.
45
+ * No-op (no providers) until `configureAppLogger` is called.
46
+ */
47
+ function getAppLogger() {
48
+ return _logger;
49
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ConsoleAdapter = void 0;
7
+ var _GuidUtils = require("../utils/GuidUtils.js");
8
+ /*!
9
+ * Copyright (C) Microsoft Corporation. All rights reserved.
10
+ */
11
+
12
+ /**
13
+ * A telemetry adapter that writes events to the JavaScript console.
14
+ * Useful during development and for unit-testing telemetry flows.
15
+ * Can be replaced in production by the native telemetry adapter.
16
+ */
17
+ class ConsoleAdapter {
18
+ defaultProperties = {};
19
+ constructor(minSeverity = 'verbose') {
20
+ this.minSeverity = minSeverity;
21
+ this._sessionId = (0, _GuidUtils.generateGuid)();
22
+ }
23
+ track(event) {
24
+ const payload = {
25
+ ...event.properties,
26
+ sessionId: this._sessionId,
27
+ ...this.defaultProperties,
28
+ ...(this.userIdentity ?? {})
29
+ };
30
+ const label = `[${event.severity.toUpperCase()}] ${event.eventName} | ${event.properties['operationName'] ?? ''} (#${event.sequenceNumber})`;
31
+ switch (event.severity) {
32
+ case 'error':
33
+ console.error(label, payload);
34
+ break;
35
+ case 'warning':
36
+ console.warn(label, payload);
37
+ break;
38
+ case 'verbose':
39
+ console.debug(label, payload);
40
+ break;
41
+ default:
42
+ console.log(label, payload);
43
+ }
44
+ }
45
+ flush() {
46
+ return Promise.resolve();
47
+ }
48
+ teardown() {
49
+ return Promise.resolve();
50
+ }
51
+ get sessionId() {
52
+ return this._sessionId;
53
+ }
54
+ set sessionId(value) {
55
+ this._sessionId = value;
56
+ }
57
+ identifyUser(identity) {
58
+ this.userIdentity = identity;
59
+ }
60
+ setDefaultProperty(name, value) {
61
+ this.defaultProperties[name] = value;
62
+ }
63
+ }
64
+ exports.ConsoleAdapter = ConsoleAdapter;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });